diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-30 15:11:29 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-30 15:11:29 +0000 |
commit | ebcf69f02f4f02e508e77193e51dd6557e6c0085 (patch) | |
tree | 80f883eca03bd26b3a5211f9156ff2e860c909ff /chrome/browser/gpu | |
parent | b554d462229e4498ba6576d7cd0c2336fb468175 (diff) | |
download | chromium_src-ebcf69f02f4f02e508e77193e51dd6557e6c0085.zip chromium_src-ebcf69f02f4f02e508e77193e51dd6557e6c0085.tar.gz chromium_src-ebcf69f02f4f02e508e77193e51dd6557e6c0085.tar.bz2 |
Make field trial randomization type a constructor param.
Changes the Field Trial API to require users to pass ONE_TIME_RANDOMIZED
or SESSION_RANDOMIZED at the time the field trial is created.
This removes a source of human errors, where developers would sometimes
previously forget to call UseOneTimeRandomization() in their CLs.
It's a small startup performance win, since one time randomized trials will
no longer call RandDouble() that will be then replaced by a value from the
entropy provider. (This was showing up in profiles when I was measuring
metrics startup perf on mobile.)
BUG=262971
TEST=Existing unit tests.
TBR=isherman@chromium.org, thakis@chromium.org
Review URL: https://codereview.chromium.org/20777005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214352 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gpu')
-rw-r--r-- | chrome/browser/gpu/chrome_gpu_util.cc | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/chrome/browser/gpu/chrome_gpu_util.cc b/chrome/browser/gpu/chrome_gpu_util.cc index 441cebc..61da773 100644 --- a/chrome/browser/gpu/chrome_gpu_util.cc +++ b/chrome/browser/gpu/chrome_gpu_util.cc @@ -99,11 +99,8 @@ void InitializeCompositingFieldTrial() { const base::FieldTrial::Probability kDivisor = 3; scoped_refptr<base::FieldTrial> trial( base::FieldTrialList::FactoryGetFieldTrial( - content::kGpuCompositingFieldTrialName, kDivisor, - "disable", 2013, 12, 31, NULL)); - - // Produce the same result on every run of this client. - trial->UseOneTimeRandomization(); + content::kGpuCompositingFieldTrialName, kDivisor, "disable", + 2013, 12, 31, base::FieldTrial::ONE_TIME_RANDOMIZED, NULL)); base::FieldTrial::Probability force_compositing_mode_probability = 0; base::FieldTrial::Probability threaded_compositing_probability = 0; @@ -131,5 +128,5 @@ void InitializeCompositingFieldTrial() { UMA_HISTOGRAM_BOOLEAN("GPU.InCompositorThreadFieldTrial", thread); } -} // namespace gpu_util; +} // namespace gpu_util |