| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 #endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) | 370 #endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD) |
| 371 } | 371 } |
| 372 | 372 |
| 373 void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() { | 373 void ChromeMetricsServiceClient::OnInitTaskGotGoogleUpdateData() { |
| 374 // Start the next part of the init task: fetching performance data. This will | 374 // Start the next part of the init task: fetching performance data. This will |
| 375 // call into |FinishedReceivingProfilerData()| when the task completes. | 375 // call into |FinishedReceivingProfilerData()| when the task completes. |
| 376 metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously( | 376 metrics::TrackingSynchronizer::FetchProfilerDataAsynchronously( |
| 377 weak_ptr_factory_.GetWeakPtr()); | 377 weak_ptr_factory_.GetWeakPtr()); |
| 378 } | 378 } |
| 379 | 379 |
| 380 // TODO(vadimt): Consider wrapping params in a struct after the list of params |
| 381 // to ReceivedProfilerData settles. crbug/456354. |
| 380 void ChromeMetricsServiceClient::ReceivedProfilerData( | 382 void ChromeMetricsServiceClient::ReceivedProfilerData( |
| 381 const tracked_objects::ProcessDataSnapshot& process_data, | 383 const tracked_objects::ProcessDataPhaseSnapshot& process_data_phase, |
| 382 int process_type) { | 384 base::ProcessId process_id, |
| 383 profiler_metrics_provider_->RecordProfilerData(process_data, process_type); | 385 content::ProcessType process_type, |
| 386 int profiling_phase, |
| 387 const base::TimeDelta& phase_start, |
| 388 const base::TimeDelta& phase_finish, |
| 389 const metrics::ProfilerEvents& past_events) { |
| 390 profiler_metrics_provider_->RecordProfilerData( |
| 391 process_data_phase, process_id, process_type, profiling_phase, |
| 392 phase_start, phase_finish, past_events); |
| 384 } | 393 } |
| 385 | 394 |
| 386 void ChromeMetricsServiceClient::FinishedReceivingProfilerData() { | 395 void ChromeMetricsServiceClient::FinishedReceivingProfilerData() { |
| 387 finished_gathering_initial_metrics_callback_.Run(); | 396 finished_gathering_initial_metrics_callback_.Run(); |
| 388 } | 397 } |
| 389 | 398 |
| 390 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { | 399 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { |
| 391 DCHECK(thread_checker_.CalledOnValidThread()); | 400 DCHECK(thread_checker_.CalledOnValidThread()); |
| 392 | 401 |
| 393 // This function should only be called as the callback from an ansynchronous | 402 // This function should only be called as the callback from an ansynchronous |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 // Capture the histogram samples. | 562 // Capture the histogram samples. |
| 554 if (dumps_with_crash != 0) | 563 if (dumps_with_crash != 0) |
| 555 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); | 564 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithCrash", dumps_with_crash); |
| 556 if (dumps_with_no_crash != 0) | 565 if (dumps_with_no_crash != 0) |
| 557 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); | 566 UMA_HISTOGRAM_COUNTS("Chrome.BrowserDumpsWithNoCrash", dumps_with_no_crash); |
| 558 int total_dumps = dumps_with_crash + dumps_with_no_crash; | 567 int total_dumps = dumps_with_crash + dumps_with_no_crash; |
| 559 if (total_dumps != 0) | 568 if (total_dumps != 0) |
| 560 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); | 569 UMA_HISTOGRAM_COUNTS("Chrome.BrowserCrashDumpAttempts", total_dumps); |
| 561 } | 570 } |
| 562 #endif // defined(OS_WIN) | 571 #endif // defined(OS_WIN) |
| OLD | NEW |