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 is | 10 // A MetricsService instance is typically created at application startup. It is |
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 void MetricsService::OpenNewLog() { | 973 void MetricsService::OpenNewLog() { |
974 DCHECK(!log_manager_.current_log()); | 974 DCHECK(!log_manager_.current_log()); |
975 | 975 |
976 log_manager_.BeginLoggingWithLog( | 976 log_manager_.BeginLoggingWithLog( |
977 CreateLog(MetricsLog::ONGOING_LOG).PassAs<metrics::MetricsLogBase>()); | 977 CreateLog(MetricsLog::ONGOING_LOG).PassAs<metrics::MetricsLogBase>()); |
978 NotifyOnDidCreateMetricsLog(); | 978 NotifyOnDidCreateMetricsLog(); |
979 if (state_ == INITIALIZED) { | 979 if (state_ == INITIALIZED) { |
980 // We only need to schedule that run once. | 980 // We only need to schedule that run once. |
981 state_ = INIT_TASK_SCHEDULED; | 981 state_ = INIT_TASK_SCHEDULED; |
982 | 982 |
| 983 // TODO(blundell): Change the callback to be |
| 984 // FinishedReceivingProfilerData() when the initial metrics gathering is |
| 985 // moved to ChromeMetricsServiceClient. |
| 986 client_->StartGatheringMetrics(base::Bind(&base::DoNothing)); |
| 987 |
983 // Schedules a task on the file thread for execution of slower | 988 // Schedules a task on the file thread for execution of slower |
984 // initialization steps (such as plugin list generation) necessary | 989 // initialization steps (such as plugin list generation) necessary |
985 // for sending the initial log. This avoids blocking the main UI | 990 // for sending the initial log. This avoids blocking the main UI |
986 // thread. | 991 // thread. |
987 BrowserThread::PostDelayedTask( | 992 BrowserThread::PostDelayedTask( |
988 BrowserThread::FILE, | 993 BrowserThread::FILE, |
989 FROM_HERE, | 994 FROM_HERE, |
990 base::Bind(&MetricsService::InitTaskGetHardwareClass, | 995 base::Bind(&MetricsService::InitTaskGetHardwareClass, |
991 self_ptr_factory_.GetWeakPtr(), | 996 self_ptr_factory_.GetWeakPtr(), |
992 base::MessageLoop::current()->message_loop_proxy()), | 997 base::MessageLoop::current()->message_loop_proxy()), |
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1670 | 1675 |
1671 RecordPluginChanges(pref); | 1676 RecordPluginChanges(pref); |
1672 } | 1677 } |
1673 | 1678 |
1674 // static | 1679 // static |
1675 bool MetricsService::IsPluginProcess(int process_type) { | 1680 bool MetricsService::IsPluginProcess(int process_type) { |
1676 return (process_type == content::PROCESS_TYPE_PLUGIN || | 1681 return (process_type == content::PROCESS_TYPE_PLUGIN || |
1677 process_type == content::PROCESS_TYPE_PPAPI_PLUGIN || | 1682 process_type == content::PROCESS_TYPE_PPAPI_PLUGIN || |
1678 process_type == content::PROCESS_TYPE_PPAPI_BROKER); | 1683 process_type == content::PROCESS_TYPE_PPAPI_BROKER); |
1679 } | 1684 } |
OLD | NEW |