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

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

Issue 130253002: Attempt to fixed crash on stop mirroring by stopping render thread on a worker thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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: content/browser/renderer_host/media/video_capture_device_impl.cc
diff --git a/content/browser/renderer_host/media/video_capture_device_impl.cc b/content/browser/renderer_host/media/video_capture_device_impl.cc
index 3a94d50706dfebbbdc488399472d8f954ef6f3e5..b71004cb4691b12b2e038d40beedd020f7b5cdc1 100644
--- a/content/browser/renderer_host/media/video_capture_device_impl.cc
+++ b/content/browser/renderer_host/media/video_capture_device_impl.cc
@@ -35,7 +35,6 @@ void DeleteCaptureMachineOnUIThread(
scoped_ptr<VideoCaptureMachine> capture_machine) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (capture_machine) {
- capture_machine->Stop();
capture_machine.reset();
}
}
@@ -247,7 +246,8 @@ void VideoCaptureDeviceImpl::StopAndDeAllocate() {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE, base::Bind(
&VideoCaptureMachine::Stop,
- base::Unretained(capture_machine_.get())));
+ base::Unretained(capture_machine_.get()),
+ base::Bind(&base::DoNothing)));
}
void VideoCaptureDeviceImpl::CaptureStarted(bool success) {
@@ -268,8 +268,11 @@ VideoCaptureDeviceImpl::~VideoCaptureDeviceImpl() {
// safely stop the capture machine.
if (capture_machine_) {
BrowserThread::PostTask(
- BrowserThread::UI, FROM_HERE, base::Bind(
- &DeleteCaptureMachineOnUIThread, base::Passed(&capture_machine_)));
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(&VideoCaptureMachine::Stop,
+ base::Unretained(capture_machine_.get()),
+ base::Bind(&DeleteCaptureMachineOnUIThread,
+ base::Passed(&capture_machine_))));
imcheng 2014/01/09 01:15:17 Not sure if this is problematic here - will VideoC
Alpha Left Google 2014/01/09 01:37:07 when you call base::Bind(&DeleteCaptureMachineOnUI
imcheng 2014/01/09 23:31:09 Thanks for the explanation. I changed the code to
}
DVLOG(1) << "VideoCaptureDeviceImpl@" << this << " destroying.";
}

Powered by Google App Engine
This is Rietveld 408576698