Chromium Code Reviews| Index: chrome/browser/metrics/metrics_service.h |
| diff --git a/chrome/browser/metrics/metrics_service.h b/chrome/browser/metrics/metrics_service.h |
| index cfe194359bad97e8d4e42b12b333f9b86a629ffe..2cfa42404ad0006ad44cd273b40c07663fad6a7f 100644 |
| --- a/chrome/browser/metrics/metrics_service.h |
| +++ b/chrome/browser/metrics/metrics_service.h |
| @@ -39,6 +39,7 @@ class TemplateURLService; |
| namespace base { |
| class DictionaryValue; |
| class MessageLoopProxy; |
| +class Time; |
| } |
| namespace content { |
| @@ -157,14 +158,22 @@ class MetricsService |
| NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN |
| }; |
| - // First part of the init task. Called on the FILE thread to load hardware |
| - // class information. |
| - static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, |
| - base::MessageLoopProxy* target_loop); |
| + // First init task, that starts retrieving the hardware class. It proceeds |
| + // to InitTaskGetPluginInfo after reading the hardware_class, or after |
| + // timing out waiting for it. |
| + void InitTaskGetHardwareClass(); |
| - // Callback from InitTaskGetHardwareClass() that continues the init task by |
| - // loading plugin information. |
| - void OnInitTaskGotHardwareClass(const std::string& hardware_class); |
| + // Callback for the StatisticsProvider to signal that hardware data has been |
| + // loaded. Retrieves the hardware class and stores it in hardware_class_. |
| + // |start_time| is a timestamp of when the initialization was first requested. |
| + void OnStatisticsProviderReady(const base::Time& start_time); |
| + |
| + // Handles a timeout while waiting for the StatisticsProvider to become ready |
| + // during initialization. |
| + void OnStatisticsProviderTimeout(); |
| + |
| + // Second init task, that starts retrieving plugin info. |
| + void InitTaskGetPluginInfo(); |
| // Callback from PluginService::GetPlugins() that continues the init task by |
| // loading profiler data. |
| @@ -412,6 +421,9 @@ class MetricsService |
| // this factory are invalidated in ScheduleNextStateSave. |
| base::WeakPtrFactory<MetricsService> state_saver_factory_; |
| + // Weak pointers factory used to post and invalidate the timeout task. |
| + base::WeakPtrFactory<MetricsService> timeout_task_factory_; |
|
Ilya Sherman
2012/04/30 07:36:41
nit: Why not just use self_ptr_factory_ here?
Joao da Silva
2012/05/15 13:52:47
Because self_ptr_factory_ is used to post other ta
|
| + |
| // Dictionary containing all the profile specific metrics. This is set |
| // at creation time from the prefs. |
| scoped_ptr<base::DictionaryValue> profile_dictionary_; |