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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 // Check the previous Chrome version from the Database and determine if | 88 // Check the previous Chrome version from the Database and determine if |
89 // it has been updated. If it has, insert an event in the database. | 89 // it has been updated. If it has, insert an event in the database. |
90 void CheckForVersionUpdateOnBackgroundThread(); | 90 void CheckForVersionUpdateOnBackgroundThread(); |
91 | 91 |
92 // Wrapper function for inserting events into the database. | 92 // Wrapper function for inserting events into the database. |
93 void AddEvent(scoped_ptr<Event> event); | 93 void AddEvent(scoped_ptr<Event> event); |
94 | 94 |
95 void AddEventOnBackgroundThread(scoped_ptr<Event> event); | 95 void AddEventOnBackgroundThread(scoped_ptr<Event> event); |
96 | 96 |
| 97 // Since Database::AddMetric() is overloaded, base::Bind() does not work and |
| 98 // we need a helper function. |
| 99 void AddMetricOnBackgroundThread(MetricType type, const std::string& value); |
| 100 |
97 // Gets the corresponding value of |key| from the database, and then runs | 101 // Gets the corresponding value of |key| from the database, and then runs |
98 // |callback| on the UI thread with that value as a parameter. | 102 // |callback| on the UI thread with that value as a parameter. |
99 void GetStateValueOnBackgroundThread( | 103 void GetStateValueOnBackgroundThread( |
100 const std::string& key, | 104 const std::string& key, |
101 const StateValueCallback& callback); | 105 const StateValueCallback& callback); |
102 | 106 |
103 // Notify any listeners that PerformanceMonitor has finished the initializing. | 107 // Notify any listeners that PerformanceMonitor has finished the initializing. |
104 void NotifyInitialized(); | 108 void NotifyInitialized(); |
105 | 109 |
106 // Update the database record of the last time the active profiles were | 110 // Update the database record of the last time the active profiles were |
(...skipping 25 matching lines...) Expand all Loading... |
132 base::RepeatingTimer<PerformanceMonitor> timer_; | 136 base::RepeatingTimer<PerformanceMonitor> timer_; |
133 | 137 |
134 content::NotificationRegistrar registrar_; | 138 content::NotificationRegistrar registrar_; |
135 | 139 |
136 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); | 140 DISALLOW_COPY_AND_ASSIGN(PerformanceMonitor); |
137 }; | 141 }; |
138 | 142 |
139 } // namespace performance_monitor | 143 } // namespace performance_monitor |
140 | 144 |
141 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ | 145 #endif // CHROME_BROWSER_PERFORMANCE_MONITOR_PERFORMANCE_MONITOR_H_ |
OLD | NEW |