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

Unified Diff: content/browser/power_profiler/power_profiler_service.cc

Issue 332943005: [Chromium] [PowerProfiler] Support accuracy level attribute for power data provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing! Created 6 years, 6 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: content/browser/power_profiler/power_profiler_service.cc
diff --git a/content/browser/power_profiler/power_profiler_service.cc b/content/browser/power_profiler/power_profiler_service.cc
index 026b42ab893fbfb2b7fbabdf49ff11ae5c4b18b2..84ddb1bd15abbb6a4239902d366432efe2dd31f5 100644
--- a/content/browser/power_profiler/power_profiler_service.cc
+++ b/content/browser/power_profiler/power_profiler_service.cc
@@ -42,10 +42,23 @@ PowerProfilerService::PowerProfilerService(
PowerProfilerService::~PowerProfilerService() {
}
-bool PowerProfilerService::IsAvailable() {
+bool PowerProfilerService::IsAvailable() const {
return status_ != UNINITIALIZED;
}
+std::string PowerProfilerService::GetAccuracyLevel() const {
+ DCHECK(IsAvailable());
+ switch (data_provider_->GetAccuracyLevel()) {
+ case PowerDataProvider::High:
+ return "High";
+ case PowerDataProvider::Moderate:
+ return "Moderate";
+ case PowerDataProvider::Low:
+ return "Low";
+ }
+ return "";
+}
+
PowerProfilerService* PowerProfilerService::GetInstance() {
return Singleton<PowerProfilerService>::get();
}

Powered by Google App Engine
This is Rietveld 408576698