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) {
// 2) It makes the final entropy source resettable.
std::string low_entropy_source = base::IntToString(GetLowEntropySource());
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;
}
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;
}
......
......@@ -227,7 +227,7 @@ class MetricsService
// generate the entropy source value if it has not been called before.
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
// only.
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