Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/prefs/pref_registry_simple.h" | 15 #include "base/prefs/pref_registry_simple.h" |
| 16 #include "base/prefs/pref_service.h" | 16 #include "base/prefs/pref_service.h" |
| 17 #include "base/strings/string16.h" | 17 #include "base/strings/string16.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
| 21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/chrome_notification_types.h" | 22 #include "chrome/browser/chrome_notification_types.h" |
| 23 #include "chrome/browser/google/google_brand.h" | 23 #include "chrome/browser/google/google_brand.h" |
| 24 #include "chrome/browser/metrics/call_stack_profile_metrics_provider.h" | |
| 24 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 25 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 25 #include "chrome/browser/metrics/omnibox_metrics_provider.h" | 26 #include "chrome/browser/metrics/omnibox_metrics_provider.h" |
| 26 #include "chrome/browser/ui/browser_otr_state.h" | 27 #include "chrome/browser/ui/browser_otr_state.h" |
| 27 #include "chrome/common/chrome_constants.h" | 28 #include "chrome/common/chrome_constants.h" |
| 28 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/chrome_version_info.h" | 30 #include "chrome/common/chrome_version_info.h" |
| 30 #include "chrome/common/crash_keys.h" | 31 #include "chrome/common/crash_keys.h" |
| 31 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
| 32 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
| 33 #include "components/metrics/gpu/gpu_metrics_provider.h" | 34 #include "components/metrics/gpu/gpu_metrics_provider.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 metrics_service_->RegisterMetricsProvider( | 287 metrics_service_->RegisterMetricsProvider( |
| 287 scoped_ptr<metrics::MetricsProvider>(new ChromeStabilityMetricsProvider)); | 288 scoped_ptr<metrics::MetricsProvider>(new ChromeStabilityMetricsProvider)); |
| 288 metrics_service_->RegisterMetricsProvider( | 289 metrics_service_->RegisterMetricsProvider( |
| 289 scoped_ptr<metrics::MetricsProvider>(new metrics::GPUMetricsProvider())); | 290 scoped_ptr<metrics::MetricsProvider>(new metrics::GPUMetricsProvider())); |
| 290 | 291 |
| 291 profiler_metrics_provider_ = | 292 profiler_metrics_provider_ = |
| 292 new metrics::ProfilerMetricsProvider(cellular_callback); | 293 new metrics::ProfilerMetricsProvider(cellular_callback); |
| 293 metrics_service_->RegisterMetricsProvider( | 294 metrics_service_->RegisterMetricsProvider( |
| 294 scoped_ptr<metrics::MetricsProvider>(profiler_metrics_provider_)); | 295 scoped_ptr<metrics::MetricsProvider>(profiler_metrics_provider_)); |
| 295 | 296 |
| 297 call_stack_profile_metrics_provider_ = new CallStackProfileMetricsProvider; | |
|
Ilya Sherman
2015/03/10 01:44:46
I don't see any reason to cache this pointer (nor
Mike Wittman
2015/03/16 23:55:15
No, removed.
| |
| 298 metrics_service_->RegisterMetricsProvider( | |
| 299 scoped_ptr<metrics::MetricsProvider>( | |
| 300 call_stack_profile_metrics_provider_)); | |
| 301 | |
| 296 #if defined(OS_ANDROID) | 302 #if defined(OS_ANDROID) |
| 297 metrics_service_->RegisterMetricsProvider( | 303 metrics_service_->RegisterMetricsProvider( |
| 298 scoped_ptr<metrics::MetricsProvider>( | 304 scoped_ptr<metrics::MetricsProvider>( |
| 299 new AndroidMetricsProvider(g_browser_process->local_state()))); | 305 new AndroidMetricsProvider(g_browser_process->local_state()))); |
| 300 #endif // defined(OS_ANDROID) | 306 #endif // defined(OS_ANDROID) |
| 301 | 307 |
| 302 #if defined(OS_WIN) | 308 #if defined(OS_WIN) |
| 303 google_update_metrics_provider_ = new GoogleUpdateMetricsProviderWin; | 309 google_update_metrics_provider_ = new GoogleUpdateMetricsProviderWin; |
| 304 metrics_service_->RegisterMetricsProvider( | 310 metrics_service_->RegisterMetricsProvider( |
| 305 scoped_ptr<metrics::MetricsProvider>(google_update_metrics_provider_)); | 311 scoped_ptr<metrics::MetricsProvider>(google_update_metrics_provider_)); |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 553 // Capture the histogram samples. | 559 // Capture the histogram samples. |
| 554 if (dumps_with_crash != 0) | 560 if (dumps_with_crash != 0) |
| 555 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 561 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
| 556 if (dumps_with_no_crash != 0) | 562 if (dumps_with_no_crash != 0) |
| 557 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 563 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
| 558 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 564 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
| 559 if (total_dumps != 0) | 565 if (total_dumps != 0) |
| 560 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 566 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
| 561 } | 567 } |
| 562 #endif // defined(OS_WIN) | 568 #endif // defined(OS_WIN) |
| OLD | NEW |