| OLD | NEW |
| 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 Loading... |
| 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 | 37 // Invoked in two ways: |
| 38 // BrowserProcess and the various threads go away. | 38 // . When the last browser has been deleted and the message loop has finished |
| 39 // | 39 // running. |
| 40 // Returns true if the session should be restarted. | 40 // . When ChromeFrame::EndSession is invoked and we need to do cleanup. |
| 41 bool ShutdownPreThreadsStop(); | 41 // NOTE: in this case the message loop is still running, but will die soon |
| 42 | 42 // after this returns. |
| 43 // Performs the remaining shutdown tasks after all threads but the | 43 void Shutdown(); |
| 44 // main thread have been stopped. This includes deleting g_browser_process. | |
| 45 // | |
| 46 // The provided parameter indicates whether a preference to restart | |
| 47 // the session was present. | |
| 48 void ShutdownPostThreadsStop(bool restart_last_session); | |
| 49 | 44 |
| 50 // Called at startup to create a histogram from our previous shutdown time. | 45 // Called at startup to create a histogram from our previous shutdown time. |
| 51 void ReadLastShutdownInfo(); | 46 void ReadLastShutdownInfo(); |
| 52 | 47 |
| 53 // There are various situations where the browser process should continue to | 48 // There are various situations where the browser process should continue to |
| 54 // run after the last browser window has closed - the Mac always continues | 49 // run after the last browser window has closed - the Mac always continues |
| 55 // running until the user explicitly quits, and on Windows/Linux the application | 50 // running until the user explicitly quits, and on Windows/Linux the application |
| 56 // should not shutdown when the last browser window closes if there are any | 51 // should not shutdown when the last browser window closes if there are any |
| 57 // BackgroundContents running. | 52 // BackgroundContents running. |
| 58 // When the user explicitly chooses to shutdown the app (via the "Exit" or | 53 // When the user explicitly chooses to shutdown the app (via the "Exit" or |
| (...skipping 17 matching lines...) Expand all Loading... |
| 76 // explicitly close the browser windows, which can lead to conditions which | 71 // explicitly close the browser windows, which can lead to conditions which |
| 77 // would fail checks. | 72 // would fail checks. |
| 78 bool ShuttingDownWithoutClosingBrowsers(); | 73 bool ShuttingDownWithoutClosingBrowsers(); |
| 79 | 74 |
| 80 // Sets the ShuttingDownWithoutClosingBrowsers flag. | 75 // Sets the ShuttingDownWithoutClosingBrowsers flag. |
| 81 void SetShuttingDownWithoutClosingBrowsers(bool without_close); | 76 void SetShuttingDownWithoutClosingBrowsers(bool without_close); |
| 82 | 77 |
| 83 } // namespace browser_shutdown | 78 } // namespace browser_shutdown |
| 84 | 79 |
| 85 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__ | 80 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H__ |
| OLD | NEW |