OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 15 matching lines...) Loading... |
26 #endif | 26 #endif |
27 | 27 |
28 class BookmarkModel; | 28 class BookmarkModel; |
29 class BookmarkNode; | 29 class BookmarkNode; |
30 class DictionaryValue; | 30 class DictionaryValue; |
31 class ListValue; | 31 class ListValue; |
32 class HistogramSynchronizer; | 32 class HistogramSynchronizer; |
33 class MetricsLogBase; | 33 class MetricsLogBase; |
34 class PrefService; | 34 class PrefService; |
35 class TemplateURLModel; | 35 class TemplateURLModel; |
36 | |
37 namespace webkit { | |
38 namespace npapi { | |
39 struct WebPluginInfo; | 36 struct WebPluginInfo; |
40 } | |
41 } | |
42 | 37 |
43 // Forward declaration of the xmlNode to avoid having tons of gyp files | 38 // Forward declaration of the xmlNode to avoid having tons of gyp files |
44 // needing to depend on the libxml third party lib. | 39 // needing to depend on the libxml third party lib. |
45 struct _xmlNode; | 40 struct _xmlNode; |
46 typedef struct _xmlNode xmlNode; | 41 typedef struct _xmlNode xmlNode; |
47 typedef xmlNode* xmlNodePtr; | 42 typedef xmlNode* xmlNodePtr; |
48 | 43 |
49 | 44 |
50 class MetricsService : public NotificationObserver, | 45 class MetricsService : public NotificationObserver, |
51 public URLFetcher::Delegate, | 46 public URLFetcher::Delegate, |
(...skipping 101 matching lines...) Loading... |
153 SENDING_OLD_LOGS, // Sending unsent logs from previous session. | 148 SENDING_OLD_LOGS, // Sending unsent logs from previous session. |
154 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. | 149 SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. |
155 }; | 150 }; |
156 | 151 |
157 class InitTask; | 152 class InitTask; |
158 class InitTaskComplete; | 153 class InitTaskComplete; |
159 | 154 |
160 // Callback to let us know that the init task is done. | 155 // Callback to let us know that the init task is done. |
161 void OnInitTaskComplete( | 156 void OnInitTaskComplete( |
162 const std::string& hardware_class, | 157 const std::string& hardware_class, |
163 const std::vector<webkit::npapi::WebPluginInfo>& plugins); | 158 const std::vector<WebPluginInfo>& plugins); |
164 | 159 |
165 // When we start a new version of Chromium (different from our last run), we | 160 // When we start a new version of Chromium (different from our last run), we |
166 // need to discard the old crash stats so that we don't attribute crashes etc. | 161 // need to discard the old crash stats so that we don't attribute crashes etc. |
167 // in the old version to the current version (via current logs). | 162 // in the old version to the current version (via current logs). |
168 // Without this, a common reason to finally start a new version is to crash | 163 // Without this, a common reason to finally start a new version is to crash |
169 // the old version (after an autoupdate has arrived), and so we'd bias | 164 // the old version (after an autoupdate has arrived), and so we'd bias |
170 // initial results towards showing crashes :-(. | 165 // initial results towards showing crashes :-(. |
171 static void DiscardOldStabilityStats(PrefService* local_state); | 166 static void DiscardOldStabilityStats(PrefService* local_state); |
172 | 167 |
173 // Sets and gets whether metrics recording is active. | 168 // Sets and gets whether metrics recording is active. |
(...skipping 242 matching lines...) Loading... |
416 // state. | 411 // state. |
417 State state_; | 412 State state_; |
418 | 413 |
419 // Chrome OS hardware class (e.g., hardware qualification ID). This | 414 // Chrome OS hardware class (e.g., hardware qualification ID). This |
420 // class identifies the configured system components such as CPU, | 415 // class identifies the configured system components such as CPU, |
421 // WiFi adapter, etc. For non Chrome OS hosts, this will be an | 416 // WiFi adapter, etc. For non Chrome OS hosts, this will be an |
422 // empty string. | 417 // empty string. |
423 std::string hardware_class_; | 418 std::string hardware_class_; |
424 | 419 |
425 // The list of plugins which was retrieved on the file thread. | 420 // The list of plugins which was retrieved on the file thread. |
426 std::vector<webkit::npapi::WebPluginInfo> plugins_; | 421 std::vector<WebPluginInfo> plugins_; |
427 | 422 |
428 // The outstanding transmission appears as a URL Fetch operation. | 423 // The outstanding transmission appears as a URL Fetch operation. |
429 scoped_ptr<URLFetcher> current_fetch_; | 424 scoped_ptr<URLFetcher> current_fetch_; |
430 | 425 |
431 // The URL for the metrics server. | 426 // The URL for the metrics server. |
432 std::wstring server_url_; | 427 std::wstring server_url_; |
433 | 428 |
434 // The identifier that's sent to the server with the log reports. | 429 // The identifier that's sent to the server with the log reports. |
435 std::string client_id_; | 430 std::string client_id_; |
436 | 431 |
(...skipping 60 matching lines...) Loading... |
497 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); | 492 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); |
498 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); | 493 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); |
499 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); | 494 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); |
500 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); | 495 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); |
501 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); | 496 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); |
502 | 497 |
503 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 498 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
504 }; | 499 }; |
505 | 500 |
506 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 501 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
OLD | NEW |