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