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" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 #endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 423 #endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
424 } | 424 } |
425 | 425 |
426 void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() { | 426 void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() { |
427 // Start the next part of the init task: fetching performance data. This will | 427 // Start the next part of the init task: fetching performance data. This will |
428 // call into |FinishedReceivingProfilerData()| when the task completes. | 428 // call into |FinishedReceivingProfilerData()| when the task completes. |
429 metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously( | 429 metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously( |
430 weak_ptr_factory_.GetWeakPtr()); | 430 weak_ptr_factory_.GetWeakPtr()); |
431 } | 431 } |
432 | 432 |
| 433 // TODO(vadimt): Consider wrapping params in a struct after the list of params |
| 434 // to ReceivedProfilerData settles. crbug/456354. |
433 void ChromeMetricsServiceClient::ReceivedProfilerData( | 435 void ChromeMetricsServiceClient::ReceivedProfilerData( |
434 const tracked_objects::ProcessDataSnapshot& process_data, | 436 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase, |
435 int process_type) { | 437 base::ProcessId process_id, |
436 profiler_metrics_provider_->RecordProfilerData(process_data, process_type); | 438 content::ProcessType process_type, |
| 439 int profiling_phase, |
| 440 base::TimeDelta phase_start, |
| 441 base::TimeDelta phase_finish, |
| 442 const metrics::ProfilerEvents& past_events) { |
| 443 profiler_metrics_provider_->RecordProfilerData( |
| 444 process_data_phase, process_id, process_type, profiling_phase, |
| 445 phase_start, phase_finish, past_events); |
437 } | 446 } |
438 | 447 |
439 void ChromeMetricsServiceClient::FinishedReceivingProfilerData() { | 448 void ChromeMetricsServiceClient::FinishedReceivingProfilerData() { |
440 drive_metrics_provider_->GetDriveMetrics( | 449 drive_metrics_provider_->GetDriveMetrics( |
441 finished_gathering_initial_metrics_callback_); | 450 finished_gathering_initial_metrics_callback_); |
442 } | 451 } |
443 | 452 |
444 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { | 453 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { |
445 DCHECK(thread_checker_.CalledOnValidThread()); | 454 DCHECK(thread_checker_.CalledOnValidThread()); |
446 | 455 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 // Capture the histogram samples. | 616 // Capture the histogram samples. |
608 if (dumps_with_crash != 0) | 617 if (dumps_with_crash != 0) |
609 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 618 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
610 if (dumps_with_no_crash != 0) | 619 if (dumps_with_no_crash != 0) |
611 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 620 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
612 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 621 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
613 if (total_dumps != 0) | 622 if (total_dumps != 0) |
614 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 623 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
615 } | 624 } |
616 #endif // defined(OS_WIN) | 625 #endif // defined(OS_WIN) |
OLD | NEW |