Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(664)

Unified Diff: webrtc/modules/desktop_capture/shared_desktop_frame.h

Issue 1988783003: Use std::unique_ptr<> to pass frame ownership in DesktopCapturer impls. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/desktop_capture/shared_desktop_frame.h
diff --git a/webrtc/modules/desktop_capture/shared_desktop_frame.h b/webrtc/modules/desktop_capture/shared_desktop_frame.h
index 4f6a2bb7c693ea9c265d7c03c2a3b13ba4210cb1..d9a521b0642d8a6c47d936acbfe97d8762a5f64d 100644
--- a/webrtc/modules/desktop_capture/shared_desktop_frame.h
+++ b/webrtc/modules/desktop_capture/shared_desktop_frame.h
@@ -12,6 +12,7 @@
#define WEBRTC_MODULES_DESKTOP_CAPTURE_SHARED_DESKTOP_FRAME_H_
#include "webrtc/base/constructormagic.h"
+#include "webrtc/base/refcount.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/modules/desktop_capture/desktop_frame.h"
@@ -23,20 +24,25 @@ class SharedDesktopFrame : public DesktopFrame {
public:
virtual ~SharedDesktopFrame();
+ static std::unique_ptr<SharedDesktopFrame> Wrap(
+ std::unique_ptr<DesktopFrame> desktop_frame);
+
+ // Deprecated.
+ // TODO(sergeyu): remove this method.
static SharedDesktopFrame* Wrap(DesktopFrame* desktop_frame);
// Returns the underlying instance of DesktopFrame.
DesktopFrame* GetUnderlyingFrame();
// Creates a clone of this object.
- SharedDesktopFrame* Share();
+ std::unique_ptr<SharedDesktopFrame> Share();
// Checks if the frame is currently shared. If it returns false it's
// guaranteed that there are no clones of the object.
bool IsShared();
private:
- class Core;
+ typedef rtc::RefCountedObject<std::unique_ptr<DesktopFrame>> Core;
SharedDesktopFrame(rtc::scoped_refptr<Core> core);
« no previous file with comments | « webrtc/modules/desktop_capture/screen_capturer_x11.cc ('k') | webrtc/modules/desktop_capture/shared_desktop_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698