diff options
author | vangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-07 16:38:56 +0000 |
---|---|---|
committer | vangelis@chromium.org <vangelis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-07 16:38:56 +0000 |
commit | b7c4f0378030eaacfc3a52218517d9340137ca59 (patch) | |
tree | cf15f0608a2aab97645ca4ec06c7ecba19bef128 /content/renderer | |
parent | 8677b19f1ab9262c43949ca038690d5943e19fe3 (diff) | |
download | chromium_src-b7c4f0378030eaacfc3a52218517d9340137ca59.zip chromium_src-b7c4f0378030eaacfc3a52218517d9340137ca59.tar.gz chromium_src-b7c4f0378030eaacfc3a52218517d9340137ca59.tar.bz2 |
Cleaned up compositing mode field trial code by:
1. Move the code that checks whether FCM and/or ThreadedCompositing is enabled to a separate file (compositor_utils) that can be accessed from all the spots that need the info.
2. Cache results results for checks so that we don't have to check them every frame (string compares were actually showing up in profile results)
3. Some cosmetic changes to variable names to keep them consistent.
4. Re-arranged to code that decides what trials run in which channels.
This CL also enables FCM on beta/stable by default but keeps the previous 1/3 experiment running on the other channels.
BUG=
Review URL: https://chromiumcodereview.appspot.com/10824168
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
-rw-r--r-- | content/renderer/render_thread_impl.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 0be789f..59af873 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -40,6 +40,7 @@ #include "content/common/resource_messages.h" #include "content/common/view_messages.h" #include "content/common/web_database_observer_impl.h" +#include "content/public/common/compositor_util.h" #include "content/public/common/content_constants.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" @@ -492,21 +493,12 @@ void RenderThreadImpl::EnsureWebKitInitialized() { webkit_platform_support_.reset(new RendererWebKitPlatformSupportImpl); WebKit::initialize(webkit_platform_support_.get()); - base::FieldTrial* thread_trial = - base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName); - bool is_thread_trial = thread_trial && thread_trial->group_name() == - content::kGpuCompositingFieldTrialThreadEnabledName; - bool has_enable = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableThreadedCompositing); - bool has_disable = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableThreadedCompositing); // TODO(fsamuel): Guests don't currently support threaded compositing. // This should go away with the new design of the browser plugin. // The new design can be tracked at: http://crbug.com/134492. bool is_guest = CommandLine::ForCurrentProcess()->HasSwitch( switches::kGuestRenderer); - DCHECK(!is_thread_trial || !has_disable); - bool enable = (is_thread_trial || (has_enable && !has_disable)) && !is_guest; + bool enable = content::IsThreadedCompositingEnabled() && !is_guest; if (enable) { compositor_thread_.reset(new CompositorThread(this)); AddFilter(compositor_thread_->GetMessageFilter()); |