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

Unified Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 2408853002: VideoCaptureHost: Remove |controllers_| entry before calling VideoCaptureManager::StopCaptureForCli… (Closed)
Patch Set: Created 4 years, 2 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: content/browser/renderer_host/media/video_capture_host.cc
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
index 51e655c846e5ca9c1b6cbf3a85df9206502a5c20..738f3efea71a0003a6fe0104278252c2930a1c69 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -296,11 +296,13 @@ void VideoCaptureHost::DeleteVideoCaptureController(
if (it == controllers_.end())
return;
- if (it->second) {
- media_stream_manager_->video_capture_manager()->StopCaptureForClient(
- it->second.get(), controller_id, this, on_error);
- }
+ const base::WeakPtr<VideoCaptureController> controller = it->second;
controllers_.erase(it);
+ if (!controller)
+ return;
+
+ media_stream_manager_->video_capture_manager()->StopCaptureForClient(
+ controller.get(), controller_id, this, on_error);
}
} // namespace content
« 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