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

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

Issue 309803002: [PowerProfiler] Power Profiler service should detect the sampling rate from the data provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 bd44429bea6be0a93451d89b5dff483e258fa205..951034c3918125a81e45b7f18ab92bb12ea33596 100644
--- a/content/browser/power_profiler/power_profiler_service.cc
+++ b/content/browser/power_profiler/power_profiler_service.cc
@@ -9,26 +9,17 @@
#include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/browser_thread.h"
-namespace {
-
-// Default sampling period, as recommended by Intel Power Gadget.
-// Section 3.1 of http://software.intel.com/en-us/blogs/2013/10/03/using-the-intel-power-gadget-api-on-windows
-const int kDefaultSamplePeriodMs = 50;
-
-} // namespace
-
namespace content {
PowerProfilerService::PowerProfilerService()
: status_(UNINITIALIZED),
- sample_period_(base::TimeDelta::FromMilliseconds(kDefaultSamplePeriodMs)),
data_provider_(PowerDataProvider::Create()) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// No provider supported for current platform.
if (!data_provider_.get())
return;
-
+ sample_period_ = data_provider_->GetSamplingRate();
status_ = INITIALIZED;
task_runner_ = BrowserThread::GetBlockingPool()->GetSequencedTaskRunner(
BrowserThread::GetBlockingPool()->GetSequenceToken());

Powered by Google App Engine
This is Rietveld 408576698