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

Unified Diff: chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm

Issue 20243003: Fix crash when reloading packaged app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to after mac app shim fix Created 7 years, 4 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
Index: chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
index 67611f45199a79ff92c2949ceaaf0be0de9b1848..49f2218ae09706fe5c1c5d4f2d57de21f2381a87 100644
--- a/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.mm
@@ -4,8 +4,10 @@
#include "chrome/browser/ui/cocoa/extensions/native_app_window_cocoa.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/mac/mac_util.h"
+#include "base/message_loop/message_loop.h"
#include "base/strings/sys_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/browser_window_utils.h"
@@ -758,7 +760,13 @@ void NativeAppWindowCocoa::RemoveObserver(
void NativeAppWindowCocoa::WindowWillClose() {
[window_controller_ setAppWindow:NULL];
shell_window_->OnNativeWindowChanged();
- shell_window_->OnNativeClose();
+ // On other platforms, the native window doesn't get destroyed synchronously.
+ // We simulate that here so that ShellWindow can assume that it doesn't get
+ // deleted immediately upon calling Close().
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&ShellWindow::OnNativeClose,
+ base::Unretained(shell_window_)));
}
void NativeAppWindowCocoa::WindowDidBecomeKey() {
« no previous file with comments | « chrome/browser/extensions/shell_window_registry.cc ('k') | chrome/browser/ui/gtk/extensions/native_app_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698