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 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 // Schedules a task on the file thread for execution of slower | 827 // Schedules a task on the file thread for execution of slower |
828 // initialization steps (such as plugin list generation) necessary | 828 // initialization steps (such as plugin list generation) necessary |
829 // for sending the initial log. This avoids blocking the main UI | 829 // for sending the initial log. This avoids blocking the main UI |
830 // thread. | 830 // thread. |
831 BrowserThread::PostDelayedTask( | 831 BrowserThread::PostDelayedTask( |
832 BrowserThread::FILE, | 832 BrowserThread::FILE, |
833 FROM_HERE, | 833 FROM_HERE, |
834 base::Bind(&MetricsService::InitTaskGetHardwareClass, | 834 base::Bind(&MetricsService::InitTaskGetHardwareClass, |
835 self_ptr_factory_.GetWeakPtr(), | 835 self_ptr_factory_.GetWeakPtr(), |
836 MessageLoop::current()->message_loop_proxy()), | 836 MessageLoop::current()->message_loop_proxy()), |
837 kInitializationDelaySeconds); | 837 base::TimeDelta::FromSeconds(kInitializationDelaySeconds)); |
838 } | 838 } |
839 } | 839 } |
840 | 840 |
841 void MetricsService::StopRecording() { | 841 void MetricsService::StopRecording() { |
842 if (!log_manager_.current_log()) | 842 if (!log_manager_.current_log()) |
843 return; | 843 return; |
844 | 844 |
845 // TODO(jar): Integrate bounds on log recording more consistently, so that we | 845 // TODO(jar): Integrate bounds on log recording more consistently, so that we |
846 // can stop recording logs that are too big much sooner. | 846 // can stop recording logs that are too big much sooner. |
847 if (log_manager_.current_log()->num_events() > kEventLimit) { | 847 if (log_manager_.current_log()->num_events() > kEventLimit) { |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 if (local_state) { | 1658 if (local_state) { |
1659 const PrefService::Preference* uma_pref = | 1659 const PrefService::Preference* uma_pref = |
1660 local_state->FindPreference(prefs::kMetricsReportingEnabled); | 1660 local_state->FindPreference(prefs::kMetricsReportingEnabled); |
1661 if (uma_pref) { | 1661 if (uma_pref) { |
1662 bool success = uma_pref->GetValue()->GetAsBoolean(&result); | 1662 bool success = uma_pref->GetValue()->GetAsBoolean(&result); |
1663 DCHECK(success); | 1663 DCHECK(success); |
1664 } | 1664 } |
1665 } | 1665 } |
1666 return result; | 1666 return result; |
1667 } | 1667 } |
OLD | NEW |