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

Unified Diff: webrtc/modules/desktop_capture/desktop_capturer.cc

Issue 2754403002: Fix DesktopCapturer constructors to handle failures properly. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/desktop_capturer.cc
diff --git a/webrtc/modules/desktop_capture/desktop_capturer.cc b/webrtc/modules/desktop_capture/desktop_capturer.cc
index 37b3396df9ea45e4a78047fc67aaeb8a5e997be4..e655474e70a18fa79b36cb7cc6fdac12380bcc9f 100644
--- a/webrtc/modules/desktop_capture/desktop_capturer.cc
+++ b/webrtc/modules/desktop_capture/desktop_capturer.cc
@@ -38,7 +38,7 @@ bool DesktopCapturer::FocusOnSelectedSource() {
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
const DesktopCaptureOptions& options) {
std::unique_ptr<DesktopCapturer> capturer = CreateRawWindowCapturer(options);
- if (options.detect_updated_region()) {
+ if (capturer && options.detect_updated_region()) {
capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
}
@@ -49,7 +49,7 @@ std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateWindowCapturer(
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateScreenCapturer(
const DesktopCaptureOptions& options) {
std::unique_ptr<DesktopCapturer> capturer = CreateRawScreenCapturer(options);
- if (options.detect_updated_region()) {
+ if (capturer && options.detect_updated_region()) {
capturer.reset(new DesktopCapturerDifferWrapper(std::move(capturer)));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698