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

Side by Side Diff: content/public/common/mojo_channel_switches.cc

Issue 886153003: Reorganize ChannelMojo related flags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698