| 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 d1ed7b89bf70ca6a3f22bbd879cc8de9716960b3..293f46f8641c817b430f8d6faa48ea3ad82cd223 100644
|
| --- a/content/public/common/mojo_channel_switches.cc
|
| +++ b/content/public/common/mojo_channel_switches.cc
|
| @@ -4,9 +4,16 @@
|
|
|
| #include "content/public/common/mojo_channel_switches.h"
|
|
|
| +#include "base/command_line.h"
|
| +#include "base/metrics/field_trial.h"
|
| +#include "base/strings/string_util.h"
|
| #include "ipc/mojo/ipc_channel_mojo.h"
|
| +#include "mojo/common/common_type_converters.h"
|
|
|
| namespace switches {
|
| +
|
| +// 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";
|
| @@ -15,3 +22,25 @@
|
| const char kMojoApplicationChannelToken[] = "mojo-application-channel-token";
|
|
|
| } // namespace switches
|
| +
|
| +namespace {
|
| +
|
| +const char kMojoChannelExperimentName[] = "MojoChannel";
|
| +
|
| +} // namespace
|
| +
|
| +namespace content {
|
| +
|
| +bool ShouldUseMojoChannel() {
|
| + const std::string group =
|
| + base::FieldTrialList::FindFullName(kMojoChannelExperimentName);
|
| +
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableMojoChannel))
|
| + return true;
|
| +
|
| + return base::StartsWith(
|
| + group, "Enabled", base::CompareCase::INSENSITIVE_ASCII);
|
| +}
|
| +
|
| +} // namespace content
|
|
|