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

Unified Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.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/win/screen_capturer_win_gdi.h
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
index 5a50580e6909771e100533e5c05204a0fa86940c..3c855e4a4f055baa0233eff0874e54753505e32d 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h
@@ -56,9 +56,9 @@ class ScreenCapturerWinGdi : public ScreenCapturer {
// Capture the current cursor shape.
void CaptureCursor();
- Callback* callback_;
+ Callback* callback_ = nullptr;
std::unique_ptr<SharedMemoryFactory> shared_memory_factory_;
- ScreenId current_screen_id_;
+ ScreenId current_screen_id_ = kFullDesktopScreenId;
std::wstring current_device_key_;
// A thread-safe list of invalid rectangles, and the size of the most
@@ -68,8 +68,8 @@ class ScreenCapturerWinGdi : public ScreenCapturer {
ScopedThreadDesktop desktop_;
// GDI resources used for screen capture.
- HDC desktop_dc_;
- HDC memory_dc_;
+ HDC desktop_dc_ = NULL;
+ HDC memory_dc_ = NULL;
// Queue of the frames buffers.
ScreenCaptureFrameQueue<SharedDesktopFrame> queue_;
@@ -81,11 +81,11 @@ class ScreenCapturerWinGdi : public ScreenCapturer {
// Class to calculate the difference between two screen bitmaps.
std::unique_ptr<Differ> differ_;
- HMODULE dwmapi_library_;
- DwmEnableCompositionFunc composition_func_;
+ HMODULE dwmapi_library_ = NULL;
+ DwmEnableCompositionFunc composition_func_ = nullptr;
// Used to suppress duplicate logging of SetThreadExecutionState errors.
- bool set_thread_execution_state_failed_;
+ bool set_thread_execution_state_failed_ = false;
RTC_DISALLOW_COPY_AND_ASSIGN(ScreenCapturerWinGdi);
};

Powered by Google App Engine
This is Rietveld 408576698