Chromium Code Reviews| 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_ |