Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: chrome/browser/metrics/metrics_service.h

Issue 10078017: Added asynchronous notification of readiness to the StatisticsProvider, and (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // This file defines a service that collects information about the user 5 // This file defines a service that collects information about the user
6 // experience in order to help improve future versions of the app. 6 // experience in order to help improve future versions of the app.
7 7
8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
10 #pragma once 10 #pragma once
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 INITIAL_LOG_READY, // Initial log generated, and waiting for reply. 145 INITIAL_LOG_READY, // Initial log generated, and waiting for reply.
146 SENDING_OLD_LOGS, // Sending unsent logs from previous session. 146 SENDING_OLD_LOGS, // Sending unsent logs from previous session.
147 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. 147 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue.
148 }; 148 };
149 149
150 enum ShutdownCleanliness { 150 enum ShutdownCleanliness {
151 CLEANLY_SHUTDOWN = 0xdeadbeef, 151 CLEANLY_SHUTDOWN = 0xdeadbeef,
152 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN 152 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN
153 }; 153 };
154 154
155 // First part of the init task. Called on the FILE thread to load hardware 155 // First part of the init task. Starts retrieving the hardware class and
156 // class information. 156 // proceeds to OnInitTaskGotHardwareClass() or waits for
157 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, 157 // OnStatisticsProviderReady().
158 base::MessageLoopProxy* target_loop); 158 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self);
159
160 #if defined(OS_CHROMEOS)
161 // Callback for the StatisticsProvider to signal that hardware data has been
162 // loaded. Retrieves the hardware class and passes it to
163 // OnInitTaskGotHardwareClass().
164 void OnStatisticsProviderReady();
jar (doing other things) 2012/04/20 00:37:39 Rather than conditionally defining a method... and
Joao da Silva 2012/04/20 11:53:35 Good points; I thought it was acceptable in this c
165 #endif
159 166
160 // Callback from InitTaskGetHardwareClass() that continues the init task by 167 // Callback from InitTaskGetHardwareClass() that continues the init task by
161 // loading plugin information. 168 // loading plugin information.
162 void OnInitTaskGotHardwareClass(const std::string& hardware_class); 169 void OnInitTaskGotHardwareClass(const std::string& hardware_class);
163 170
164 // Callback from PluginService::GetPlugins() that moves the state to 171 // Callback from PluginService::GetPlugins() that moves the state to
165 // INIT_TASK_DONE. 172 // INIT_TASK_DONE.
166 void OnInitTaskGotPluginInfo( 173 void OnInitTaskGotPluginInfo(
167 const std::vector<webkit::WebPluginInfo>& plugins); 174 const std::vector<webkit::WebPluginInfo>& plugins);
168 175
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 friend bool prerender::IsOmniboxEnabled(Profile* profile); 439 friend bool prerender::IsOmniboxEnabled(Profile* profile);
433 friend class extensions::ExtensionDownloader; 440 friend class extensions::ExtensionDownloader;
434 441
435 // Returns true if prefs::kMetricsReportingEnabled is set. 442 // Returns true if prefs::kMetricsReportingEnabled is set.
436 static bool IsMetricsReportingEnabled(); 443 static bool IsMetricsReportingEnabled();
437 444
438 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); 445 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper);
439 }; 446 };
440 447
441 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 448 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/system/statistics_provider.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698