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

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 502173002: Move more metrics classes to metrics namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test compile. Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chrome_metrics_service_client.h" 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 client->Initialize(); 149 client->Initialize();
150 150
151 return client.Pass(); 151 return client.Pass();
152 } 152 }
153 153
154 // static 154 // static
155 void ChromeMetricsServiceClient::RegisterPrefs(PrefRegistrySimple* registry) { 155 void ChromeMetricsServiceClient::RegisterPrefs(PrefRegistrySimple* registry) {
156 registry->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0); 156 registry->RegisterInt64Pref(prefs::kUninstallLastLaunchTimeSec, 0);
157 registry->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0); 157 registry->RegisterInt64Pref(prefs::kUninstallLastObservedRunTimeSec, 0);
158 158
159 MetricsService::RegisterPrefs(registry); 159 metrics::MetricsService::RegisterPrefs(registry);
160 ChromeStabilityMetricsProvider::RegisterPrefs(registry); 160 ChromeStabilityMetricsProvider::RegisterPrefs(registry);
161 161
162 #if defined(OS_ANDROID) 162 #if defined(OS_ANDROID)
163 AndroidMetricsProvider::RegisterPrefs(registry); 163 AndroidMetricsProvider::RegisterPrefs(registry);
164 #endif // defined(OS_ANDROID) 164 #endif // defined(OS_ANDROID)
165 165
166 #if defined(ENABLE_PLUGINS) 166 #if defined(ENABLE_PLUGINS)
167 PluginMetricsProvider::RegisterPrefs(registry); 167 PluginMetricsProvider::RegisterPrefs(registry);
168 #endif // defined(ENABLE_PLUGINS) 168 #endif // defined(ENABLE_PLUGINS)
169 } 169 }
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void ChromeMetricsServiceClient::LogPluginLoadingError( 273 void ChromeMetricsServiceClient::LogPluginLoadingError(
274 const base::FilePath& plugin_path) { 274 const base::FilePath& plugin_path) {
275 #if defined(ENABLE_PLUGINS) 275 #if defined(ENABLE_PLUGINS)
276 plugin_metrics_provider_->LogPluginLoadingError(plugin_path); 276 plugin_metrics_provider_->LogPluginLoadingError(plugin_path);
277 #else 277 #else
278 NOTREACHED(); 278 NOTREACHED();
279 #endif // defined(ENABLE_PLUGINS) 279 #endif // defined(ENABLE_PLUGINS)
280 } 280 }
281 281
282 void ChromeMetricsServiceClient::Initialize() { 282 void ChromeMetricsServiceClient::Initialize() {
283 metrics_service_.reset(new MetricsService( 283 metrics_service_.reset(new metrics::MetricsService(
284 metrics_state_manager_, this, g_browser_process->local_state())); 284 metrics_state_manager_, this, g_browser_process->local_state()));
285 285
286 // Register metrics providers. 286 // Register metrics providers.
287 #if defined(ENABLE_EXTENSIONS) 287 #if defined(ENABLE_EXTENSIONS)
288 metrics_service_->RegisterMetricsProvider( 288 metrics_service_->RegisterMetricsProvider(
289 scoped_ptr<metrics::MetricsProvider>( 289 scoped_ptr<metrics::MetricsProvider>(
290 new ExtensionsMetricsProvider(metrics_state_manager_))); 290 new ExtensionsMetricsProvider(metrics_state_manager_)));
291 #endif 291 #endif
292 metrics_service_->RegisterMetricsProvider( 292 metrics_service_->RegisterMetricsProvider(
293 scoped_ptr<metrics::MetricsProvider>(new NetworkMetricsProvider)); 293 scoped_ptr<metrics::MetricsProvider>(new NetworkMetricsProvider));
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 // Capture the histogram samples. 544 // Capture the histogram samples.
545 if (dumps_with_crash != 0) 545 if (dumps_with_crash != 0)
546 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); 546 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash);
547 if (dumps_with_no_crash != 0) 547 if (dumps_with_no_crash != 0)
548 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); 548 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash);
549 int total_dumps = dumps_with_crash + dumps_with_no_crash; 549 int total_dumps = dumps_with_crash + dumps_with_no_crash;
550 if (total_dumps != 0) 550 if (total_dumps != 0)
551 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); 551 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps);
552 } 552 }
553 #endif // defined(OS_WIN) 553 #endif // defined(OS_WIN)
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chrome_metrics_service_client.h ('k') | chrome/browser/metrics/extensions_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698