Chromium Code Reviews| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 361 // Get the amount of uptime since this process started and since the last | 361 // Get the amount of uptime since this process started and since the last |
| 362 // call to this function. Also updates the cumulative uptime metric (stored | 362 // call to this function. Also updates the cumulative uptime metric (stored |
| 363 // as a pref) for uninstall. Uptimes are measured using TimeTicks, which | 363 // as a pref) for uninstall. Uptimes are measured using TimeTicks, which |
| 364 // guarantees that it is monotonic and does not jump if the user changes | 364 // guarantees that it is monotonic and does not jump if the user changes |
| 365 // his/her clock. The TimeTicks implementation also makes the clock not | 365 // his/her clock. The TimeTicks implementation also makes the clock not |
| 366 // count time the computer is suspended. | 366 // count time the computer is suspended. |
| 367 void GetUptimes(PrefService* pref, | 367 void GetUptimes(PrefService* pref, |
| 368 base::TimeDelta* incremental_uptime, | 368 base::TimeDelta* incremental_uptime, |
| 369 base::TimeDelta* uptime); | 369 base::TimeDelta* uptime); |
| 370 | 370 |
| 371 // Reset the client id and low entropy source if the kMetricsResetMetricIDs | |
| 372 // pref is true. | |
| 373 void ResetMetricsIDsIfNecessary(); | |
| 374 | |
| 371 // Returns the low entropy source for this client. This is a random value | 375 // Returns the low entropy source for this client. This is a random value |
| 372 // that is non-identifying amongst browser clients. This method will | 376 // that is non-identifying amongst browser clients. This method will |
| 373 // generate the entropy source value if it has not been called before. | 377 // generate the entropy source value if it has not been called before. |
| 374 int GetLowEntropySource(); | 378 int GetLowEntropySource(); |
| 375 | 379 |
| 376 // Returns the first entropy source that was returned by this service since | 380 // Returns the first entropy source that was returned by this service since |
| 377 // start up, or NONE if neither was returned yet. This is exposed for testing | 381 // start up, or NONE if neither was returned yet. This is exposed for testing |
| 378 // only. | 382 // only. |
| 379 EntropySourceReturned entropy_source_returned() const { | 383 EntropySourceReturned entropy_source_returned() const { |
| 380 return entropy_source_returned_; | 384 return entropy_source_returned_; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 | 520 |
| 517 // Returns a list of synthetic field trials that were active for the entire | 521 // Returns a list of synthetic field trials that were active for the entire |
| 518 // duration of the current log. | 522 // duration of the current log. |
| 519 void GetCurrentSyntheticFieldTrials( | 523 void GetCurrentSyntheticFieldTrials( |
| 520 std::vector<chrome_variations::ActiveGroupId>* synthetic_trials); | 524 std::vector<chrome_variations::ActiveGroupId>* synthetic_trials); |
| 521 | 525 |
| 522 base::ActionCallback action_callback_; | 526 base::ActionCallback action_callback_; |
| 523 | 527 |
| 524 content::NotificationRegistrar registrar_; | 528 content::NotificationRegistrar registrar_; |
| 525 | 529 |
| 530 bool metrics_ids_reset_; | |
|
Alexei Svitkine (slow)
2014/03/28 17:20:26
Nit: I'd name it metrics_ids_reset_check_performed
jwd
2014/03/28 18:59:21
Done.
| |
| 531 | |
| 526 // Indicate whether recording and reporting are currently happening. | 532 // Indicate whether recording and reporting are currently happening. |
| 527 // These should not be set directly, but by calling SetRecording and | 533 // These should not be set directly, but by calling SetRecording and |
| 528 // SetReporting. | 534 // SetReporting. |
| 529 bool recording_active_; | 535 bool recording_active_; |
| 530 bool reporting_active_; | 536 bool reporting_active_; |
| 531 | 537 |
| 532 // Indicate whether test mode is enabled, where the initial log should never | 538 // Indicate whether test mode is enabled, where the initial log should never |
| 533 // be cut, and logs are neither persisted nor uploaded. | 539 // be cut, and logs are neither persisted nor uploaded. |
| 534 bool test_mode_active_; | 540 bool test_mode_active_; |
| 535 | 541 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 668 | 674 |
| 669 // Returns true if crash reporting is enabled. This is set at the platform | 675 // Returns true if crash reporting is enabled. This is set at the platform |
| 670 // level for Android and ChromeOS, and otherwise is the same as | 676 // level for Android and ChromeOS, and otherwise is the same as |
| 671 // IsMetricsReportingEnabled for desktop Chrome. | 677 // IsMetricsReportingEnabled for desktop Chrome. |
| 672 static bool IsCrashReportingEnabled(); | 678 static bool IsCrashReportingEnabled(); |
| 673 | 679 |
| 674 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); | 680 DISALLOW_IMPLICIT_CONSTRUCTORS(MetricsServiceHelper); |
| 675 }; | 681 }; |
| 676 | 682 |
| 677 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ | 683 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ |
| OLD | NEW |