| Index: chrome/browser/metrics/metrics_service.cc
|
| ===================================================================
|
| --- chrome/browser/metrics/metrics_service.cc (revision 11199)
|
| +++ chrome/browser/metrics/metrics_service.cc (working copy)
|
| @@ -430,6 +430,19 @@
|
| return;
|
|
|
| if (enabled) {
|
| + if (client_id_.empty()) {
|
| + PrefService* pref = g_browser_process->local_state();
|
| + DCHECK(pref);
|
| + client_id_ = WideToUTF8(pref->GetString(prefs::kMetricsClientID));
|
| + if (client_id_.empty()) {
|
| + client_id_ = GenerateClientID();
|
| + pref->SetString(prefs::kMetricsClientID, UTF8ToWide(client_id_));
|
| +
|
| + // Might as well make a note of how long this ID has existed
|
| + pref->SetString(prefs::kMetricsClientIDTimestamp,
|
| + Int64ToWString(Time::Now().ToTimeT()));
|
| + }
|
| + }
|
| StartRecording();
|
| ListenerRegistration(true);
|
| } else {
|
| @@ -592,15 +605,6 @@
|
| UTF8ToWide(MetricsLog::GetVersionString()));
|
| }
|
|
|
| - client_id_ = WideToUTF8(pref->GetString(prefs::kMetricsClientID));
|
| - if (client_id_.empty()) {
|
| - client_id_ = GenerateClientID();
|
| - pref->SetString(prefs::kMetricsClientID, UTF8ToWide(client_id_));
|
| -
|
| - // Might as well make a note of how long this ID has existed
|
| - pref->SetInt64(prefs::kMetricsClientIDTimestamp, Time::Now().ToTimeT());
|
| - }
|
| -
|
| // Update session ID
|
| session_id_ = pref->GetInteger(prefs::kMetricsSessionID);
|
| ++session_id_;
|
|
|