| OLD | NEW | 
|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include "chrome/browser/metrics/metrics_log.h" | 5 #include "chrome/browser/metrics/metrics_log.h" | 
| 6 | 6 | 
| 7 #include <string> | 7 #include <string> | 
| 8 #include <vector> | 8 #include <vector> | 
| 9 | 9 | 
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" | 
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 271 | 271 | 
| 272 static base::LazyInstance<std::string>::Leaky | 272 static base::LazyInstance<std::string>::Leaky | 
| 273   g_version_extension = LAZY_INSTANCE_INITIALIZER; | 273   g_version_extension = LAZY_INSTANCE_INITIALIZER; | 
| 274 | 274 | 
| 275 MetricsLog::MetricsLog(const std::string& client_id, int session_id) | 275 MetricsLog::MetricsLog(const std::string& client_id, int session_id) | 
| 276     : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()) {} | 276     : MetricsLogBase(client_id, session_id, MetricsLog::GetVersionString()) {} | 
| 277 | 277 | 
| 278 MetricsLog::~MetricsLog() {} | 278 MetricsLog::~MetricsLog() {} | 
| 279 | 279 | 
| 280 // static | 280 // static | 
| 281 void MetricsLog::RegisterPrefs(PrefService* local_state) { | 281 void MetricsLog::RegisterPrefs(PrefServiceSimple* local_state) { | 
| 282   local_state->RegisterListPref(prefs::kStabilityPluginStats); | 282   local_state->RegisterListPref(prefs::kStabilityPluginStats); | 
| 283 } | 283 } | 
| 284 | 284 | 
| 285 // static | 285 // static | 
| 286 int64 MetricsLog::GetIncrementalUptime(PrefService* pref) { | 286 int64 MetricsLog::GetIncrementalUptime(PrefService* pref) { | 
| 287   base::TimeTicks now = base::TimeTicks::Now(); | 287   base::TimeTicks now = base::TimeTicks::Now(); | 
| 288   static base::TimeTicks last_updated_time(now); | 288   static base::TimeTicks last_updated_time(now); | 
| 289   int64 incremental_time = (now - last_updated_time).InSeconds(); | 289   int64 incremental_time = (now - last_updated_time).InSeconds(); | 
| 290   last_updated_time = now; | 290   last_updated_time = now; | 
| 291 | 291 | 
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1025     ProductDataToProto(google_update_metrics.google_update_data, | 1025     ProductDataToProto(google_update_metrics.google_update_data, | 
| 1026                        google_update->mutable_google_update_status()); | 1026                        google_update->mutable_google_update_status()); | 
| 1027   } | 1027   } | 
| 1028 | 1028 | 
| 1029   if (!google_update_metrics.product_data.version.empty()) { | 1029   if (!google_update_metrics.product_data.version.empty()) { | 
| 1030     ProductDataToProto(google_update_metrics.product_data, | 1030     ProductDataToProto(google_update_metrics.product_data, | 
| 1031                        google_update->mutable_client_status()); | 1031                        google_update->mutable_client_status()); | 
| 1032   } | 1032   } | 
| 1033 #endif  // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) | 1033 #endif  // defined(GOOGLE_CHROME_BUILD) && defined(OS_WIN) | 
| 1034 } | 1034 } | 
| OLD | NEW | 
|---|