OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "content/public/common/mojo_channel_switches.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "ipc/mojo/ipc_channel_mojo.h" |
| 9 #include "mojo/common/common_type_converters.h" |
| 10 |
| 11 namespace switches { |
| 12 |
| 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"; |
| 18 |
| 19 // Disale ChannelMojo usage regardless of the platform or the process type. |
| 20 const char kDisableMojoChannel[] = "disable-mojo-channel"; |
| 21 |
| 22 } // namespace switches |
| 23 |
| 24 namespace content { |
| 25 |
| 26 bool ShouldUseMojoChannel() { |
| 27 const base::CommandLine& command_line = |
| 28 *base::CommandLine::ForCurrentProcess(); |
| 29 |
| 30 if (command_line.HasSwitch(switches::kDisableMojoChannel)) |
| 31 return false; |
| 32 if (command_line.HasSwitch(switches::kEnableRendererMojoChannel)) |
| 33 return true; |
| 34 return IPC::ChannelMojo::ShouldBeUsed(); |
| 35 } |
| 36 |
| 37 } // namespace content |
OLD | NEW |