| Index: chrome/browser/performance_monitor/performance_monitor.h
|
| diff --git a/chrome/browser/performance_monitor/performance_monitor.h b/chrome/browser/performance_monitor/performance_monitor.h
|
| index e4fa0a5d4354959e0d1d0bec5bf2c4ffbb07faf5..2a7881cbdcd3fc38dc65d0a14fbf7d4a632932b2 100644
|
| --- a/chrome/browser/performance_monitor/performance_monitor.h
|
| +++ b/chrome/browser/performance_monitor/performance_monitor.h
|
| @@ -5,10 +5,13 @@
|
| #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_
|
| #define CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_
|
|
|
| +#include <string>
|
| +
|
| #include "base/callback.h"
|
| #include "base/file_path.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/memory/singleton.h"
|
| +#include "base/timer.h"
|
| #include "chrome/browser/performance_monitor/database.h"
|
| #include "chrome/browser/performance_monitor/event.h"
|
| #include "content/public/browser/notification_details.h"
|
| @@ -51,6 +54,10 @@ class PerformanceMonitor : public content::NotificationObserver {
|
| private:
|
| friend struct DefaultSingletonTraits<PerformanceMonitor>;
|
| FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorBrowserTest, NewVersionEvent);
|
| + FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorUncleanExitBrowserTest,
|
| + OneProfileUncleanExit);
|
| + FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorUncleanExitBrowserTest,
|
| + TwoProfileUncleanExit);
|
|
|
| PerformanceMonitor();
|
| virtual ~PerformanceMonitor();
|
| @@ -64,6 +71,15 @@ class PerformanceMonitor : public content::NotificationObserver {
|
| // Register for the appropriate notifications as a NotificationObserver.
|
| void RegisterForNotifications();
|
|
|
| + // Checks for whether the previous profiles closed uncleanly; this method
|
| + // should only be called once per run in order to avoid duplication of events
|
| + // (exceptions made for testing purposes where we construct the environment).
|
| + void CheckForUncleanExits();
|
| +
|
| + // Find the last active time for the profile and insert the event into the
|
| + // database.
|
| + void AddUncleanExitEvent(const std::string& profile_name);
|
| +
|
| // Check the previous Chrome version from the Database and determine if
|
| // it has been updated. If it has, insert an event in the database.
|
| void CheckForVersionUpdateOnBackgroundThread();
|
| @@ -82,6 +98,15 @@ class PerformanceMonitor : public content::NotificationObserver {
|
| // Notify any listeners that PerformanceMonitor has finished the initializing.
|
| void NotifyInitialized();
|
|
|
| + // Update the database record of the last time the active profiles were
|
| + // running; this is used in determining when an unclean exit occurred.
|
| + void UpdateLiveProfiles();
|
| + void UpdateLiveProfilesHelper(
|
| + scoped_ptr<std::set<std::string> > active_profiles, std::string time);
|
| +
|
| + // Perform any collections that are done on a timed basis.
|
| + void DoTimedCollections();
|
| +
|
| // The location at which the database files are stored; if empty, the database
|
| // will default to '<user_data_dir>/performance_monitor_dbs'.
|
| FilePath database_path_;
|
| @@ -90,6 +115,8 @@ class PerformanceMonitor : public content::NotificationObserver {
|
|
|
| content::NotificationRegistrar registrar_;
|
|
|
| + base::RepeatingTimer<PerformanceMonitor> timer_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor);
|
| };
|
|
|
|
|