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

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: Don't use base::Unretained. Rebased. 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 // Callback for the StatisticsProvider to signal that hardware data has been
156 // class information. 156 // loaded. Retrieves the hardware class and stores it in hardware_class_.
157 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, 157 void OnStatisticsProviderReady();
158 base::MessageLoopProxy* target_loop);
159 158
160 // Callback from InitTaskGetHardwareClass() that continues the init task by 159 // First part of the init task that starts loading plugin info asynchronously.
161 // loading plugin information. 160 void InitTaskGetPluginInfo();
162 void OnInitTaskGotHardwareClass(const std::string& hardware_class);
163 161
164 // Callback from PluginService::GetPlugins() that moves the state to 162 // Callback from PluginService::GetPlugins() that moves the state to
165 // INIT_TASK_DONE. 163 // INIT_TASK_DONE.
166 void OnInitTaskGotPluginInfo( 164 void OnInitTaskGotPluginInfo(
167 const std::vector<webkit::WebPluginInfo>& plugins); 165 const std::vector<webkit::WebPluginInfo>& plugins);
168 166
169 // When we start a new version of Chromium (different from our last run), we 167 // When we start a new version of Chromium (different from our last run), we
170 // need to discard the old crash stats so that we don't attribute crashes etc. 168 // need to discard the old crash stats so that we don't attribute crashes etc.
171 // in the old version to the current version (via current logs). 169 // in the old version to the current version (via current logs).
172 // Without this, a common reason to finally start a new version is to crash 170 // Without this, a common reason to finally start a new version is to crash
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 friend bool prerender::IsOmniboxEnabled(Profile* profile); 430 friend bool prerender::IsOmniboxEnabled(Profile* profile);
433 friend class extensions::ExtensionDownloader; 431 friend class extensions::ExtensionDownloader;
434 432
435 // Returns true if prefs::kMetricsReportingEnabled is set. 433 // Returns true if prefs::kMetricsReportingEnabled is set.
436 static bool IsMetricsReportingEnabled(); 434 static bool IsMetricsReportingEnabled();
437 435
438 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); 436 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper);
439 }; 437 };
440 438
441 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 439 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698