1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/common/mojo_channel_switches.h"
7 #include "base/command_line.h"
8 #include "ipc/mojo/ipc_channel_mojo.h"
9 #include "mojo/common/common_type_converters.h"
13 // Replaces renderer-browser IPC channel with ChnanelMojo.
14 // TODO(morrita): Now ChannelMojo for the renderer is on by default.
15 // Remove this once the change sticks.
16 const char kEnableRendererMojoChannel
[] =
17 "enable-renderer-mojo-channel";
19 // Disale ChannelMojo usage regardless of the platform or the process type.
20 const char kDisableMojoChannel
[] = "disable-mojo-channel";
22 } // namespace switches
26 bool ShouldUseMojoChannel() {
27 const base::CommandLine
& command_line
=
28 *base::CommandLine::ForCurrentProcess();
30 if (command_line
.HasSwitch(switches::kDisableMojoChannel
))
32 if (command_line
.HasSwitch(switches::kEnableRendererMojoChannel
))
34 return IPC::ChannelMojo::ShouldBeUsed();
37 } // namespace content