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

Unified Diff: chrome/browser/ui/unload_controller.h

Issue 11016023: Quickly close tabs/window with long-running unload handlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add tests. Drop test's use of non-public API. Created 8 years, 2 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 | chrome/browser/ui/unload_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/unload_controller.h
diff --git a/chrome/browser/ui/unload_controller.h b/chrome/browser/ui/unload_controller.h
index fb51668b0554bd67d563d351b8c5db5ee7081f75..4f7183d49cdc920d26753a8b86d745af0485fdb3 100644
--- a/chrome/browser/ui/unload_controller.h
+++ b/chrome/browser/ui/unload_controller.h
@@ -23,6 +23,7 @@ class WebContents;
}
namespace chrome {
+class UnloadDetachedHandler;
class UnloadController : public content::NotificationObserver,
Ben Goodger (Google) 2012/10/26 19:35:14 It would be good if you could codify your knowledg
slamm 2012/10/26 23:16:32 Done.
public TabStripModelObserver {
@@ -62,6 +63,9 @@ class UnloadController : public content::NotificationObserver,
// could be pursued.
bool TabsNeedBeforeUnloadFired();
+ // Called when detached tabs (if any) finish closing.
+ void DetachedTabsClosedCallback();
+
private:
typedef std::set<content::WebContents*> UnloadListenerSet;
@@ -114,11 +118,11 @@ class UnloadController : public content::NotificationObserver,
content::NotificationRegistrar registrar_;
- // Tracks tabs that need there beforeunload event fired before we can
+ // Tracks tabs that need their beforeunload event fired before we can
// close the browser. Only gets populated when we try to close the browser.
UnloadListenerSet tabs_needing_before_unload_fired_;
- // Tracks tabs that need there unload event fired before we can
+ // Tracks tabs that need their unload event fired before we can
// close the browser. Only gets populated when we try to close the browser.
UnloadListenerSet tabs_needing_unload_fired_;
@@ -128,6 +132,9 @@ class UnloadController : public content::NotificationObserver,
// Browser window isn't just immediately closed.
bool is_attempting_to_close_browser_;
+ // Allow unload handlers to run without holding up the UI.
+ UnloadDetachedHandler* const unload_detached_handler_;
+
base::WeakPtrFactory<UnloadController> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(UnloadController);
« no previous file with comments | « no previous file | chrome/browser/ui/unload_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698