OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 class PrefRegistrySimple; | 10 class PrefRegistrySimple; |
(...skipping 18 matching lines...) Expand all Loading... |
29 // an uninitialized value | 29 // an uninitialized value |
30 NOT_VALID = 0, | 30 NOT_VALID = 0, |
31 // the last browser window was closed | 31 // the last browser window was closed |
32 WINDOW_CLOSE, | 32 WINDOW_CLOSE, |
33 // user clicked on the Exit menu item | 33 // user clicked on the Exit menu item |
34 BROWSER_EXIT, | 34 BROWSER_EXIT, |
35 // windows is logging off or shutting down | 35 // windows is logging off or shutting down |
36 END_SESSION | 36 END_SESSION |
37 }; | 37 }; |
38 | 38 |
| 39 constexpr int kNumShutdownTypes = END_SESSION + 1; |
| 40 |
39 void RegisterPrefs(PrefRegistrySimple* registry); | 41 void RegisterPrefs(PrefRegistrySimple* registry); |
40 | 42 |
41 // Called when the browser starts shutting down so that we can measure shutdown | 43 // Called when the browser starts shutting down so that we can measure shutdown |
42 // time. | 44 // time. |
43 void OnShutdownStarting(ShutdownType type); | 45 void OnShutdownStarting(ShutdownType type); |
44 | 46 |
45 // Get the current shutdown type. | 47 // Get the current shutdown type. |
46 ShutdownType GetShutdownType(); | 48 ShutdownType GetShutdownType(); |
47 | 49 |
48 #if !defined(OS_ANDROID) | 50 #if !defined(OS_ANDROID) |
49 // Performs the shutdown tasks that need to be done before | 51 // Performs the shutdown tasks that need to be done before |
50 // BrowserProcess and the various threads go away. | 52 // BrowserProcess and the various threads go away. |
51 // | 53 // |
52 // Returns true if the session should be restarted. | 54 // Returns true if the session should be restarted. |
53 bool ShutdownPreThreadsStop(); | 55 bool ShutdownPreThreadsStop(); |
54 | 56 |
| 57 // Records the shutdown related prefs. |
| 58 void RecordShutdownInfoPrefs(); |
| 59 |
55 // Performs the remaining shutdown tasks after all threads but the | 60 // Performs the remaining shutdown tasks after all threads but the |
56 // main thread have been stopped. This includes deleting g_browser_process. | 61 // main thread have been stopped. This includes deleting g_browser_process. |
57 // | 62 // |
58 // See |browser_shutdown::Flags| for the possible flag values and their effects. | 63 // See |browser_shutdown::Flags| for the possible flag values and their effects. |
59 void ShutdownPostThreadsStop(int shutdown_flags); | 64 void ShutdownPostThreadsStop(int shutdown_flags); |
60 #endif | 65 #endif |
61 | 66 |
62 // Called at startup to create a histogram from our previous shutdown time. | 67 // Called at startup to create a histogram from our previous shutdown time. |
63 void ReadLastShutdownInfo(); | 68 void ReadLastShutdownInfo(); |
64 | 69 |
(...skipping 19 matching lines...) Expand all Loading... |
84 bool IsTryingToQuit(); | 89 bool IsTryingToQuit(); |
85 | 90 |
86 // Starts to collect shutdown traces. On ChromeOS this will start immediately | 91 // Starts to collect shutdown traces. On ChromeOS this will start immediately |
87 // on AttemptUserExit() and all other systems will start once all tabs are | 92 // on AttemptUserExit() and all other systems will start once all tabs are |
88 // closed. | 93 // closed. |
89 void StartShutdownTracing(); | 94 void StartShutdownTracing(); |
90 | 95 |
91 } // namespace browser_shutdown | 96 } // namespace browser_shutdown |
92 | 97 |
93 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H_ | 98 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H_ |
OLD | NEW |