| 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),
|
| + 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);
|
| }
|
| }
|
|
|
|
|