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

Unified Diff: chrome/browser/performance_monitor/database.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/performance_monitor/database.h
diff --git a/chrome/browser/performance_monitor/database.h b/chrome/browser/performance_monitor/database.h
index 8cec7fcf53fd305de4e6fcda0f448714cd628943..ce41cb688898d542090d6cdda7850a82ec688569 100644
--- a/chrome/browser/performance_monitor/database.h
+++ b/chrome/browser/performance_monitor/database.h
@@ -31,6 +31,7 @@ struct TimeRange {
};
class KeyBuilder;
+class DatabaseTestHelper;
// The class supporting all performance monitor storage. This class wraps
// multiple leveldb::DB objects. All methods must be called from a background
@@ -152,12 +153,10 @@ class Database {
}
// Add a metric instance to the database.
- bool AddMetric(const std::string& activity,
- MetricType metric_type,
- const std::string& value);
+ bool AddMetric(const std::string& activity, const Metric& metric);
- bool AddMetric(MetricType metric_type, const std::string& value) {
- return AddMetric(kProcessChromeAggregate, metric_type, value);
+ bool AddMetric(const Metric& metric) {
+ return AddMetric(kProcessChromeAggregate, metric);
}
// Get the metrics that are active for the given process between |start|
@@ -236,8 +235,7 @@ class Database {
}
private:
- FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorDatabaseSetupTest, OpenClose);
- FRIEND_TEST_ALL_PREFIXES(PerformanceMonitorDatabaseSetupTest, ActiveInterval);
+ friend class DatabaseTestHelper;
typedef std::map<std::string, std::string> RecentMap;
typedef std::map<std::string, double> MaxValueMap;
« no previous file with comments | « no previous file | chrome/browser/performance_monitor/database.cc » ('j') | chrome/browser/performance_monitor/database.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698