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

Unified Diff: content/public/common/mojo_channel_switches.cc

Issue 1946573002: Revert of Turn on MojoChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/mojo_channel_switches.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « content/public/common/mojo_channel_switches.h ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698