Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Side by Side Diff: chrome/browser/performance_monitor/performance_monitor.h

Issue 10907121: Add guards to metric values; erase bad events/metrics from db (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_use_units
Patch Set: Eriq's requests Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.
Yoyo Zhou 2012/09/10 23:52:44 I'm not sure this does what you think. You are sti
Devlin 2012/09/11 18:52:17 I was modeling this after the io_data one. In that
Yoyo Zhou 2012/09/13 00:09:20 On reviewing the documentation in callback.h, this
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698