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

Unified Diff: chrome/browser/ui/views/frame/browser_frame_ash.cc

Issue 154633003: Attempt at fixing possible shutdown crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OnWindowDestroying Created 6 years, 10 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 | « chrome/browser/ui/views/frame/browser_frame_ash.h ('k') | chrome/browser/ui/views/frame/browser_shutdown.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/browser_frame_ash.cc
diff --git a/chrome/browser/ui/views/frame/browser_frame_ash.cc b/chrome/browser/ui/views/frame/browser_frame_ash.cc
index b0d431d68097c1b1e22ae6b7839ca43ec132ac9e..e1056a5e9837167995dca16c422c77207cc2fc22 100644
--- a/chrome/browser/ui/views/frame/browser_frame_ash.cc
+++ b/chrome/browser/ui/views/frame/browser_frame_ash.cc
@@ -9,6 +9,7 @@
#include "ash/wm/window_util.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/views/frame/browser_shutdown.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
@@ -88,6 +89,14 @@ BrowserFrameAsh::BrowserFrameAsh(BrowserFrame* browser_frame,
///////////////////////////////////////////////////////////////////////////////
// BrowserFrameAsh, views::NativeWidgetAura overrides:
+void BrowserFrameAsh::OnWindowDestroying() {
+ // Destroy any remaining WebContents early on. Doing so may result in
+ // calling back to one of the Views/LayoutManagers or supporting classes of
+ // BrowserView. By destroying here we ensure all said classes are valid.
+ DestroyBrowserWebContents(browser_view_->browser());
+ NativeWidgetAura::OnWindowDestroying();
+}
+
void BrowserFrameAsh::OnWindowTargetVisibilityChanged(bool visible) {
if (visible) {
// Once the window has been shown we know the requested bounds
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_ash.h ('k') | chrome/browser/ui/views/frame/browser_shutdown.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698