| 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 COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ | 5 #ifndef COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ |
| 6 #define COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ | 6 #define COMPONENTS_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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // Loads the client info via |load_client_info_| and potentially migrates it | 111 // Loads the client info via |load_client_info_| and potentially migrates it |
| 112 // before returning it if it comes back in its old form. | 112 // before returning it if it comes back in its old form. |
| 113 scoped_ptr<ClientInfo> LoadClientInfoAndMaybeMigrate(); | 113 scoped_ptr<ClientInfo> LoadClientInfoAndMaybeMigrate(); |
| 114 | 114 |
| 115 // Returns the low entropy source for this client. This is a random value | 115 // Returns the low entropy source for this client. This is a random value |
| 116 // that is non-identifying amongst browser clients. This method will | 116 // that is non-identifying amongst browser clients. This method will |
| 117 // generate the entropy source value if it has not been called before. | 117 // generate the entropy source value if it has not been called before. |
| 118 int GetLowEntropySource(); | 118 int GetLowEntropySource(); |
| 119 | 119 |
| 120 // Generates the low entropy source value for this client if it is not |
| 121 // already set. |
| 122 void UpdateLowEntropySource(); |
| 123 |
| 120 // Updates |entropy_source_returned_| with |type| iff the current value is | 124 // Updates |entropy_source_returned_| with |type| iff the current value is |
| 121 // ENTROPY_SOURCE_NONE and logs the new value in a histogram. | 125 // ENTROPY_SOURCE_NONE and logs the new value in a histogram. |
| 122 void UpdateEntropySourceReturnedValue(EntropySourceType type); | 126 void UpdateEntropySourceReturnedValue(EntropySourceType type); |
| 123 | 127 |
| 124 // Returns the first entropy source that was returned by this service since | 128 // Returns the first entropy source that was returned by this service since |
| 125 // start up, or NONE if neither was returned yet. This is exposed for testing | 129 // start up, or NONE if neither was returned yet. This is exposed for testing |
| 126 // only. | 130 // only. |
| 127 EntropySourceType entropy_source_returned() const { | 131 EntropySourceType entropy_source_returned() const { |
| 128 return entropy_source_returned_; | 132 return entropy_source_returned_; |
| 129 } | 133 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 EntropySourceType entropy_source_returned_; | 165 EntropySourceType entropy_source_returned_; |
| 162 | 166 |
| 163 scoped_ptr<ClonedInstallDetector> cloned_install_detector_; | 167 scoped_ptr<ClonedInstallDetector> cloned_install_detector_; |
| 164 | 168 |
| 165 DISALLOW_COPY_AND_ASSIGN(MetricsStateManager); | 169 DISALLOW_COPY_AND_ASSIGN(MetricsStateManager); |
| 166 }; | 170 }; |
| 167 | 171 |
| 168 } // namespace metrics | 172 } // namespace metrics |
| 169 | 173 |
| 170 #endif // COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ | 174 #endif // COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ |
| OLD | NEW |