From 14d3aff86097e05ccf6319114f1711b2129762e9 Mon Sep 17 00:00:00 2001 From: miu Date: Thu, 3 Sep 2015 15:20:34 -0700 Subject: Crash fix for window closed during Aura window capture. The root cause was that while the code *did* have a WindowObserver to stop capture when the window was destroyed, it erroneously did so by posting a task that would be executed too late. This change makes the stop operation synchronous. BUG=513103 Review URL: https://codereview.chromium.org/1327673006 Cr-Commit-Position: refs/heads/master@{#347266} --- content/browser/media/capture/aura_window_capture_machine.cc | 6 +++--- content/browser/media/capture/aura_window_capture_machine.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'content/browser/media') diff --git a/content/browser/media/capture/aura_window_capture_machine.cc b/content/browser/media/capture/aura_window_capture_machine.cc index 1da5506..f4db960 100644 --- a/content/browser/media/capture/aura_window_capture_machine.cc +++ b/content/browser/media/capture/aura_window_capture_machine.cc @@ -456,12 +456,12 @@ void AuraWindowCaptureMachine::OnWindowBoundsChanged( &AuraWindowCaptureMachine::UpdateCaptureSize, AsWeakPtr())); } -void AuraWindowCaptureMachine::OnWindowDestroyed(aura::Window* window) { +void AuraWindowCaptureMachine::OnWindowDestroying(aura::Window* window) { DCHECK_CURRENTLY_ON(BrowserThread::UI); - Stop(base::Bind(&base::DoNothing)); + InternalStop(base::Bind(&base::DoNothing)); - oracle_proxy_->ReportError("OnWindowDestroyed()"); + oracle_proxy_->ReportError("OnWindowDestroying()"); } void AuraWindowCaptureMachine::OnWindowAddedToRootWindow( diff --git a/content/browser/media/capture/aura_window_capture_machine.h b/content/browser/media/capture/aura_window_capture_machine.h index 0b8d15c..91e0603 100644 --- a/content/browser/media/capture/aura_window_capture_machine.h +++ b/content/browser/media/capture/aura_window_capture_machine.h @@ -44,7 +44,7 @@ class AuraWindowCaptureMachine void OnWindowBoundsChanged(aura::Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) override; - void OnWindowDestroyed(aura::Window* window) override; + void OnWindowDestroying(aura::Window* window) override; void OnWindowAddedToRootWindow(aura::Window* window) override; void OnWindowRemovingFromRootWindow(aura::Window* window, aura::Window* new_root) override; -- cgit v1.1