Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1883)

Unified Diff: chrome/browser/metrics/metrics_service.h

Issue 10830318: Use a different algorithm with the low entropy source for field trials. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main_unittest.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_service.h
===================================================================
--- chrome/browser/metrics/metrics_service.h (revision 152812)
+++ chrome/browser/metrics/metrics_service.h (working copy)
@@ -16,6 +16,7 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/metrics/field_trial.h"
#include "base/process_util.h"
#include "chrome/browser/metrics/metrics_log.h"
#include "chrome/browser/metrics/tracking_synchronizer_observer.h"
@@ -86,16 +87,21 @@
// recording is not currently running.
std::string GetClientId();
- // Returns the preferred entropy source used to seed persistent activities
- // based on whether or not metrics reporting will permitted on this client.
+ // Returns the preferred entropy provider used to seed persistent activities
+ // based on whether or not metrics reporting will be permitted on this client.
// The caller must determine if metrics reporting will be enabled for this
- // client and pass that state in as |reporting_will_be_enabled|. If
- // |reporting_will_be_enabled| is true, this method returns the client ID
- // concatenated with the low entropy source. Otherwise, this method just
- // returns the low entropy source. Note that this reporting state can not be
- // checked by reporting_active() because this method may need to be called
- // before the MetricsService needs to be started.
- std::string GetEntropySource(bool reporting_will_be_enabled);
+ // client and pass that state in as |reporting_will_be_enabled|.
+ //
+ // If |reporting_will_be_enabled| is true, this method returns an entropy
+ // provider that has a high source of entropy, partially based on the client
+ // ID. Otherwise, an entropy provider that is based on a low entropy source
+ // is returned.
+ //
+ // Note that this reporting state can not be checked by reporting_active()
+ // because this method may need to be called before the MetricsService needs
+ // to be started.
+ scoped_ptr<const base::FieldTrial::EntropyProvider> CreateEntropyProvider(
+ bool reporting_will_be_enabled);
// Force the client ID to be generated. This is useful in case it's needed
// before recording.
« no previous file with comments | « chrome/browser/chrome_browser_main_unittest.cc ('k') | chrome/browser/metrics/metrics_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698