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

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

Issue 1805653003: Add support for MojoChannel field trial (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 9 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') | ipc/mojo/ipc_channel_mojo.h » ('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 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
« no previous file with comments | « content/public/common/mojo_channel_switches.h ('k') | ipc/mojo/ipc_channel_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698