OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 6 |
7 //------------------------------------------------------------------------------ | 7 //------------------------------------------------------------------------------ |
8 // Description of the life cycle of a instance of MetricsService. | 8 // Description of the life cycle of a instance of MetricsService. |
9 // | 9 // |
10 // OVERVIEW | 10 // OVERVIEW |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 963 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
964 log_sender_factory_. | 964 log_sender_factory_. |
965 NewRunnableMethod(&MetricsService::LogTransmissionTimerDone), | 965 NewRunnableMethod(&MetricsService::LogTransmissionTimerDone), |
966 interlog_duration_.InMilliseconds()); | 966 interlog_duration_.InMilliseconds()); |
967 } | 967 } |
968 | 968 |
969 void MetricsService::LogTransmissionTimerDone() { | 969 void MetricsService::LogTransmissionTimerDone() { |
970 Task* task = log_sender_factory_. | 970 Task* task = log_sender_factory_. |
971 NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); | 971 NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); |
972 | 972 |
973 scoped_refptr<MetricsMemoryDetails> details = new MetricsMemoryDetails(task); | 973 scoped_refptr<MetricsMemoryDetails> details(new MetricsMemoryDetails(task)); |
974 details->StartFetch(); | 974 details->StartFetch(); |
975 | 975 |
976 // Collect WebCore cache information to put into a histogram. | 976 // Collect WebCore cache information to put into a histogram. |
977 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 977 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
978 !i.IsAtEnd(); i.Advance()) | 978 !i.IsAtEnd(); i.Advance()) |
979 i.GetCurrentValue()->Send(new ViewMsg_GetCacheResourceStats()); | 979 i.GetCurrentValue()->Send(new ViewMsg_GetCacheResourceStats()); |
980 } | 980 } |
981 | 981 |
982 void MetricsService::OnMemoryDetailCollectionDone() { | 982 void MetricsService::OnMemoryDetailCollectionDone() { |
983 DCHECK(IsSingleThreaded()); | 983 DCHECK(IsSingleThreaded()); |
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 thread_id = PlatformThread::CurrentId(); | 1906 thread_id = PlatformThread::CurrentId(); |
1907 return PlatformThread::CurrentId() == thread_id; | 1907 return PlatformThread::CurrentId() == thread_id; |
1908 } | 1908 } |
1909 | 1909 |
1910 #if defined(OS_CHROMEOS) | 1910 #if defined(OS_CHROMEOS) |
1911 void MetricsService::StartExternalMetrics() { | 1911 void MetricsService::StartExternalMetrics() { |
1912 external_metrics_ = new chromeos::ExternalMetrics; | 1912 external_metrics_ = new chromeos::ExternalMetrics; |
1913 external_metrics_->Start(); | 1913 external_metrics_->Start(); |
1914 } | 1914 } |
1915 #endif | 1915 #endif |
OLD | NEW |