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

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

Issue 10151005: cros: Log per-process memory use on low memory events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 8 months 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/memory_details_win.cc ('k') | chrome/browser/oom_priority_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 //------------------------------------------------------------------------------ 5 //------------------------------------------------------------------------------
6 // Description of the life cycle of a instance of MetricsService. 6 // Description of the life cycle of a instance of MetricsService.
7 // 7 //
8 // OVERVIEW 8 // OVERVIEW
9 // 9 //
10 // A MetricsService instance is typically created at application startup. It 10 // A MetricsService instance is typically created at application startup. It
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 // then call OnHistogramSynchronizationDone to continue processing. 920 // then call OnHistogramSynchronizationDone to continue processing.
921 DCHECK(!waiting_for_asynchronus_reporting_step_); 921 DCHECK(!waiting_for_asynchronus_reporting_step_);
922 waiting_for_asynchronus_reporting_step_ = true; 922 waiting_for_asynchronus_reporting_step_ = true;
923 923
924 base::Closure callback = 924 base::Closure callback =
925 base::Bind(&MetricsService::OnMemoryDetailCollectionDone, 925 base::Bind(&MetricsService::OnMemoryDetailCollectionDone,
926 self_ptr_factory_.GetWeakPtr()); 926 self_ptr_factory_.GetWeakPtr());
927 927
928 scoped_refptr<MetricsMemoryDetails> details( 928 scoped_refptr<MetricsMemoryDetails> details(
929 new MetricsMemoryDetails(callback)); 929 new MetricsMemoryDetails(callback));
930 details->StartFetch(); 930 details->StartFetch(MemoryDetails::UPDATE_USER_METRICS);
931 931
932 // Collect WebCore cache information to put into a histogram. 932 // Collect WebCore cache information to put into a histogram.
933 for (content::RenderProcessHost::iterator i( 933 for (content::RenderProcessHost::iterator i(
934 content::RenderProcessHost::AllHostsIterator()); 934 content::RenderProcessHost::AllHostsIterator());
935 !i.IsAtEnd(); i.Advance()) 935 !i.IsAtEnd(); i.Advance())
936 i.GetCurrentValue()->Send(new ChromeViewMsg_GetCacheResourceStats()); 936 i.GetCurrentValue()->Send(new ChromeViewMsg_GetCacheResourceStats());
937 } 937 }
938 938
939 void MetricsService::OnMemoryDetailCollectionDone() { 939 void MetricsService::OnMemoryDetailCollectionDone() {
940 DCHECK(IsSingleThreaded()); 940 DCHECK(IsSingleThreaded());
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 if (local_state) { 1670 if (local_state) {
1671 const PrefService::Preference* uma_pref = 1671 const PrefService::Preference* uma_pref =
1672 local_state->FindPreference(prefs::kMetricsReportingEnabled); 1672 local_state->FindPreference(prefs::kMetricsReportingEnabled);
1673 if (uma_pref) { 1673 if (uma_pref) {
1674 bool success = uma_pref->GetValue()->GetAsBoolean(&result); 1674 bool success = uma_pref->GetValue()->GetAsBoolean(&result);
1675 DCHECK(success); 1675 DCHECK(success);
1676 } 1676 }
1677 } 1677 }
1678 return result; 1678 return result;
1679 } 1679 }
OLDNEW
« no previous file with comments | « chrome/browser/memory_details_win.cc ('k') | chrome/browser/oom_priority_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698