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" | |
17 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
18 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
19 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
20 #include "base/logging.h" | 19 #include "base/logging.h" |
21 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
22 #include "base/metrics/field_trial_params.h" | 21 #include "base/metrics/field_trial_params.h" |
23 #include "base/metrics/histogram_macros.h" | 22 #include "base/metrics/histogram_macros.h" |
24 #include "base/metrics/persistent_histogram_allocator.h" | 23 #include "base/metrics/persistent_histogram_allocator.h" |
25 #include "base/metrics/persistent_memory_allocator.h" | 24 #include "base/metrics/persistent_memory_allocator.h" |
26 #include "base/metrics/statistics_recorder.h" | 25 #include "base/metrics/statistics_recorder.h" |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( | 415 crashpad::CrashpadInfo::GetCrashpadInfo()->AddUserDataMinidumpStream( |
417 kSystemProfileMinidumpStreamType, | 416 kSystemProfileMinidumpStreamType, |
418 reinterpret_cast<const void*>( | 417 reinterpret_cast<const void*>( |
419 g_environment_for_crash_reporter.Get().data()), | 418 g_environment_for_crash_reporter.Get().data()), |
420 g_environment_for_crash_reporter.Get().size()); | 419 g_environment_for_crash_reporter.Get().size()); |
421 #endif // OS_WIN || OS_MACOSX | 420 #endif // OS_WIN || OS_MACOSX |
422 } | 421 } |
423 | 422 |
424 void ChromeMetricsServiceClient::OnLogCleanShutdown() { | 423 void ChromeMetricsServiceClient::OnLogCleanShutdown() { |
425 #if defined(OS_WIN) | 424 #if defined(OS_WIN) |
426 base::debug::GlobalActivityTracker* global_tracker = | |
427 base::debug::GlobalActivityTracker::Get(); | |
428 if (global_tracker) | |
429 global_tracker->MarkDeleted(); | |
430 | |
431 base::FilePath user_data_dir; | 425 base::FilePath user_data_dir; |
432 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 426 if (base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) |
433 // TODO(manzagop): add a metric. | 427 browser_watcher::MarkOwnStabilityFileDeleted(user_data_dir); |
434 return; | |
435 } | |
436 browser_watcher::MarkStabilityFileForDeletion(user_data_dir); | |
437 #endif // OS_WIN | 428 #endif // OS_WIN |
438 } | 429 } |
439 | 430 |
440 void ChromeMetricsServiceClient::InitializeSystemProfileMetrics( | 431 void ChromeMetricsServiceClient::InitializeSystemProfileMetrics( |
441 const base::Closure& done_callback) { | 432 const base::Closure& done_callback) { |
442 DCHECK(initialize_task_queue_.empty()); | 433 DCHECK(initialize_task_queue_.empty()); |
443 | 434 |
444 // Each provider's initializer takes its own "done_callback" to enable | 435 // Each provider's initializer takes its own "done_callback" to enable |
445 // asynchronously chaining. We bind |next_task| to this callback, so | 436 // asynchronously chaining. We bind |next_task| to this callback, so |
446 // OnInitNextTask() gets called after each initializer, and we can go through | 437 // OnInitNextTask() gets called after each initializer, and we can go through |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1002 ukm_service_->Purge(); | 993 ukm_service_->Purge(); |
1003 ukm_service_->ResetClientId(); | 994 ukm_service_->ResetClientId(); |
1004 } | 995 } |
1005 // Signal service manager to enable/disable UKM based on new state. | 996 // Signal service manager to enable/disable UKM based on new state. |
1006 UpdateRunningServices(); | 997 UpdateRunningServices(); |
1007 } | 998 } |
1008 | 999 |
1009 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() { | 1000 bool ChromeMetricsServiceClient::IsHistorySyncEnabledOnAllProfiles() { |
1010 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles(); | 1001 return SyncDisableObserver::IsHistorySyncEnabledOnAllProfiles(); |
1011 } | 1002 } |
OLD | NEW |