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

Unified Diff: chrome/browser/browser_list.h

Issue 2866034: Refactor shutdown code to allow win/linux to run after last browser closes. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Uploaded patch that resolves merge issue Created 10 years, 5 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/browser_init.cc ('k') | chrome/browser/browser_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_list.h
diff --git a/chrome/browser/browser_list.h b/chrome/browser/browser_list.h
index a6113a7542ec13dff97f89889200cbc9aca62f8b..9c477c06f7a5ed1e7da84f39a8cfb3485441f3e7 100644
--- a/chrome/browser/browser_list.h
+++ b/chrome/browser/browser_list.h
@@ -113,8 +113,19 @@ class BrowserList {
// Returns true if there is at least one Browser with the specified profile.
static bool HasBrowserWithProfile(Profile* profile);
- // Returns true if browser is in persistent mode and false otherwise.
- static bool IsInPersistentMode();
+ // Tells the BrowserList to keep the application alive after the last Browser
+ // closes. This is implemented as a count, so callers should pair their calls
+ // to StartKeepAlive() with matching calls to EndKeepAlive() when they no
+ // longer need to keep the application running.
+ static void StartKeepAlive();
+
+ // Stops keeping the application alive after the last Browser is closed.
+ // Should match a previous call to StartKeepAlive().
+ static void EndKeepAlive();
+
+ // Returns true if application will continue running after the last Browser
+ // closes.
+ static bool WillKeepAlive();
static const_iterator begin() { return browsers_.begin(); }
static const_iterator end() { return browsers_.end(); }
@@ -144,8 +155,8 @@ class BrowserList {
// Returns true if at least one off the record session is active.
static bool IsOffTheRecordSessionActive();
- // Called when the last browser is closed.
- static void AllBrowsersClosed();
+ // Called once there are no more browsers open and the application is exiting.
+ static void AllBrowsersClosedAndAppExiting();
private:
// Helper method to remove a browser instance from a list of browsers
@@ -154,6 +165,10 @@ class BrowserList {
static BrowserVector browsers_;
static BrowserVector last_active_browsers_;
static ObserverList<Observer> observers_;
+
+ // Counter of calls to StartKeepAlive(). If non-zero, the application will
+ // continue running after the last browser has exited.
+ static int keep_alive_count_;
};
class TabContents;
« no previous file with comments | « chrome/browser/browser_init.cc ('k') | chrome/browser/browser_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698