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

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: With this patchset, Chrome runs and exits normally on Linux. 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 // Performs the remaining shutdown tasks after all threads but the
44 // main thread have been stopped. This includes deleting g_browser_process.
45 //
37 // Invoked in two ways: 46 // Invoked in two ways:
38 // . When the last browser has been deleted and the message loop has finished 47 // . When the last browser has been deleted and the message loop has finished
39 // running. 48 // running.
40 // . When ChromeFrame::EndSession is invoked and we need to do cleanup. 49 // . When ChromeFrame::EndSession is invoked and we need to do cleanup.
robertshield 2011/11/14 04:15:55 This second bullet in this old comment looks out o
41 // NOTE: in this case the message loop is still running, but will die soon 50 // NOTE: in this case the message loop is still running, but will die soon
42 // after this returns. 51 // after this returns.
43 void Shutdown(); 52 //
53 // The provided parameter indicates whether a preference to restart
54 // the session was present.
55 void ShutdownPostThreadsStop(bool restart_last_session);
44 56
45 // Called at startup to create a histogram from our previous shutdown time. 57 // Called at startup to create a histogram from our previous shutdown time.
46 void ReadLastShutdownInfo(); 58 void ReadLastShutdownInfo();
47 59
48 // There are various situations where the browser process should continue to 60 // There are various situations where the browser process should continue to
49 // run after the last browser window has closed - the Mac always continues 61 // 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 62 // 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 63 // should not shutdown when the last browser window closes if there are any
52 // BackgroundContents running. 64 // BackgroundContents running.
53 // When the user explicitly chooses to shutdown the app (via the "Exit" or 65 // 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 83 // explicitly close the browser windows, which can lead to conditions which
72 // would fail checks. 84 // would fail checks.
73 bool ShuttingDownWithoutClosingBrowsers(); 85 bool ShuttingDownWithoutClosingBrowsers();
74 86
75 // Sets the ShuttingDownWithoutClosingBrowsers flag. 87 // Sets the ShuttingDownWithoutClosingBrowsers flag.
76 void SetShuttingDownWithoutClosingBrowsers(bool without_close); 88 void SetShuttingDownWithoutClosingBrowsers(bool without_close);
77 89
78 } // namespace browser_shutdown 90 } // namespace browser_shutdown
79 91
80 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__ 92 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698