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

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

Issue 2318373003: Record shutdown type UMA (Closed)
Patch Set: Clear kRestartLastSessionOnShutdown Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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, and returns true when we should restart
sky 2016/09/13 13:21:14 How about: Returns true if the browser should be r
hashimoto 2016/09/13 22:18:22 Done.
58 // the last session.
59 bool RecordShutdownInfoPrefs();
60
55 // Performs the remaining shutdown tasks after all threads but the 61 // Performs the remaining shutdown tasks after all threads but the
56 // main thread have been stopped. This includes deleting g_browser_process. 62 // main thread have been stopped. This includes deleting g_browser_process.
57 // 63 //
58 // See |browser_shutdown::Flags| for the possible flag values and their effects. 64 // See |browser_shutdown::Flags| for the possible flag values and their effects.
59 void ShutdownPostThreadsStop(int shutdown_flags); 65 void ShutdownPostThreadsStop(int shutdown_flags);
60 #endif 66 #endif
61 67
62 // Called at startup to create a histogram from our previous shutdown time. 68 // Called at startup to create a histogram from our previous shutdown time.
63 void ReadLastShutdownInfo(); 69 void ReadLastShutdownInfo();
64 70
(...skipping 19 matching lines...) Expand all
84 bool IsTryingToQuit(); 90 bool IsTryingToQuit();
85 91
86 // Starts to collect shutdown traces. On ChromeOS this will start immediately 92 // Starts to collect shutdown traces. On ChromeOS this will start immediately
87 // on AttemptUserExit() and all other systems will start once all tabs are 93 // on AttemptUserExit() and all other systems will start once all tabs are
88 // closed. 94 // closed.
89 void StartShutdownTracing(); 95 void StartShutdownTracing();
90 96
91 } // namespace browser_shutdown 97 } // namespace browser_shutdown
92 98
93 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H_ 99 #endif // CHROME_BROWSER_BROWSER_SHUTDOWN_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698