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

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

Issue 10391065: handle the case when device is closed before media pipeline is fully initialized. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 7 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 | « content/browser/renderer_host/media/video_capture_manager.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/video_capture_manager.cc
===================================================================
--- content/browser/renderer_host/media/video_capture_manager.cc (revision 138673)
+++ content/browser/renderer_host/media/video_capture_manager.cc (working copy)
@@ -194,6 +194,15 @@
if (device_it != devices_.end()) {
video_capture_device = device_it->second;
devices_.erase(device_it);
+
+ Controllers::iterator cit = controllers_.find(video_capture_device);
+ if (cit != controllers_.end()) {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&VideoCaptureController::StopSession,
+ cit->second->controller, capture_session_id));
+ }
+
if (!DeviceInUse(video_capture_device)) {
// No other users of this device, deallocate (if not done already) and
// delete the device. No need to take care of the controller, that is done
@@ -205,14 +214,6 @@
controllers_.erase(cit);
}
delete video_capture_device;
- } else {
- Controllers::iterator cit = controllers_.find(video_capture_device);
- if (cit != controllers_.end()) {
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- base::Bind(&VideoCaptureController::StopSession,
- cit->second->controller, capture_session_id));
- }
}
}
PostOnClosed(capture_session_id);
« no previous file with comments | « content/browser/renderer_host/media/video_capture_manager.h ('k') | content/content_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698