OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
905 | 905 |
906 // Right before the UMA transmission gets started, there's one more thing we'd | 906 // Right before the UMA transmission gets started, there's one more thing we'd |
907 // like to record: the histogram of memory usage, so we spawn a task to | 907 // like to record: the histogram of memory usage, so we spawn a task to |
908 // collect the memory details and when that task is finished, it will call | 908 // collect the memory details and when that task is finished, it will call |
909 // OnMemoryDetailCollectionDone, which will call HistogramSynchronization to | 909 // OnMemoryDetailCollectionDone, which will call HistogramSynchronization to |
910 // collect histograms from all renderers and then we will call | 910 // collect histograms from all renderers and then we will call |
911 // OnHistogramSynchronizationDone to continue processing. | 911 // OnHistogramSynchronizationDone to continue processing. |
912 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 912 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
913 log_sender_factory_. | 913 log_sender_factory_. |
914 NewRunnableMethod(&MetricsService::LogTransmissionTimerDone), | 914 NewRunnableMethod(&MetricsService::LogTransmissionTimerDone), |
915 static_cast<int>(interlog_duration_.InMilliseconds())); | 915 interlog_duration_.InMilliseconds()); |
916 } | 916 } |
917 | 917 |
918 void MetricsService::LogTransmissionTimerDone() { | 918 void MetricsService::LogTransmissionTimerDone() { |
919 Task* task = log_sender_factory_. | 919 Task* task = log_sender_factory_. |
920 NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); | 920 NewRunnableMethod(&MetricsService::OnMemoryDetailCollectionDone); |
921 | 921 |
922 MetricsMemoryDetails* details = new MetricsMemoryDetails(task); | 922 MetricsMemoryDetails* details = new MetricsMemoryDetails(task); |
923 details->StartFetch(); | 923 details->StartFetch(); |
924 | 924 |
925 // Collect WebCore cache information to put into a histogram. | 925 // Collect WebCore cache information to put into a histogram. |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 L"." + key; | 1897 L"." + key; |
1898 prof_prefs->SetInteger(pref_key.c_str(), value); | 1898 prof_prefs->SetInteger(pref_key.c_str(), value); |
1899 } | 1899 } |
1900 | 1900 |
1901 static bool IsSingleThreaded() { | 1901 static bool IsSingleThreaded() { |
1902 static PlatformThreadId thread_id = 0; | 1902 static PlatformThreadId thread_id = 0; |
1903 if (!thread_id) | 1903 if (!thread_id) |
1904 thread_id = PlatformThread::CurrentId(); | 1904 thread_id = PlatformThread::CurrentId(); |
1905 return PlatformThread::CurrentId() == thread_id; | 1905 return PlatformThread::CurrentId() == thread_id; |
1906 } | 1906 } |
OLD | NEW |