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. | 134 // we need a helper function. Deliberately not const & so that we will |
135 void AddMetricOnBackgroundThread(MetricType type, const std::string& value); | 135 // construct a new metric on the background thread. |
| 136 void AddMetricOnBackgroundThread(Metric metric); |
136 | 137 |
137 // Notify any listeners that PerformanceMonitor has finished the initializing. | 138 // Notify any listeners that PerformanceMonitor has finished the initializing. |
138 void NotifyInitialized(); | 139 void NotifyInitialized(); |
139 | 140 |
140 // Perform any collections that are done on a timed basis. | 141 // Perform any collections that are done on a timed basis. |
141 void DoTimedCollections(); | 142 void DoTimedCollections(); |
142 | 143 |
143 // Update the database record of the last time the active profiles were | 144 // Update the database record of the last time the active profiles were |
144 // running; this is used in determining when an unclean exit occurred. | 145 // running; this is used in determining when an unclean exit occurred. |
145 void UpdateLiveProfiles(); | 146 void UpdateLiveProfiles(); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // the PERFORMANCE_MONITOR_INITIALIZED notification or should check this | 202 // the PERFORMANCE_MONITOR_INITIALIZED notification or should check this |
202 // flag. | 203 // flag. |
203 static bool initialized_; | 204 static bool initialized_; |
204 | 205 |
205 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); | 206 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); |
206 }; | 207 }; |
207 | 208 |
208 } // namespace performance_monitor | 209 } // namespace performance_monitor |
209 | 210 |
210 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 211 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
OLD | NEW |