| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |