Index: chrome/browser/performance_monitor/database.cc |
diff --git a/chrome/browser/performance_monitor/database.cc b/chrome/browser/performance_monitor/database.cc |
index 8eb135080a00cedf9b51c82893712d7fc4520b0b..5844ff237728d931aae7bcf299349b2d8f152bed 100644 |
--- a/chrome/browser/performance_monitor/database.cc |
+++ b/chrome/browser/performance_monitor/database.cc |
@@ -379,6 +379,23 @@ std::vector<std::string> Database::GetActiveActivities( |
return results; |
} |
+bool Database::GetRecentStatsForActivityAndMetric( |
+ const std::string& activity, |
+ MetricType metric, |
+ MetricInfo* info) { |
+ CHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
+ std::string recent_map_key = CreateRecentMapKey(metric, activity); |
+ if (!recent_map_.count(recent_map_key)) |
Yoyo Zhou
2012/08/02 11:54:57
Use ContainsKey from stl_util.h.
|
+ return false; |
+ std::string recent_key = recent_map_[recent_map_key]; |
+ |
+ std::string result; |
+ leveldb::Status status = recent_db_->Get(read_options_, recent_key, &result); |
+ if (status.ok()) |
+ *info = MetricInfo(SplitRecentKey(recent_key).time, result); |
+ return status.ok(); |
+} |
+ |
Database::MetricInfoVector Database::GetStatsForActivityAndMetric( |
const std::string& activity, MetricType metric_type, |
const base::Time& start, const base::Time& end) { |