| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/common/mojo_channel_switches.h" | 5 #include "content/public/common/mojo_channel_switches.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
| 9 #include "ipc/mojo/ipc_channel_mojo.h" | 9 #include "ipc/mojo/ipc_channel_mojo.h" |
| 10 #include "mojo/common/common_type_converters.h" | 10 #include "mojo/common/common_type_converters.h" |
| 11 | 11 |
| 12 namespace switches { | 12 namespace switches { |
| 13 | 13 |
| 14 // Enable ChannelMojo on any supported platform. | 14 // Enable ChannelMojo on any supported platform. |
| 15 const char kEnableMojoChannel[] = "enable-mojo-channel"; | 15 const char kEnableMojoChannel[] = "enable-mojo-channel"; |
| 16 | 16 |
| 17 // The token to use to construct the message pipe on which to layer ChannelMojo. | 17 // The token to use to construct the message pipe on which to layer ChannelMojo. |
| 18 const char kMojoChannelToken[] = "mojo-channel-token"; | 18 const char kMojoChannelToken[] = "mojo-channel-token"; |
| 19 | 19 |
| 20 // The token to use to construct the message pipe for MojoApplication. |
| 21 const char kMojoApplicationChannelToken[] = "mojo-application-channel-token"; |
| 22 |
| 20 } // namespace switches | 23 } // namespace switches |
| 21 | 24 |
| 22 namespace { | 25 namespace { |
| 23 | 26 |
| 24 const char kMojoChannelExperimentName[] = "MojoChannel"; | 27 const char kMojoChannelExperimentName[] = "MojoChannel"; |
| 25 | 28 |
| 26 } // namespace | 29 } // namespace |
| 27 | 30 |
| 28 namespace content { | 31 namespace content { |
| 29 | 32 |
| 30 bool ShouldUseMojoChannel() { | 33 bool ShouldUseMojoChannel() { |
| 31 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 34 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 32 switches::kEnableMojoChannel)) | 35 switches::kEnableMojoChannel)) |
| 33 return true; | 36 return true; |
| 34 | 37 |
| 35 const std::string group = | 38 const std::string group = |
| 36 base::FieldTrialList::FindFullName(kMojoChannelExperimentName); | 39 base::FieldTrialList::FindFullName(kMojoChannelExperimentName); |
| 37 if (group == "Enabled") | 40 if (group == "Enabled") |
| 38 return true; | 41 return true; |
| 39 | 42 |
| 40 return false; | 43 return false; |
| 41 } | 44 } |
| 42 | 45 |
| 43 } // namespace content | 46 } // namespace content |
| OLD | NEW |