Commit e5c11f75 authored by mark@chromium.org's avatar mark@chromium.org

Back out trunk r245028

It seems to have cuased bug 335108 and XP Tests 1 interactive_ui_tests BookmarkBarViewTest18.BookmarkBarViewTest18_SiblingMenu
http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%281%29/builds/29747

> aura: Destroy the compositor before destroying the backing window.
> 
> This was causing linux_aura single-process browser tests to crash since
> they don't set up a default X error handler. When the compositor is
> shutting down it does a finish and this might try to swap to the X
> window.
> 
> Also change the windows shutdown ordering to match.
> 
> R=ben, enne
> BUG=270918
> 
> Review URL: https://codereview.chromium.org/132473007

TBR=danakj@chromium.org

Review URL: https://codereview.chromium.org/137893014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245215 0039d316-1c4b-4281-b951-d872f2087c98
parent a49dac5e
...@@ -167,10 +167,7 @@ WindowTreeHost::WindowTreeHost() ...@@ -167,10 +167,7 @@ WindowTreeHost::WindowTreeHost()
: delegate_(NULL) { : delegate_(NULL) {
} }
void WindowTreeHost::DestroyCompositor() { void WindowTreeHost::DestroyCompositor() { compositor_.reset(); }
DCHECK(GetAcceleratedWidget());
compositor_.reset();
}
void WindowTreeHost::CreateCompositor( void WindowTreeHost::CreateCompositor(
gfx::AcceleratedWidget accelerated_widget) { gfx::AcceleratedWidget accelerated_widget) {
......
...@@ -260,10 +260,7 @@ LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd, ...@@ -260,10 +260,7 @@ LRESULT CALLBACK WindowImpl::WndProc(HWND hwnd,
if (!window) if (!window)
return 0; return 0;
LRESULT result = window->OnWndProc(message, w_param, l_param); return window->OnWndProc(message, w_param, l_param);
if (message == WM_NCDESTROY)
window->hwnd_ = NULL;
return result;
} }
ATOM WindowImpl::GetWindowClassAtom() { ATOM WindowImpl::GetWindowClassAtom() {
......
...@@ -88,6 +88,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( ...@@ -88,6 +88,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin(
} }
DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() { DesktopWindowTreeHostWin::~DesktopWindowTreeHostWin() {
DestroyCompositor();
// WARNING: |content_window_| has been destroyed by the time we get here. // WARNING: |content_window_| has been destroyed by the time we get here.
desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed( desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(
root_window_); root_window_);
...@@ -769,10 +770,6 @@ void DesktopWindowTreeHostWin::HandleCreate() { ...@@ -769,10 +770,6 @@ void DesktopWindowTreeHostWin::HandleCreate() {
void DesktopWindowTreeHostWin::HandleDestroying() { void DesktopWindowTreeHostWin::HandleDestroying() {
drag_drop_client_->OnNativeWidgetDestroying(GetHWND()); drag_drop_client_->OnNativeWidgetDestroying(GetHWND());
native_widget_delegate_->OnNativeWidgetDestroying(); native_widget_delegate_->OnNativeWidgetDestroying();
// Destroy the compositor before destroying the HWND since shutdown
// may try to swap to the window.
DestroyCompositor();
} }
void DesktopWindowTreeHostWin::HandleDestroyed() { void DesktopWindowTreeHostWin::HandleDestroyed() {
......
...@@ -142,6 +142,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( ...@@ -142,6 +142,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
} }
DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() { DesktopWindowTreeHostX11::~DesktopWindowTreeHostX11() {
DestroyCompositor();
root_window_->window()->ClearProperty(kHostForRootWindow); root_window_->window()->ClearProperty(kHostForRootWindow);
aura::client::SetWindowMoveClient(root_window_->window(), NULL); aura::client::SetWindowMoveClient(root_window_->window(), NULL);
desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(root_window_); desktop_native_widget_aura_->OnDesktopWindowTreeHostDestroyed(root_window_);
...@@ -319,11 +320,6 @@ void DesktopWindowTreeHostX11::CloseNow() { ...@@ -319,11 +320,6 @@ void DesktopWindowTreeHostX11::CloseNow() {
desktop_native_widget_aura_->root_window_event_filter()->RemoveHandler( desktop_native_widget_aura_->root_window_event_filter()->RemoveHandler(
x11_window_event_filter_.get()); x11_window_event_filter_.get());
// Destroy the compositor before destroying the |xwindow_| since shutdown
// may try to swap, and the swap without a window causes an X error, which
// causes a crash with in-process renderer.
DestroyCompositor();
open_windows().remove(xwindow_); open_windows().remove(xwindow_);
// Actually free our native resources. // Actually free our native resources.
base::MessagePumpX11::Current()->RemoveDispatcherForWindow(xwindow_); base::MessagePumpX11::Current()->RemoveDispatcherForWindow(xwindow_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment