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

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

Issue 2697453002: [DesktopCapturer] FallbackDesktopCapturerWrapper and its tests (Closed)
Patch Set: Resolve review comments Created 3 years, 10 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_memory.h
diff --git a/webrtc/modules/desktop_capture/shared_memory.h b/webrtc/modules/desktop_capture/shared_memory.h
index 6e15f23f6b8a4a0429f2d4aa2c09228f447d03bc..f2c1d0428ec587e07803671b9ea18ac5b77a7754 100644
--- a/webrtc/modules/desktop_capture/shared_memory.h
+++ b/webrtc/modules/desktop_capture/shared_memory.h
@@ -76,6 +76,25 @@ class SharedMemoryFactory {
RTC_DISALLOW_COPY_AND_ASSIGN(SharedMemoryFactory);
};
+// Implementation to share a SharedMemoryFactory between DesktopCapturer
+// instances.
+class SharedMemoryFactoryWrapper : public SharedMemoryFactory {
Sergey Ulanov 2017/02/15 23:08:43 Suggest putting this class in fallback_desktop_cap
Hzj_jie 2017/02/16 01:57:07 Done.
+ public:
+ SharedMemoryFactoryWrapper(std::unique_ptr<SharedMemoryFactory> factory);
+ ~SharedMemoryFactoryWrapper() override;
+
+ // Creates a SharedMemoryFactory, which should not overlive current instance.
+ std::unique_ptr<SharedMemoryFactory> Wrap() const;
+
+ std::unique_ptr<SharedMemory> CreateSharedMemory(size_t size) override;
+
+ private:
+ SharedMemoryFactoryWrapper(SharedMemoryFactory* factory);
+
+ std::unique_ptr<SharedMemoryFactory> owned_factory_;
+ SharedMemoryFactory* shared_factory_ = nullptr;
+};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_DESKTOP_CAPTURE_SHARED_MEMORY_H_

Powered by Google App Engine
This is Rietveld 408576698