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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 10811002: Add threaded compositing mode to field trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ilya feedback Created 8 years, 5 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 | « content/public/common/content_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « content/public/common/content_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698