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

Unified Diff: chrome/app/client_util.cc

Issue 372473004: Retrieve client_id from GoogleUpdateSettings when its missing from Local State. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits:grt Created 6 years, 5 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/app/DEPS ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/client_util.cc
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc
index ac6dbfc111bece74b0d214d6430157f94a3d2af1..efb79d57cf6534fb3d4db5ef56d20c0885c696c1 100644
--- a/chrome/app/client_util.cc
+++ b/chrome/app/client_util.cc
@@ -34,6 +34,7 @@
#include "chrome/installer/util/util_constants.h"
#include "components/breakpad/app/breakpad_client.h"
#include "components/breakpad/app/breakpad_win.h"
+#include "components/metrics/client_info.h"
#include "content/public/app/startup_helper_win.h"
#include "sandbox/win/src/sandbox.h"
@@ -75,14 +76,14 @@ bool PreReadExperimentIsActive() {
void GetPreReadPopulationAndGroup(double* population, double* group) {
// By default we use the metrics id for the user as stable pseudo-random
// input to a hash.
- std::string metrics_id;
- GoogleUpdateSettings::LoadMetricsClientId(&metrics_id);
+ scoped_ptr<metrics::ClientInfo> client_info =
+ GoogleUpdateSettings::LoadMetricsClientInfo();
- // If this user has not metrics id, we fall back to a purely random value
- // per browser session.
+ // If this user has no metrics id, we fall back to a purely random value per
+ // browser session.
const size_t kLength = 16;
- std::string random_value(metrics_id.empty() ? base::RandBytesAsString(kLength)
- : metrics_id);
+ std::string random_value(client_info ? client_info->client_id
+ : base::RandBytesAsString(kLength));
// To interpret the value as a random number we hash it and read the first 8
// bytes of the hash as a unit-interval representing a die-toss for being in
« no previous file with comments | « chrome/app/DEPS ('k') | chrome/browser/chrome_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698