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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10824168: Cleaning up compositing field trial code and enable FCM in beta/stable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cleanup Created 8 years, 4 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index 3b93544dbc9bd8efccc9bd2e4549160fc561c4dd..a6ada9f7591ba6c659b3a710351b5b06773d26f1 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -171,6 +171,19 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate,
DCHECK(surface_id_);
}
+ base::FieldTrial* compositing_trial =
+ base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
+ bool is_thread_trial = compositing_trial &&
+ compositing_trial->group_name() ==
+ content::kGpuCompositingFieldTrialThreadEnabledName;
+ bool has_enable = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableThreadedCompositing);
+ bool has_disable = CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableThreadedCompositing);
+ DCHECK(!is_thread_trial || !has_disable);
+ is_threaded_compositing_enabled_ =
darin (slow to review) 2012/08/03 21:16:06 nit: place the above code into a static helper fun
+ is_thread_trial || (has_enable && !has_disable);
+
process_->Attach(this, routing_id_);
// Because the widget initializes as is_hidden_ == false,
// tell the process host that we're alive.
@@ -1898,18 +1911,7 @@ void RenderWidgetHostImpl::AcknowledgeBufferPresent(
}
void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() {
- base::FieldTrial* trial =
- base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
- bool is_thread_trial = trial && trial->group_name() ==
- content::kGpuCompositingFieldTrialThreadEnabledName;
- bool has_enable = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableThreadedCompositing);
- bool has_disable = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableThreadedCompositing);
- DCHECK(!is_thread_trial || !has_disable);
- bool enable_threaded_compositing =
- is_thread_trial || (has_enable && !has_disable);
- if (!enable_threaded_compositing)
+ if (!is_threaded_compositing_enabled_)
Send(new ViewMsg_SwapBuffers_ACK(routing_id_));
}

Powered by Google App Engine
This is Rietveld 408576698