Commit fd6e1fed authored by Fabio Tirelo's avatar Fabio Tirelo Committed by Commit Bot

Chrome Cleaner: collect srt field trial group name

Bug: 
Change-Id: Ib77d051ef0813cd63eafd92b578919f46982d26b
Reviewed-on: https://chromium-review.googlesource.com/700992Reviewed-by: default avatarChris Sharp <csharp@chromium.org>
Commit-Queue: Fabio Tirelo <ftirelo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506527}
parent 407d6db9
...@@ -131,6 +131,12 @@ ChromeCleanerRunner::ChromeCleanerRunner( ...@@ -131,6 +131,12 @@ ChromeCleanerRunner::ChromeCleanerRunner(
cleaner_command_line_.AppendSwitch( cleaner_command_line_.AppendSwitch(
chrome_cleaner::kEnableCrashReportingSwitch); chrome_cleaner::kEnableCrashReportingSwitch);
} }
const std::string group_name = GetSRTFieldTrialGroupName();
if (!group_name.empty()) {
cleaner_command_line_.AppendSwitchASCII(
chrome_cleaner::kSRTPromptFieldTrialGroupNameSwitch, group_name);
}
} }
ChromeCleanerRunner::ProcessStatus ChromeCleanerRunner::ProcessStatus
......
...@@ -955,9 +955,16 @@ class ReporterRunner : public chrome::BrowserListObserver { ...@@ -955,9 +955,16 @@ class ReporterRunner : public chrome::BrowserListObserver {
Now().ToInternalValue()); Now().ToInternalValue());
} }
if (ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) if (ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) {
next_invocation->command_line.AppendSwitch( next_invocation->command_line.AppendSwitch(
chrome_cleaner::kEnableCrashReportingSwitch); chrome_cleaner::kEnableCrashReportingSwitch);
}
const std::string group_name = GetSRTFieldTrialGroupName();
if (!group_name.empty()) {
next_invocation->command_line.AppendSwitchASCII(
chrome_cleaner::kSRTPromptFieldTrialGroupNameSwitch, group_name);
}
} }
// Adds switches to be sent to the Software Reporter when the user opted into // Adds switches to be sent to the Software Reporter when the user opted into
......
...@@ -107,6 +107,10 @@ std::string GetIncomingSRTSeed() { ...@@ -107,6 +107,10 @@ std::string GetIncomingSRTSeed() {
kSRTPromptSeedParam); kSRTPromptSeedParam);
} }
std::string GetSRTFieldTrialGroupName() {
return base::FieldTrialList::FindFullName(kSRTPromptTrial);
}
void RecordSRTPromptHistogram(SRTPromptHistogramValue value) { void RecordSRTPromptHistogram(SRTPromptHistogramValue value) {
UMA_HISTOGRAM_ENUMERATION("SoftwareReporter.PromptUsage", value, UMA_HISTOGRAM_ENUMERATION("SoftwareReporter.PromptUsage", value,
SRT_PROMPT_MAX); SRT_PROMPT_MAX);
......
...@@ -76,6 +76,9 @@ GURL GetSRTDownloadURL(); ...@@ -76,6 +76,9 @@ GURL GetSRTDownloadURL();
// Returns the value of the incoming SRT seed. // Returns the value of the incoming SRT seed.
std::string GetIncomingSRTSeed(); std::string GetIncomingSRTSeed();
// Returns the group name in the SRTPrompt field trial.
std::string GetSRTFieldTrialGroupName();
// Records a value for the SRT Prompt Histogram. // Records a value for the SRT Prompt Histogram.
void RecordSRTPromptHistogram(SRTPromptHistogramValue value); void RecordSRTPromptHistogram(SRTPromptHistogramValue value);
......
...@@ -21,6 +21,7 @@ const char kExtendedSafeBrowsingEnabledSwitch[] = ...@@ -21,6 +21,7 @@ const char kExtendedSafeBrowsingEnabledSwitch[] =
"extended-safebrowsing-enabled"; "extended-safebrowsing-enabled";
const char kRegistrySuffixSwitch[] = "registry-suffix"; const char kRegistrySuffixSwitch[] = "registry-suffix";
const char kSessionIdSwitch[] = "session-id"; const char kSessionIdSwitch[] = "session-id";
const char kSRTPromptFieldTrialGroupNameSwitch[] = "srt-field-trial-group-name";
const char kUmaUserSwitch[] = "uma-user"; const char kUmaUserSwitch[] = "uma-user";
// Registry paths and subkeys. // Registry paths and subkeys.
......
...@@ -59,6 +59,9 @@ extern const char kRegistrySuffixSwitch[]; ...@@ -59,6 +59,9 @@ extern const char kRegistrySuffixSwitch[];
/// binary, each generating a report). An ASCII, base-64 encoded random string. /// binary, each generating a report). An ASCII, base-64 encoded random string.
extern const char kSessionIdSwitch[]; extern const char kSessionIdSwitch[];
// Indicates the group name for the SRTPrompt field trial.
extern const char kSRTPromptFieldTrialGroupNameSwitch[];
// Indicates that metrics reporting is enabled for the current user. // Indicates that metrics reporting is enabled for the current user.
extern const char kUmaUserSwitch[]; extern const char kUmaUserSwitch[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment