Index: content/public/common/mojo_channel_switches.cc |
diff --git a/content/public/common/mojo_channel_switches.cc b/content/public/common/mojo_channel_switches.cc |
index a94e1952de72f401c1e0c9e0f55da806c2d59064..f649eb8a324594c98537febd6f9884d5d725d096 100644 |
--- a/content/public/common/mojo_channel_switches.cc |
+++ b/content/public/common/mojo_channel_switches.cc |
@@ -5,36 +5,39 @@ |
#include "content/public/common/mojo_channel_switches.h" |
#include "base/command_line.h" |
+#include "base/metrics/field_trial.h" |
#include "ipc/mojo/ipc_channel_mojo.h" |
#include "mojo/common/common_type_converters.h" |
namespace switches { |
-// Replaces renderer-browser IPC channel with ChnanelMojo. |
-// TODO(morrita): Now ChannelMojo for the renderer is on by default. |
-// Remove this once the change sticks. |
-const char kEnableRendererMojoChannel[] = |
- "enable-renderer-mojo-channel"; |
- |
-// Disable ChannelMojo usage regardless of the platform or the process type. |
-const char kDisableMojoChannel[] = "disable-mojo-channel"; |
+// Enable ChannelMojo on any supported platform. |
+const char kEnableMojoChannel[] = "enable-mojo-channel"; |
// The token to use to construct the message pipe on which to layer ChannelMojo. |
const char kMojoChannelToken[] = "mojo-channel-token"; |
} // namespace switches |
+namespace { |
+ |
+const char kMojoChannelExperimentName[] = "MojoChannel"; |
+ |
+} // namespace |
+ |
namespace content { |
bool ShouldUseMojoChannel() { |
- const base::CommandLine& command_line = |
- *base::CommandLine::ForCurrentProcess(); |
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableMojoChannel)) |
+ return true; |
- if (command_line.HasSwitch(switches::kDisableMojoChannel)) |
- return false; |
- if (command_line.HasSwitch(switches::kEnableRendererMojoChannel)) |
+ const std::string group = |
+ base::FieldTrialList::FindFullName(kMojoChannelExperimentName); |
Will Harris
2016/04/15 16:59:54
the query to FindFullName should always take place
|
+ if (group == "Enabled") |
return true; |
- return IPC::ChannelMojo::ShouldBeUsed(); |
+ |
+ return false; |
} |
} // namespace content |