Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index 0cb91368ccc5c37f0bc30a9faf469f5268b5da20..28b4a58b3925aba273db3cbbec3bfebb11f1278b 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/content_constants.h" |
#include "content/public/common/content_paths.h" |
#include "content/public/common/content_switches.h" |
#include "content/public/common/renderer_preferences.h" |
@@ -492,6 +493,10 @@ 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( |
@@ -501,13 +506,15 @@ void RenderThreadImpl::EnsureWebKitInitialized() { |
// The new design can be tracked at: http://crbug.com/134492. |
bool is_guest = CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kGuestRenderer); |
- bool enable = has_enable && (!has_disable) && (!is_guest); |
+ DCHECK(!is_thread_trial || !has_disable); |
+ bool enable = (is_thread_trial || (has_enable && !has_disable)) && !is_guest; |
if (enable) { |
compositor_thread_.reset(new CompositorThread(this)); |
AddFilter(compositor_thread_->GetMessageFilter()); |
WebKit::WebCompositor::initialize(compositor_thread_->GetWebThread()); |
- } else |
+ } else { |
WebKit::WebCompositor::initialize(NULL); |
+ } |
compositor_initialized_ = true; |
WebScriptController::enableV8SingleThreadMode(); |