| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 | 942 |
| 943 Task* task = log_sender_factory_. | 943 Task* task = log_sender_factory_. |
| 944 NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); | 944 NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); |
| 945 | 945 |
| 946 scoped_refptr<MetricsMemoryDetails> details(new MetricsMemoryDetails(task)); | 946 scoped_refptr<MetricsMemoryDetails> details(new MetricsMemoryDetails(task)); |
| 947 details->StartFetch(); | 947 details->StartFetch(); |
| 948 | 948 |
| 949 // Collect WebCore cache information to put into a histogram. | 949 // Collect WebCore cache information to put into a histogram. |
| 950 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); | 950 for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator()); |
| 951 !i.IsAtEnd(); i.Advance()) | 951 !i.IsAtEnd(); i.Advance()) |
| 952 i.GetCurrentValue()->Send(new ViewMsg_GetCacheResourceStats()); | 952 i.GetCurrentValue()->Send(new ChromeViewMsg_GetCacheResourceStats()); |
| 953 } | 953 } |
| 954 | 954 |
| 955 void MetricsService::OnMemoryDetailCollectionDone() { | 955 void MetricsService::OnMemoryDetailCollectionDone() { |
| 956 DCHECK(IsSingleThreaded()); | 956 DCHECK(IsSingleThreaded()); |
| 957 // This function should only be called as the callback from an ansynchronous | 957 // This function should only be called as the callback from an ansynchronous |
| 958 // step. | 958 // step. |
| 959 DCHECK(waiting_for_asynchronus_reporting_step_); | 959 DCHECK(waiting_for_asynchronus_reporting_step_); |
| 960 | 960 |
| 961 // Right before the UMA transmission gets started, there's one more thing we'd | 961 // Right before the UMA transmission gets started, there's one more thing we'd |
| 962 // like to record: the histogram of memory usage, so we spawn a task to | 962 // like to record: the histogram of memory usage, so we spawn a task to |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 thread_id = base::PlatformThread::CurrentId(); | 1693 thread_id = base::PlatformThread::CurrentId(); |
| 1694 return base::PlatformThread::CurrentId() == thread_id; | 1694 return base::PlatformThread::CurrentId() == thread_id; |
| 1695 } | 1695 } |
| 1696 | 1696 |
| 1697 #if defined(OS_CHROMEOS) | 1697 #if defined(OS_CHROMEOS) |
| 1698 void MetricsService::StartExternalMetrics() { | 1698 void MetricsService::StartExternalMetrics() { |
| 1699 external_metrics_ = new chromeos::ExternalMetrics; | 1699 external_metrics_ = new chromeos::ExternalMetrics; |
| 1700 external_metrics_->Start(); | 1700 external_metrics_->Start(); |
| 1701 } | 1701 } |
| 1702 #endif | 1702 #endif |
| OLD | NEW |