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

Unified Diff: chrome/browser/metrics/variations/chrome_variations_service_client.cc

Issue 2919963002: Clean Read/SetExperimentLabels to remove check for Chrome build. (Closed)
Patch Set: Deleting windows specific code in chrome build to clean experiment labels Created 3 years, 7 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: chrome/browser/metrics/variations/chrome_variations_service_client.cc
diff --git a/chrome/browser/metrics/variations/chrome_variations_service_client.cc b/chrome/browser/metrics/variations/chrome_variations_service_client.cc
index e4bfb1e89c3aedc9b374a40c625959247eec29a5..bbddc722b329607d67fb2f173f994f757c64bb79 100644
--- a/chrome/browser/metrics/variations/chrome_variations_service_client.cc
+++ b/chrome/browser/metrics/variations/chrome_variations_service_client.cc
@@ -46,46 +46,6 @@ base::Version GetVersionForSimulation() {
return base::Version(version_info::GetVersionNumber());
}
-#if defined(OS_WIN)
-// Clear all Variations experiment labels from Google Update Registry Labels.
-// TODO(jwd): Remove this once we're confident most clients no longer have these
-// labels (M57-M58 timeframe).
-void ClearGoogleUpdateRegistryLabels() {
- base::ThreadRestrictions::AssertIOAllowed();
-
- // Note that all registry operations are done here on the UI thread as there
- // are no threading restrictions on them.
- const bool is_system_install = !InstallUtil::IsPerUserInstall();
-
- // Read the current bits from the registry.
- base::string16 registry_labels;
- bool success = GoogleUpdateSettings::ReadExperimentLabels(is_system_install,
- &registry_labels);
-
- if (!success) {
- DVLOG(1) << "Error reading Variation labels from the registry.";
- return;
- }
-
- // Only keep the non-Variations contents of experiment_labels.
- const base::string16 labels_to_keep =
- variations::ExtractNonVariationLabels(registry_labels);
-
- // This is a weak check, which can give false positives if the implementation
- // of variations::ExtractNonVariationLabels changes, but should be fine for
- // temporary code.
- bool needs_clearing = labels_to_keep != registry_labels;
-
- UMA_HISTOGRAM_BOOLEAN("Variations.GoogleUpdateRegistryLabelsNeedClearing",
- needs_clearing);
-
- if (!needs_clearing)
- return;
-
- GoogleUpdateSettings::SetExperimentLabels(is_system_install, labels_to_keep);
-}
-#endif // defined(OS_WIN)
-
} // namespace
ChromeVariationsServiceClient::ChromeVariationsServiceClient() {}
@@ -129,15 +89,3 @@ bool ChromeVariationsServiceClient::OverridesRestrictParameter(
return false;
#endif
}
-
-void ChromeVariationsServiceClient::OnInitialStartup() {
-#if defined(OS_WIN)
- // TODO(jwd): Remove this once we're confident most clients no longer have
- // these labels (M57-M58 timeframe).
- // Do the work on a blocking pool thread, as chrome://profiler has shown that
- // it can cause jank if done on the UI thrread.
- content::BrowserThread::GetBlockingPool()->PostDelayedTask(
- FROM_HERE, base::Bind(&ClearGoogleUpdateRegistryLabels),
- base::TimeDelta::FromSeconds(5));
-#endif
-}
« no previous file with comments | « chrome/browser/metrics/variations/chrome_variations_service_client.h ('k') | chrome/installer/util/google_update_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698