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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 #include "chrome/browser/google/google_brand.h" | 27 #include "chrome/browser/google/google_brand.h" |
| 28 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 28 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 29 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 29 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 30 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" | 30 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" |
| 31 #include "chrome/browser/metrics/metrics_reporting_state.h" | 31 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 32 #include "chrome/browser/metrics/sampling_metrics_provider.h" | 32 #include "chrome/browser/metrics/sampling_metrics_provider.h" |
| 33 #include "chrome/browser/metrics/subprocess_metrics_provider.h" | 33 #include "chrome/browser/metrics/subprocess_metrics_provider.h" |
| 34 #include "chrome/browser/metrics/time_ticks_experiment_win.h" | 34 #include "chrome/browser/metrics/time_ticks_experiment_win.h" |
| 35 #include "chrome/browser/sync/chrome_sync_client.h" | 35 #include "chrome/browser/sync/chrome_sync_client.h" |
| 36 #include "chrome/browser/ui/browser_otr_state.h" | 36 #include "chrome/browser/ui/browser_otr_state.h" |
| 37 #include "chrome/chrome_watcher/chrome_postmortem_report_collector.h" | |
| 37 #include "chrome/common/channel_info.h" | 38 #include "chrome/common/channel_info.h" |
| 38 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
| 39 #include "chrome/common/chrome_paths_internal.h" | 40 #include "chrome/common/chrome_paths_internal.h" |
| 40 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 41 #include "chrome/common/crash_keys.h" | 42 #include "chrome/common/crash_keys.h" |
| 42 #include "chrome/common/features.h" | 43 #include "chrome/common/features.h" |
| 43 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/installer/util/util_constants.h" | 45 #include "chrome/installer/util/util_constants.h" |
| 45 #include "components/metrics/call_stack_profile_metrics_provider.h" | 46 #include "components/metrics/call_stack_profile_metrics_provider.h" |
| 46 #include "components/metrics/drive_metrics_provider.h" | 47 #include "components/metrics/drive_metrics_provider.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 493 base::FilePath user_data_dir; | 494 base::FilePath user_data_dir; |
| 494 base::FilePath crash_dir; | 495 base::FilePath crash_dir; |
| 495 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir) || | 496 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir) || |
| 496 !base::PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dir)) { | 497 !base::PathService::Get(chrome::DIR_CRASH_DUMPS, &crash_dir)) { |
| 497 // If either call fails, then clear both. | 498 // If either call fails, then clear both. |
| 498 user_data_dir = base::FilePath(); | 499 user_data_dir = base::FilePath(); |
| 499 crash_dir = base::FilePath(); | 500 crash_dir = base::FilePath(); |
| 500 } | 501 } |
| 501 watcher_metrics_provider_ = new browser_watcher::WatcherMetricsProviderWin( | 502 watcher_metrics_provider_ = new browser_watcher::WatcherMetricsProviderWin( |
| 502 chrome::GetBrowserExitCodesRegistryPath(), user_data_dir, crash_dir, | 503 chrome::GetBrowserExitCodesRegistryPath(), user_data_dir, crash_dir, |
| 504 base::WrapUnique(new chrome_watcher::ChromePostmortemReportCollector()), | |
|
grt (UTC plus 2)
2016/09/27 20:43:09
base::MakeUnique<chrome_watcher::ChromePostmortemR
manzagop (departed)
2016/09/28 16:29:17
Agreed that is better. Done.
| |
| 503 content::BrowserThread::GetBlockingPool()); | 505 content::BrowserThread::GetBlockingPool()); |
| 504 metrics_service_->RegisterMetricsProvider( | 506 metrics_service_->RegisterMetricsProvider( |
| 505 std::unique_ptr<metrics::MetricsProvider>(watcher_metrics_provider_)); | 507 std::unique_ptr<metrics::MetricsProvider>(watcher_metrics_provider_)); |
| 506 | 508 |
| 507 antivirus_metrics_provider_ = new AntiVirusMetricsProvider( | 509 antivirus_metrics_provider_ = new AntiVirusMetricsProvider( |
| 508 content::BrowserThread::GetBlockingPool() | 510 content::BrowserThread::GetBlockingPool() |
| 509 ->GetTaskRunnerWithShutdownBehavior( | 511 ->GetTaskRunnerWithShutdownBehavior( |
| 510 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)); | 512 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)); |
| 511 | 513 |
| 512 metrics_service_->RegisterMetricsProvider( | 514 metrics_service_->RegisterMetricsProvider( |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 816 } | 818 } |
| 817 } | 819 } |
| 818 | 820 |
| 819 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 821 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 820 metrics_service_->OnApplicationNotIdle(); | 822 metrics_service_->OnApplicationNotIdle(); |
| 821 } | 823 } |
| 822 | 824 |
| 823 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { | 825 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
| 824 return metrics::IsCellularLogicEnabled(); | 826 return metrics::IsCellularLogicEnabled(); |
| 825 } | 827 } |
| OLD | NEW |