| 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_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
| 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 6 #define CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // Check the previous Chrome version from the Database and determine if | 124 // Check the previous Chrome version from the Database and determine if |
| 125 // it has been updated. If it has, insert an event in the database. | 125 // it has been updated. If it has, insert an event in the database. |
| 126 void CheckForVersionUpdateOnBackgroundThread(); | 126 void CheckForVersionUpdateOnBackgroundThread(); |
| 127 | 127 |
| 128 // Wrapper function for inserting events into the database. | 128 // Wrapper function for inserting events into the database. |
| 129 void AddEvent(scoped_ptr<Event> event); | 129 void AddEvent(scoped_ptr<Event> event); |
| 130 | 130 |
| 131 void AddEventOnBackgroundThread(scoped_ptr<Event> event); | 131 void AddEventOnBackgroundThread(scoped_ptr<Event> event); |
| 132 | 132 |
| 133 // Since Database::AddMetric() is overloaded, base::Bind() does not work and | 133 // Since Database::AddMetric() is overloaded, base::Bind() does not work and |
| 134 // we need a helper function. Deliberately not const & so that we will | 134 // we need a helper function. |
| 135 // construct a new metric on the background thread. | 135 void AddMetricOnBackgroundThread(MetricType type, const std::string& value); |
| 136 void AddMetricOnBackgroundThread(Metric metric); | |
| 137 | 136 |
| 138 // Notify any listeners that PerformanceMonitor has finished the initializing. | 137 // Notify any listeners that PerformanceMonitor has finished the initializing. |
| 139 void NotifyInitialized(); | 138 void NotifyInitialized(); |
| 140 | 139 |
| 141 // Perform any collections that are done on a timed basis. | 140 // Perform any collections that are done on a timed basis. |
| 142 void DoTimedCollections(); | 141 void DoTimedCollections(); |
| 143 | 142 |
| 144 // Update the database record of the last time the active profiles were | 143 // Update the database record of the last time the active profiles were |
| 145 // running; this is used in determining when an unclean exit occurred. | 144 // running; this is used in determining when an unclean exit occurred. |
| 146 void UpdateLiveProfiles(); | 145 void UpdateLiveProfiles(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // the PERFORMANCE_MONITOR_INITIALIZED notification or should check this | 201 // the PERFORMANCE_MONITOR_INITIALIZED notification or should check this |
| 203 // flag. | 202 // flag. |
| 204 static bool initialized_; | 203 static bool initialized_; |
| 205 | 204 |
| 206 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); | 205 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); |
| 207 }; | 206 }; |
| 208 | 207 |
| 209 } // namespace performance_monitor | 208 } // namespace performance_monitor |
| 210 | 209 |
| 211 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 210 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
| OLD | NEW |