| 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_CHROMEOS_BOOT_TIMES_LOADER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_BOOT_TIMES_LOADER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_BOOT_TIMES_LOADER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_BOOT_TIMES_LOADER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 class BootTimesLoader : public content::NotificationObserver, | 35 class BootTimesLoader : public content::NotificationObserver, |
| 36 public LoginEventRecorder::Delegate { | 36 public LoginEventRecorder::Delegate { |
| 37 public: | 37 public: |
| 38 BootTimesLoader(); | 38 BootTimesLoader(); |
| 39 virtual ~BootTimesLoader(); | 39 virtual ~BootTimesLoader(); |
| 40 | 40 |
| 41 static BootTimesLoader* Get(); | 41 static BootTimesLoader* Get(); |
| 42 | 42 |
| 43 // LoginEventRecorder::Delegate override. | 43 // LoginEventRecorder::Delegate override. |
| 44 virtual void AddLoginTimeMarker(const std::string& marker_name, | 44 virtual void AddLoginTimeMarker(const std::string& marker_name, |
| 45 bool send_to_uma) OVERRIDE; | 45 bool send_to_uma) override; |
| 46 virtual void RecordAuthenticationSuccess() OVERRIDE; | 46 virtual void RecordAuthenticationSuccess() override; |
| 47 virtual void RecordAuthenticationFailure() OVERRIDE; | 47 virtual void RecordAuthenticationFailure() override; |
| 48 | 48 |
| 49 // Add a time marker for logout. A timeline will be dumped to | 49 // Add a time marker for logout. A timeline will be dumped to |
| 50 // /tmp/logout-times-sent after logout is done. If |send_to_uma| is true | 50 // /tmp/logout-times-sent after logout is done. If |send_to_uma| is true |
| 51 // the time between this marker and the last will be sent to UMA with | 51 // the time between this marker and the last will be sent to UMA with |
| 52 // the identifier ShutdownTime.|marker_name|. | 52 // the identifier ShutdownTime.|marker_name|. |
| 53 void AddLogoutTimeMarker(const std::string& marker_name, bool send_to_uma); | 53 void AddLogoutTimeMarker(const std::string& marker_name, bool send_to_uma); |
| 54 | 54 |
| 55 // Records current uptime and disk usage for metrics use. | 55 // Records current uptime and disk usage for metrics use. |
| 56 // Posts task to file thread. | 56 // Posts task to file thread. |
| 57 // name will be used as part of file names in /tmp. | 57 // name will be used as part of file names in /tmp. |
| 58 // Existing stats files will not be overwritten. | 58 // Existing stats files will not be overwritten. |
| 59 void RecordCurrentStats(const std::string& name); | 59 void RecordCurrentStats(const std::string& name); |
| 60 | 60 |
| 61 // Saves away the stats at main, so the can be recorded later. At main() time | 61 // Saves away the stats at main, so the can be recorded later. At main() time |
| 62 // the necessary threads don't exist yet for recording the data. | 62 // the necessary threads don't exist yet for recording the data. |
| 63 void SaveChromeMainStats(); | 63 void SaveChromeMainStats(); |
| 64 | 64 |
| 65 // Records the data previously saved by SaveChromeMainStats(), using the | 65 // Records the data previously saved by SaveChromeMainStats(), using the |
| 66 // file thread. Existing stats files will not be overwritten. | 66 // file thread. Existing stats files will not be overwritten. |
| 67 void RecordChromeMainStats(); | 67 void RecordChromeMainStats(); |
| 68 | 68 |
| 69 // Records the time that a login was attempted. This will overwrite any | 69 // Records the time that a login was attempted. This will overwrite any |
| 70 // previous login attempt times. | 70 // previous login attempt times. |
| 71 void RecordLoginAttempted(); | 71 void RecordLoginAttempted(); |
| 72 | 72 |
| 73 // content::NotificationObserver implementation. | 73 // content::NotificationObserver implementation. |
| 74 virtual void Observe(int type, | 74 virtual void Observe(int type, |
| 75 const content::NotificationSource& source, | 75 const content::NotificationSource& source, |
| 76 const content::NotificationDetails& details) OVERRIDE; | 76 const content::NotificationDetails& details) override; |
| 77 | 77 |
| 78 // Records "LoginDone" event. | 78 // Records "LoginDone" event. |
| 79 void LoginDone(bool is_user_new); | 79 void LoginDone(bool is_user_new); |
| 80 | 80 |
| 81 // Writes the logout times to a /tmp/logout-times-sent. Unlike login | 81 // Writes the logout times to a /tmp/logout-times-sent. Unlike login |
| 82 // times, we manually call this function for logout times, as we cannot | 82 // times, we manually call this function for logout times, as we cannot |
| 83 // rely on notification service to tell when the logout is done. | 83 // rely on notification service to tell when the logout is done. |
| 84 void WriteLogoutTimes(); | 84 void WriteLogoutTimes(); |
| 85 | 85 |
| 86 // Mark that WriteLogoutTimes should handle restart. | 86 // Mark that WriteLogoutTimes should handle restart. |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 bool login_done_; | 185 bool login_done_; |
| 186 | 186 |
| 187 bool restart_requested_; | 187 bool restart_requested_; |
| 188 | 188 |
| 189 DISALLOW_COPY_AND_ASSIGN(BootTimesLoader); | 189 DISALLOW_COPY_AND_ASSIGN(BootTimesLoader); |
| 190 }; | 190 }; |
| 191 | 191 |
| 192 } // namespace chromeos | 192 } // namespace chromeos |
| 193 | 193 |
| 194 #endif // CHROME_BROWSER_CHROMEOS_BOOT_TIMES_LOADER_H_ | 194 #endif // CHROME_BROWSER_CHROMEOS_BOOT_TIMES_LOADER_H_ |
| OLD | NEW |