summaryrefslogtreecommitdiffstats
path: root/ui/views/widget
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-09 21:26:30 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-09 21:26:30 +0000
commit8c0e82adf4b4291ff531c2689cff34878ae8dd72 (patch)
tree7a522f6528ffc06131a2cb9eb207df59e369b0d7 /ui/views/widget
parentf17c00f053050c9cfc4168b6a177809acb12a39e (diff)
downloadchromium_src-8c0e82adf4b4291ff531c2689cff34878ae8dd72.zip
chromium_src-8c0e82adf4b4291ff531c2689cff34878ae8dd72.tar.gz
chromium_src-8c0e82adf4b4291ff531c2689cff34878ae8dd72.tar.bz2
Fixes crah in NativeWidgetAura::IsActive()
The crash happens if when the HWND is destroyed someone asks if a child NativeWidgetAura is Active. In particular during this code path we've gone through ~RootWindow and are in ~Window. When this happens GetRootWindow() uses Window's implementation, which returns NULL and we crash. BUG=264855 TEST=none R=ben@chromium.org Review URL: https://chromiumcodereview.appspot.com/23904005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/widget')
-rw-r--r--ui/views/widget/native_widget_aura.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index f9ebed7..86012a5 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -521,9 +521,14 @@ void NativeWidgetAura::Deactivate() {
}
bool NativeWidgetAura::IsActive() const {
- return window_ &&
- aura::client::GetActivationClient(window_->GetRootWindow())->
- GetActiveWindow() == window_;
+ if (!window_)
+ return false;
+
+ // We may up here during destruction of the root, in which case
+ // GetRootWindow() returns NULL (~RootWindow() has run and we're in ~Window).
+ aura::RootWindow* root = window_->GetRootWindow();
+ return root &&
+ aura::client::GetActivationClient(root)->GetActiveWindow() == window_;
}
void NativeWidgetAura::SetAlwaysOnTop(bool on_top) {