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

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

Issue 321093002: Fix ExtensionPopup close issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
index 94d0dca5f38b18171b6e6272a14f0257a599f7dd..bddbc41dd227af8d5cd8c61b9fb14b2b402fd474 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
@@ -214,17 +214,20 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
modalDialogManager->IsDialogActive()) {
return;
}
+ // We must shutdown host_ immediately, and it will notify RendererProcess
+ // right away. We can't wait to do it in
+ // -[ExtensionPopController windowWillClose:...]
+ if (host_->view())
+ host_->view()->set_container(NULL);
+ host_.reset();
}
[super close];
}
-- (void)windowWillClose:(NSNotification *)notification {
+- (void)windowWillClose:(NSNotification*)notification {
[super windowWillClose:notification];
if (gPopup == self)
gPopup = nil;
- if (host_->view())
- host_->view()->set_container(NULL);
- host_.reset();
}
- (void)windowDidResignKey:(NSNotification*)notification {
@@ -280,6 +283,11 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
if (!host)
return nil;
+ // Since we only close without releasing(see bug:351278), we need to shutdown
+ // host_ in -[ExtensionPopupController close] immediately. If not, host_ might
+ // not be released even when new ExtensionPopupController is ready. And
+ // this causes bug:376511.
+ // See above -[ExtensionPopupController close].
[gPopup close];
Xuefei Ren 2014/06/10 05:24:32 See bug:361278, and patch is 64ced6a2af4cb2b46756b
// Takes ownership of |host|. Also will autorelease itself when the popup is
@@ -384,13 +392,13 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
- (void)windowDidResize:(NSNotification*)notification {
// Let the extension view know, so that it can tell plugins.
- if (host_->view())
+ if (host_ && host_->view())
host_->view()->WindowFrameChanged();
}
- (void)windowDidMove:(NSNotification*)notification {
// Let the extension view know, so that it can tell plugins.
- if (host_->view())
+ if (host_ && host_->view())
host_->view()->WindowFrameChanged();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698