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

Unified Diff: content/browser/renderer_host/media/desktop_capture_device_aura.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: Addressed miu's comments 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_device_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/desktop_capture_device_aura.cc
diff --git a/content/browser/renderer_host/media/desktop_capture_device_aura.cc b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
index 3783a2a50a43548a70adbb1da564490b39a42122..3f8b66fa530dbdec768ef84c0b43e0fb7b97cdca 100644
--- a/content/browser/renderer_host/media/desktop_capture_device_aura.cc
+++ b/content/browser/renderer_host/media/desktop_capture_device_aura.cc
@@ -97,7 +97,7 @@ class DesktopVideoCaptureMachine
// VideoCaptureFrameSource overrides.
virtual bool Start(
const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy) OVERRIDE;
- virtual void Stop() OVERRIDE;
+ virtual void Stop(const base::Closure& callback) OVERRIDE;
// Implements aura::WindowObserver.
virtual void OnWindowBoundsChanged(aura::Window* window,
@@ -213,7 +213,7 @@ bool DesktopVideoCaptureMachine::Start(
return true;
}
-void DesktopVideoCaptureMachine::Stop() {
+void DesktopVideoCaptureMachine::Stop(const base::Closure& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Stop observing window events.
@@ -234,6 +234,8 @@ void DesktopVideoCaptureMachine::Stop() {
timer_.Stop();
started_ = false;
+
+ callback.Run();
}
void DesktopVideoCaptureMachine::UpdateCaptureSize() {
@@ -401,7 +403,7 @@ void DesktopVideoCaptureMachine::OnWindowBoundsChanged(
void DesktopVideoCaptureMachine::OnWindowDestroyed(aura::Window* window) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- Stop();
+ Stop(base::Bind(&base::DoNothing));
oracle_proxy_->ReportError();
}
« no previous file with comments | « no previous file | content/browser/renderer_host/media/video_capture_device_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698