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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2049363003: Adds support for headless chrome embedder mojo services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes for Sami Created 4 years, 6 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/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 3cb989d5ae28b7f4c3b76487cb4f909bf0237559..cd9c3434a0442222adf38463a0df6e9daf169e8f 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5900,11 +5900,14 @@ void RenderFrameImpl::SendUpdateState() {
void RenderFrameImpl::MaybeEnableMojoBindings() {
int enabled_bindings = RenderProcess::current()->GetEnabledBindings();
- // BINDINGS_POLICY_WEB_UI and BINDINGS_POLICY_MOJO are mutually exclusive.
- // They both provide access to Mojo bindings, but do so in incompatible ways.
- const int kMojoAndWebUiBindings =
- BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO;
- DCHECK_NE(enabled_bindings & kMojoAndWebUiBindings, kMojoAndWebUiBindings);
+ // BINDINGS_POLICY_WEB_UI, BINDINGS_POLICY_MOJO and BINDINGS_POLICY_HEADLESS
+ // are mutually exclusive. They provide access to Mojo bindings, but do so in
+ // incompatible ways.
+ const int kAllBindingsTypes =
+ BINDINGS_POLICY_WEB_UI | BINDINGS_POLICY_MOJO | BINDINGS_POLICY_HEADLESS;
+ DCHECK_EQ((enabled_bindings & kAllBindingsTypes) &
+ ((enabled_bindings & kAllBindingsTypes) - 1),
Charlie Reis 2016/06/27 17:30:11 Am I misreading this? It looks like it's checking
alex clarke (OOO till 29th) 2016/07/29 09:06:23 No :)
+ 0);
// If an MojoBindingsController already exists for this RenderFrameImpl, avoid
// creating another one. It is not kept as a member, as it deletes itself when
@@ -5914,9 +5917,11 @@ void RenderFrameImpl::MaybeEnableMojoBindings() {
if (IsMainFrame() &&
enabled_bindings & BINDINGS_POLICY_WEB_UI) {
- new MojoBindingsController(this, false /* for_layout_tests */);
+ new MojoBindingsController(this, MojoBindingsType::FOR_UI_BINDINGS);
} else if (enabled_bindings & BINDINGS_POLICY_MOJO) {
- new MojoBindingsController(this, true /* for_layout_tests */);
+ new MojoBindingsController(this, MojoBindingsType::FOR_LAYOUT_TESTS);
+ } else if (enabled_bindings & BINDINGS_POLICY_HEADLESS) {
+ new MojoBindingsController(this, MojoBindingsType::FOR_HEADLESS);
}
}

Powered by Google App Engine
This is Rietveld 408576698