| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/browser_process.h" | 28 #include "chrome/browser/browser_process.h" |
| 29 #include "chrome/browser/chrome_notification_types.h" | 29 #include "chrome/browser/chrome_notification_types.h" |
| 30 #include "chrome/browser/google/google_brand.h" | 30 #include "chrome/browser/google/google_brand.h" |
| 31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 32 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 32 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 33 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" | 33 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" |
| 34 #include "chrome/browser/metrics/metrics_reporting_state.h" | 34 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 35 #include "chrome/browser/metrics/network_quality_estimator_provider_impl.h" | 35 #include "chrome/browser/metrics/network_quality_estimator_provider_impl.h" |
| 36 #include "chrome/browser/metrics/sampling_metrics_provider.h" | 36 #include "chrome/browser/metrics/sampling_metrics_provider.h" |
| 37 #include "chrome/browser/metrics/subprocess_metrics_provider.h" | 37 #include "chrome/browser/metrics/subprocess_metrics_provider.h" |
| 38 #include "chrome/browser/metrics/time_ticks_experiment_win.h" | |
| 39 #include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h" | 38 #include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h" |
| 40 #include "chrome/browser/sync/chrome_sync_client.h" | 39 #include "chrome/browser/sync/chrome_sync_client.h" |
| 41 #include "chrome/browser/ui/browser_otr_state.h" | 40 #include "chrome/browser/ui/browser_otr_state.h" |
| 42 #include "chrome/common/channel_info.h" | 41 #include "chrome/common/channel_info.h" |
| 43 #include "chrome/common/chrome_paths.h" | 42 #include "chrome/common/chrome_paths.h" |
| 44 #include "chrome/common/chrome_paths_internal.h" | 43 #include "chrome/common/chrome_paths_internal.h" |
| 45 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
| 46 #include "chrome/common/crash_keys.h" | 45 #include "chrome/common/crash_keys.h" |
| 47 #include "chrome/common/features.h" | 46 #include "chrome/common/features.h" |
| 48 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 g_environment_for_crash_reporter.Get() = std::move(*environment); | 380 g_environment_for_crash_reporter.Get() = std::move(*environment); |
| 382 | 381 |
| 383 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( | 382 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( |
| 384 kSystemProfileMinidumpStreamType, | 383 kSystemProfileMinidumpStreamType, |
| 385 reinterpret_cast<const void*>( | 384 reinterpret_cast<const void*>( |
| 386 g_environment_for_crash_reporter.Get().data()), | 385 g_environment_for_crash_reporter.Get().data()), |
| 387 g_environment_for_crash_reporter.Get().size()); | 386 g_environment_for_crash_reporter.Get().size()); |
| 388 #endif // OS_WIN || OS_MACOSX | 387 #endif // OS_WIN || OS_MACOSX |
| 389 } | 388 } |
| 390 | 389 |
| 391 void ChromeMetricsServiceClient::OnLogUploadComplete() { | |
| 392 // Collect time ticks stats after each UMA upload. | |
| 393 #if defined(OS_WIN) | |
| 394 chrome::CollectTimeTicksStats(); | |
| 395 #endif | |
| 396 } | |
| 397 | |
| 398 void ChromeMetricsServiceClient::OnLogCleanShutdown() { | 390 void ChromeMetricsServiceClient::OnLogCleanShutdown() { |
| 399 #if defined(OS_WIN) | 391 #if defined(OS_WIN) |
| 400 base::FilePath user_data_dir; | 392 base::FilePath user_data_dir; |
| 401 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 393 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 402 // TODO(manzagop): add a metric. | 394 // TODO(manzagop): add a metric. |
| 403 return; | 395 return; |
| 404 } | 396 } |
| 405 browser_watcher::MarkStabilityFileForDeletion(user_data_dir); | 397 browser_watcher::MarkStabilityFileForDeletion(user_data_dir); |
| 406 #endif // OS_WIN | 398 #endif // OS_WIN |
| 407 } | 399 } |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 } | 889 } |
| 898 } | 890 } |
| 899 | 891 |
| 900 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 892 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 901 metrics_service_->OnApplicationNotIdle(); | 893 metrics_service_->OnApplicationNotIdle(); |
| 902 } | 894 } |
| 903 | 895 |
| 904 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { | 896 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
| 905 return metrics::IsCellularLogicEnabled(); | 897 return metrics::IsCellularLogicEnabled(); |
| 906 } | 898 } |
| OLD | NEW |