Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 2566083002: Add peak memory usage metric
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 // finished, it will call OnMemoryDetailCollectionDone. That will in turn 735 // finished, it will call OnMemoryDetailCollectionDone. That will in turn
736 // call HistogramSynchronization to collect histograms from all renderers and 736 // call HistogramSynchronization to collect histograms from all renderers and
737 // then call OnHistogramSynchronizationDone to continue processing. 737 // then call OnHistogramSynchronizationDone to continue processing.
738 DCHECK(!waiting_for_collect_final_metrics_step_); 738 DCHECK(!waiting_for_collect_final_metrics_step_);
739 waiting_for_collect_final_metrics_step_ = true; 739 waiting_for_collect_final_metrics_step_ = true;
740 740
741 base::Closure callback = 741 base::Closure callback =
742 base::Bind(&ChromeMetricsServiceClient::OnMemoryDetailCollectionDone, 742 base::Bind(&ChromeMetricsServiceClient::OnMemoryDetailCollectionDone,
743 weak_ptr_factory_.GetWeakPtr()); 743 weak_ptr_factory_.GetWeakPtr());
744 744
745 scoped_refptr<MetricsMemoryDetails> details( 745 scoped_refptr<MetricsMemoryDetails> details(new MetricsMemoryDetails(
746 new MetricsMemoryDetails(callback, &memory_growth_tracker_)); 746 callback, &memory_growth_tracker_, &peak_memory_usage_tracker_));
747 details->StartFetch(); 747 details->StartFetch();
748 } 748 }
749 749
750 void ChromeMetricsServiceClient::MergeHistogramDeltas() { 750 void ChromeMetricsServiceClient::MergeHistogramDeltas() {
751 DCHECK(GetMetricsService()); 751 DCHECK(GetMetricsService());
752 GetMetricsService()->MergeHistogramDeltas(); 752 GetMetricsService()->MergeHistogramDeltas();
753 } 753 }
754 754
755 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() { 755 void ChromeMetricsServiceClient::OnMemoryDetailCollectionDone() {
756 DCHECK(thread_checker_.CalledOnValidThread()); 756 DCHECK(thread_checker_.CalledOnValidThread());
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 } 884 }
885 } 885 }
886 886
887 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { 887 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) {
888 metrics_service_->OnApplicationNotIdle(); 888 metrics_service_->OnApplicationNotIdle();
889 } 889 }
890 890
891 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { 891 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() {
892 return metrics::IsCellularLogicEnabled(); 892 return metrics::IsCellularLogicEnabled();
893 } 893 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698