diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 03:49:05 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-20 03:49:05 +0000 |
commit | 4646f29cf92e2b3cd70158067d11431ae9351bcf (patch) | |
tree | d21b85657ca5d59e5383d84ea9d602a943942908 /base/field_trial.h | |
parent | a199e400093448023d4f6c555f32d230b3fb2fcd (diff) | |
download | chromium_src-4646f29cf92e2b3cd70158067d11431ae9351bcf.zip chromium_src-4646f29cf92e2b3cd70158067d11431ae9351bcf.tar.gz chromium_src-4646f29cf92e2b3cd70158067d11431ae9351bcf.tar.bz2 |
Facilitate a FieldTrial in the renderer
I added a command line for the renderer that accepts a FieldTrial
name and value, and forces that value to be activated in the
renderer. As a result, any FieldTrial setting that is specified
by the browser process can be set (forced) in the renderer
process. Such settings can then be used to establish names
of histograms, which means all processes can work in sync
on a single field trial (and generate data). This should
allow A/B tests to be run that modulate the page load times.
Dave: Please review/confirm that you are happy with the changes to
render_view.cc. Note that all I did was change the names and limits
for the histograms (they now go up to 3 minutes). The MakeName()
allows me to get an A/B test of the impact of DNS pre-resolution.
Mike: Please review the code for passing along switch settings.
r=davemoore,mbelshe
Review URL: http://codereview.chromium.org/115525
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16460 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/field_trial.h')
-rw-r--r-- | base/field_trial.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/base/field_trial.h b/base/field_trial.h index 4d04d30..83cbcf6 100644 --- a/base/field_trial.h +++ b/base/field_trial.h @@ -75,6 +75,11 @@ class FieldTrial : public base::RefCounted<FieldTrial> { public: static const int kNotParticipating; + // Define a separator charactor to use when creating a persistent form of an + // instance. This is intended for use as a command line argument, passed to a + // second process to mimic our state (i.e., provide the same group name). + static const char kPersistentStringSeparator; // Currently a slash. + typedef int Probability; // Use scaled up probability. // The name is used to register the instance with the FieldTrialList class, @@ -107,6 +112,18 @@ class FieldTrial : public base::RefCounted<FieldTrial> { static std::string MakeName(const std::string& name_prefix, const std::string& trial_name); + // Create a persistent representation of the instance that could be resurected + // in another process. This allows randomization to be done in one process, + // and secondary processes can by synchronized on the result. + // The resulting string contains only the name, the trial name, and a "/" + // separator. + std::string MakePersistentString() const; + + // Using a string created by MakePersistentString(), construct a new instance + // that has the same state as the original instance. Currently only the + // group_name_ and name_ are restored. + static FieldTrial* RestorePersistentString(const std::string &persistent); + private: // The name of the field trial, as can be found via the FieldTrialList. // This is empty of the trial is not in the experiment. |