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

Unified Diff: chrome/common/stack_sampling_configuration.cc

Issue 2375563002: Stack sampling profiler: move configuration to chrome/common (Closed)
Patch Set: initialize to std::string() Created 4 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
« no previous file with comments | « chrome/common/stack_sampling_configuration.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/stack_sampling_configuration.cc
diff --git a/chrome/browser/stack_sampling_configuration.cc b/chrome/common/stack_sampling_configuration.cc
similarity index 89%
rename from chrome/browser/stack_sampling_configuration.cc
rename to chrome/common/stack_sampling_configuration.cc
index 925b9596c37f01f1087e1894b987c03f7e44e709..437773048cab8688423dc0e25a7d2bfb99319242 100644
--- a/chrome/browser/stack_sampling_configuration.cc
+++ b/chrome/common/stack_sampling_configuration.cc
@@ -2,10 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/stack_sampling_configuration.h"
+#include "chrome/common/stack_sampling_configuration.h"
#include "base/rand_util.h"
-#include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
#include "chrome/common/channel_info.h"
#include "components/version_info/version_info.h"
@@ -76,40 +75,41 @@ bool StackSamplingConfiguration::IsProfilerEnabled() const {
configuration_ != PROFILE_CONTROL);
}
-void StackSamplingConfiguration::RegisterSyntheticFieldTrial() const {
+bool StackSamplingConfiguration::GetSyntheticFieldTrial(
+ std::string* trial_name,
+ std::string* group_name) const {
if (!IsProfilerSupported())
- return;
+ return false;
- std::string group;
+ *trial_name = "SyntheticStackProfilingConfiguration";
+ *group_name = std::string();
switch (configuration_) {
case PROFILE_DISABLED:
- group = "Disabled";
+ *group_name = "Disabled";
break;
case PROFILE_CONTROL:
- group = "Control";
+ *group_name = "Control";
break;
case PROFILE_NO_SAMPLES:
- group = "NoSamples";
+ *group_name = "NoSamples";
break;
case PROFILE_5HZ:
- group = "5Hz";
+ *group_name = "5Hz";
break;
case PROFILE_10HZ:
- group = "10Hz";
+ *group_name = "10Hz";
break;
case PROFILE_100HZ:
- group = "100Hz";
+ *group_name = "100Hz";
break;
}
- ChromeMetricsServiceAccessor::RegisterSyntheticFieldTrial(
- "SyntheticStackProfilingConfiguration",
- group);
+ return !group_name->empty();
}
// static
« no previous file with comments | « chrome/common/stack_sampling_configuration.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698