Commit 5fbffb7f authored by stevet@chromium.org's avatar stevet@chromium.org

Record the first recorded entropy source instead of the last.

BUG=None
TEST=No user-visible changes.


Review URL: https://chromiumcodereview.appspot.com/10832371

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152212 0039d316-1c4b-4281-b951-d872f2087c98
parent b554a6ad
...@@ -549,10 +549,14 @@ std::string MetricsService::GetEntropySource(bool reporting_will_be_enabled) { ...@@ -549,10 +549,14 @@ std::string MetricsService::GetEntropySource(bool reporting_will_be_enabled) {
// 2) It makes the final entropy source resettable. // 2) It makes the final entropy source resettable.
std::string low_entropy_source = base::IntToString(GetLowEntropySource()); std::string low_entropy_source = base::IntToString(GetLowEntropySource());
if (reporting_will_be_enabled) { if (reporting_will_be_enabled) {
entropy_source_returned_ = LAST_ENTROPY_HIGH; if (entropy_source_returned_ == LAST_ENTROPY_NONE)
entropy_source_returned_ = LAST_ENTROPY_HIGH;
DCHECK_EQ(LAST_ENTROPY_HIGH, entropy_source_returned_);
return client_id_ + low_entropy_source; return client_id_ + low_entropy_source;
} }
entropy_source_returned_ = LAST_ENTROPY_LOW; if (entropy_source_returned_ == LAST_ENTROPY_NONE)
entropy_source_returned_ = LAST_ENTROPY_LOW;
DCHECK_EQ(LAST_ENTROPY_LOW, entropy_source_returned_);
return low_entropy_source; return low_entropy_source;
} }
......
...@@ -227,7 +227,7 @@ class MetricsService ...@@ -227,7 +227,7 @@ class MetricsService
// generate the entropy source value if it has not been called before. // generate the entropy source value if it has not been called before.
int GetLowEntropySource(); int GetLowEntropySource();
// Returns the last entropy source that was returned by this service since // Returns the first entropy source that was returned by this service since
// start up, or NONE if neither was returned yet. This is exposed for testing // start up, or NONE if neither was returned yet. This is exposed for testing
// only. // only.
EntropySourceReturned entropy_source_returned() const { EntropySourceReturned entropy_source_returned() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment