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

Side by Side Diff: chrome/browser/browser_shutdown.h

Issue 8477004: Have content/ create and destroy its own threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Temporary - look at browser_list, browser_main_loop, content/p/b/browser_shutdown Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_BROWSER_SHUTDOWN_H__ 5 #ifndef CHROME_BROWSER_BROWSER_SHUTDOWN_H__
6 #define CHROME_BROWSER_BROWSER_SHUTDOWN_H__ 6 #define CHROME_BROWSER_BROWSER_SHUTDOWN_H__
7 #pragma once 7 #pragma once
8 8
9 class PrefService; 9 class PrefService;
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 void RegisterPrefs(PrefService* local_state); 28 void RegisterPrefs(PrefService* local_state);
29 29
30 // Called when the browser starts shutting down so that we can measure shutdown 30 // Called when the browser starts shutting down so that we can measure shutdown
31 // time. 31 // time.
32 void OnShutdownStarting(ShutdownType type); 32 void OnShutdownStarting(ShutdownType type);
33 33
34 // Get the current shutdown type. 34 // Get the current shutdown type.
35 ShutdownType GetShutdownType(); 35 ShutdownType GetShutdownType();
36 36
37 // Performs the shutdown tasks that need to be done before
38 // BrowserProcess and the various threads go away.
39 //
40 // Returns true if the session should be restarted.
41 bool ShutdownPreThreadsStop();
42
43 // TODO(joi): DO NOT COMMIT update these comments (EndSession etc.)
44 // Performs the remaining shutdown tasks after all threads but the
45 // main thread have been stopped. This includes deleting g_browser_process.
46 //
37 // Invoked in two ways: 47 // Invoked in two ways:
38 // . When the last browser has been deleted and the message loop has finished 48 // . When the last browser has been deleted and the message loop has finished
39 // running. 49 // running.
40 // . When ChromeFrame::EndSession is invoked and we need to do cleanup. 50 // . When ChromeFrame::EndSession is invoked and we need to do cleanup.
41 // NOTE: in this case the message loop is still running, but will die soon 51 // NOTE: in this case the message loop is still running, but will die soon
42 // after this returns. 52 // after this returns.
43 void Shutdown(); 53 //
54 // The provided parameter indicates whether a preference to restart
55 // the session was present.
56 void ShutdownPostThreadsStop(bool restart_last_session);
44 57
45 // Called at startup to create a histogram from our previous shutdown time. 58 // Called at startup to create a histogram from our previous shutdown time.
46 void ReadLastShutdownInfo(); 59 void ReadLastShutdownInfo();
47 60
48 // There are various situations where the browser process should continue to 61 // There are various situations where the browser process should continue to
49 // run after the last browser window has closed - the Mac always continues 62 // run after the last browser window has closed - the Mac always continues
50 // running until the user explicitly quits, and on Windows/Linux the application 63 // running until the user explicitly quits, and on Windows/Linux the application
51 // should not shutdown when the last browser window closes if there are any 64 // should not shutdown when the last browser window closes if there are any
52 // BackgroundContents running. 65 // BackgroundContents running.
53 // When the user explicitly chooses to shutdown the app (via the "Exit" or 66 // When the user explicitly chooses to shutdown the app (via the "Exit" or
(...skipping 17 matching lines...) Expand all
71 // explicitly close the browser windows, which can lead to conditions which 84 // explicitly close the browser windows, which can lead to conditions which
72 // would fail checks. 85 // would fail checks.
73 bool ShuttingDownWithoutClosingBrowsers(); 86 bool ShuttingDownWithoutClosingBrowsers();
74 87
75 // Sets the ShuttingDownWithoutClosingBrowsers flag. 88 // Sets the ShuttingDownWithoutClosingBrowsers flag.
76 void SetShuttingDownWithoutClosingBrowsers(bool without_close); 89 void SetShuttingDownWithoutClosingBrowsers(bool without_close);
77 90
78 } // namespace browser_shutdown 91 } // namespace browser_shutdown
79 92
80 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__ 93 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698