| OLD | NEW |
| 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 | 10 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 SENDING_CURRENT_LOGS, // Sending ongoing logs as they accrue. | 251 SENDING_CURRENT_LOGS, // Sending ongoing logs as they accrue. |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 enum ShutdownCleanliness { | 254 enum ShutdownCleanliness { |
| 255 CLEANLY_SHUTDOWN = 0xdeadbeef, | 255 CLEANLY_SHUTDOWN = 0xdeadbeef, |
| 256 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN | 256 NEED_TO_SHUTDOWN = ~CLEANLY_SHUTDOWN |
| 257 }; | 257 }; |
| 258 | 258 |
| 259 typedef std::vector<SyntheticTrialGroup> SyntheticTrialGroups; | 259 typedef std::vector<SyntheticTrialGroup> SyntheticTrialGroups; |
| 260 | 260 |
| 261 // First part of the init task. Called on the FILE thread to load hardware | 261 // Callback that continues the init task by loading plugin information. |
| 262 // class information. | 262 void OnInitTaskGotHardwareClass(); |
| 263 static void InitTaskGetHardwareClass(base::WeakPtr<MetricsService> self, | |
| 264 base::MessageLoopProxy* target_loop); | |
| 265 | |
| 266 // Callback from InitTaskGetHardwareClass() that continues the init task by | |
| 267 // loading plugin information. | |
| 268 void OnInitTaskGotHardwareClass(const std::string& hardware_class); | |
| 269 | 263 |
| 270 // Called after the Plugin init task has been completed that continues the | 264 // Called after the Plugin init task has been completed that continues the |
| 271 // init task by launching a task to gather Google Update statistics. | 265 // init task by launching a task to gather Google Update statistics. |
| 272 void OnInitTaskGotPluginInfo(); | 266 void OnInitTaskGotPluginInfo(); |
| 273 | 267 |
| 274 // Called after GoogleUpdate init task has been completed that continues the | 268 // Called after GoogleUpdate init task has been completed that continues the |
| 275 // init task by loading profiler data. | 269 // init task by loading profiler data. |
| 276 void OnInitTaskGotGoogleUpdateData(); | 270 void OnInitTaskGotGoogleUpdateData(); |
| 277 | 271 |
| 278 void OnUserAction(const std::string& action); | 272 void OnUserAction(const std::string& action); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 // be cut, and logs are neither persisted nor uploaded. | 430 // be cut, and logs are neither persisted nor uploaded. |
| 437 bool test_mode_active_; | 431 bool test_mode_active_; |
| 438 | 432 |
| 439 // The progression of states made by the browser are recorded in the following | 433 // The progression of states made by the browser are recorded in the following |
| 440 // state. | 434 // state. |
| 441 State state_; | 435 State state_; |
| 442 | 436 |
| 443 // Whether the initial stability log has been recorded during startup. | 437 // Whether the initial stability log has been recorded during startup. |
| 444 bool has_initial_stability_log_; | 438 bool has_initial_stability_log_; |
| 445 | 439 |
| 446 // Chrome OS hardware class (e.g., hardware qualification ID). This | |
| 447 // class identifies the configured system components such as CPU, | |
| 448 // WiFi adapter, etc. For non Chrome OS hosts, this will be an | |
| 449 // empty string. | |
| 450 std::string hardware_class_; | |
| 451 | |
| 452 #if defined(ENABLE_PLUGINS) | 440 #if defined(ENABLE_PLUGINS) |
| 453 PluginMetricsProvider* plugin_metrics_provider_; | 441 PluginMetricsProvider* plugin_metrics_provider_; |
| 454 #endif | 442 #endif |
| 455 | 443 |
| 456 #if defined(OS_WIN) | 444 #if defined(OS_WIN) |
| 457 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; | 445 GoogleUpdateMetricsProviderWin* google_update_metrics_provider_; |
| 458 #endif | 446 #endif |
| 459 | 447 |
| 460 // The initial metrics log, used to record startup metrics (histograms and | 448 // The initial metrics log, used to record startup metrics (histograms and |
| 461 // profiler data). Note that if a crash occurred in the previous session, an | 449 // profiler data). Note that if a crash occurred in the previous session, an |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess); | 508 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, IsPluginProcess); |
| 521 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, MetricsServiceObserver); | 509 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, MetricsServiceObserver); |
| 522 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, | 510 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, |
| 523 PermutedEntropyCacheClearedWhenLowEntropyReset); | 511 PermutedEntropyCacheClearedWhenLowEntropyReset); |
| 524 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); | 512 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, RegisterSyntheticTrial); |
| 525 | 513 |
| 526 DISALLOW_COPY_AND_ASSIGN(MetricsService); | 514 DISALLOW_COPY_AND_ASSIGN(MetricsService); |
| 527 }; | 515 }; |
| 528 | 516 |
| 529 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 517 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |