| 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 <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/debug/activity_tracker.h" |
| 16 #include "base/files/file_path.h" | 17 #include "base/files/file_path.h" |
| 17 #include "base/files/file_util.h" | 18 #include "base/files/file_util.h" |
| 18 #include "base/lazy_instance.h" | 19 #include "base/lazy_instance.h" |
| 19 #include "base/logging.h" | 20 #include "base/logging.h" |
| 20 #include "base/memory/ptr_util.h" | 21 #include "base/memory/ptr_util.h" |
| 21 #include "base/metrics/field_trial_params.h" | 22 #include "base/metrics/field_trial_params.h" |
| 22 #include "base/metrics/histogram_macros.h" | 23 #include "base/metrics/histogram_macros.h" |
| 23 #include "base/metrics/persistent_histogram_allocator.h" | 24 #include "base/metrics/persistent_histogram_allocator.h" |
| 25 #include "base/metrics/persistent_memory_allocator.h" |
| 24 #include "base/metrics/statistics_recorder.h" | 26 #include "base/metrics/statistics_recorder.h" |
| 25 #include "base/path_service.h" | 27 #include "base/path_service.h" |
| 26 #include "base/rand_util.h" | 28 #include "base/rand_util.h" |
| 27 #include "base/strings/string16.h" | 29 #include "base/strings/string16.h" |
| 28 #include "base/threading/platform_thread.h" | 30 #include "base/threading/platform_thread.h" |
| 29 #include "base/threading/sequenced_worker_pool.h" | 31 #include "base/threading/sequenced_worker_pool.h" |
| 30 #include "base/threading/thread_task_runner_handle.h" | 32 #include "base/threading/thread_task_runner_handle.h" |
| 31 #include "build/build_config.h" | 33 #include "build/build_config.h" |
| 32 #include "chrome/browser/browser_process.h" | 34 #include "chrome/browser/browser_process.h" |
| 33 #include "chrome/browser/chrome_notification_types.h" | 35 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( | 407 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( |
| 406 kSystemProfileMinidumpStreamType, | 408 kSystemProfileMinidumpStreamType, |
| 407 reinterpret_cast<const void*>( | 409 reinterpret_cast<const void*>( |
| 408 g_environment_for_crash_reporter.Get().data()), | 410 g_environment_for_crash_reporter.Get().data()), |
| 409 g_environment_for_crash_reporter.Get().size()); | 411 g_environment_for_crash_reporter.Get().size()); |
| 410 #endif // OS_WIN || OS_MACOSX | 412 #endif // OS_WIN || OS_MACOSX |
| 411 } | 413 } |
| 412 | 414 |
| 413 void ChromeMetricsServiceClient::OnLogCleanShutdown() { | 415 void ChromeMetricsServiceClient::OnLogCleanShutdown() { |
| 414 #if defined(OS_WIN) | 416 #if defined(OS_WIN) |
| 417 base::debug::GlobalActivityTracker* global_tracker = |
| 418 base::debug::GlobalActivityTracker::Get(); |
| 419 if (global_tracker) |
| 420 global_tracker->MarkDeleted(); |
| 421 |
| 415 base::FilePath user_data_dir; | 422 base::FilePath user_data_dir; |
| 416 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 423 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 417 // TODO(manzagop): add a metric. | 424 // TODO(manzagop): add a metric. |
| 418 return; | 425 return; |
| 419 } | 426 } |
| 420 browser_watcher::MarkStabilityFileForDeletion(user_data_dir); | 427 browser_watcher::MarkStabilityFileForDeletion(user_data_dir); |
| 421 #endif // OS_WIN | 428 #endif // OS_WIN |
| 422 } | 429 } |
| 423 | 430 |
| 424 void ChromeMetricsServiceClient::InitializeSystemProfileMetrics( | 431 void ChromeMetricsServiceClient::InitializeSystemProfileMetrics( |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 ukm_service_->Purge(); | 981 ukm_service_->Purge(); |
| 975 ukm_service_->ResetClientId(); | 982 ukm_service_->ResetClientId(); |
| 976 } | 983 } |
| 977 // Signal service manager to enable/disable UKM based on new state. | 984 // Signal service manager to enable/disable UKM based on new state. |
| 978 UpdateRunningServices(); | 985 UpdateRunningServices(); |
| 979 } | 986 } |
| 980 | 987 |
| 981 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() { | 988 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() { |
| 982 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles(); | 989 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles(); |
| 983 } | 990 } |
| OLD | NEW |