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

Unified Diff: trunk/src/apps/shell_window.cc

Issue 22356002: Revert 215745 "Fix crash when reloading packaged app. " (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
« no previous file with comments | « trunk/src/apps/shell_window.h ('k') | trunk/src/chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/apps/shell_window.cc
===================================================================
--- trunk/src/apps/shell_window.cc (revision 215781)
+++ trunk/src/apps/shell_window.cc (working copy)
@@ -280,15 +280,9 @@
}
void ShellWindow::OnNativeClose() {
- if (extension_) {
- // If |extension_| is NULL here, it is because the extension has been
- // unloaded. In this case, the window will have already been removed from
- // the ShellWindowRegistry, and the app can not be informed of the window
- // closing as it has gone.
- extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
- if (shell_window_contents_)
- shell_window_contents_->NativeWindowClosed();
- }
+ extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
+ if (shell_window_contents_)
+ shell_window_contents_->NativeWindowClosed();
delete this;
}
@@ -453,7 +447,7 @@
}
void ShellWindow::CloseContents(WebContents* contents) {
- Close();
+ native_app_window_->Close();
}
bool ShellWindow::ShouldSuppressDialogs() {
@@ -532,16 +526,12 @@
const extensions::Extension* unloaded_extension =
content::Details<extensions::UnloadedExtensionInfo>(
details)->extension;
- if (extension_ == unloaded_extension) {
- Close();
- // After this notification finishes processing, the Extension will be
- // deleted, so we null out our reference to avoid bad access.
- extension_ = NULL;
- }
+ if (extension_ == unloaded_extension)
+ native_app_window_->Close();
break;
}
case chrome::NOTIFICATION_APP_TERMINATING:
- Close();
+ native_app_window_->Close();
break;
default:
NOTREACHED() << "Received unexpected notification";
@@ -567,11 +557,6 @@
return native_app_window_.get();
}
-void ShellWindow::Close() {
- extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
- native_app_window_->Close();
-}
-
void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level,
const std::string& message) {
content::RenderViewHost* rvh = web_contents()->GetRenderViewHost();
« no previous file with comments | « trunk/src/apps/shell_window.h ('k') | trunk/src/chrome/browser/extensions/platform_app_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698