| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_METRICS_METRICS_STATE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_METRICS_STATE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_METRICS_METRICS_STATE_MANAGER_H_ | 6 #define CHROME_BROWSER_METRICS_METRICS_STATE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // not opted in to metrics reporting. | 35 // not opted in to metrics reporting. |
| 36 const std::string& client_id() const { return client_id_; } | 36 const std::string& client_id() const { return client_id_; } |
| 37 | 37 |
| 38 // Forces the client ID to be generated. This is useful in case it's needed | 38 // Forces the client ID to be generated. This is useful in case it's needed |
| 39 // before recording. | 39 // before recording. |
| 40 void ForceClientIdCreation(); | 40 void ForceClientIdCreation(); |
| 41 | 41 |
| 42 // Checks if this install was cloned or imaged from another machine. If a | 42 // Checks if this install was cloned or imaged from another machine. If a |
| 43 // clone is detected, resets the client id and low entropy source. This | 43 // clone is detected, resets the client id and low entropy source. This |
| 44 // should not be called more than once. | 44 // should not be called more than once. |
| 45 void CheckForClonedInstall(); | 45 void CheckForClonedInstall( |
| 46 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 46 | 47 |
| 47 // Returns the preferred entropy provider used to seed persistent activities | 48 // Returns the preferred entropy provider used to seed persistent activities |
| 48 // based on whether or not metrics reporting is permitted on this client. | 49 // based on whether or not metrics reporting is permitted on this client. |
| 49 // | 50 // |
| 50 // If metrics reporting is enabled, this method returns an entropy provider | 51 // If metrics reporting is enabled, this method returns an entropy provider |
| 51 // that has a high source of entropy, partially based on the client ID. | 52 // that has a high source of entropy, partially based on the client ID. |
| 52 // Otherwise, it returns an entropy provider that is based on a low entropy | 53 // Otherwise, it returns an entropy provider that is based on a low entropy |
| 53 // source. | 54 // source. |
| 54 scoped_ptr<const base::FieldTrial::EntropyProvider> CreateEntropyProvider(); | 55 scoped_ptr<const base::FieldTrial::EntropyProvider> CreateEntropyProvider(); |
| 55 | 56 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 EntropySourceType entropy_source_returned_; | 116 EntropySourceType entropy_source_returned_; |
| 116 | 117 |
| 117 scoped_ptr<ClonedInstallDetector> cloned_install_detector_; | 118 scoped_ptr<ClonedInstallDetector> cloned_install_detector_; |
| 118 | 119 |
| 119 DISALLOW_COPY_AND_ASSIGN(MetricsStateManager); | 120 DISALLOW_COPY_AND_ASSIGN(MetricsStateManager); |
| 120 }; | 121 }; |
| 121 | 122 |
| 122 } // namespace metrics | 123 } // namespace metrics |
| 123 | 124 |
| 124 #endif // CHROME_BROWSER_METRICS_METRICS_STATE_MANAGER_H_ | 125 #endif // CHROME_BROWSER_METRICS_METRICS_STATE_MANAGER_H_ |
| OLD | NEW |