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

Unified Diff: tools/ipc_fuzzer/replay/replay_process.cc

Issue 875513007: IPC Fuzzer: Enable ChannelMojo if it should be enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « tools/ipc_fuzzer/replay/replay.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/replay/replay_process.cc
diff --git a/tools/ipc_fuzzer/replay/replay_process.cc b/tools/ipc_fuzzer/replay/replay_process.cc
index 6f85a06a38a939ba7f5a811b03bdf9733eba9a50..c5db76c8efb3b3a03f791184a59c91c71ad1d8d9 100644
--- a/tools/ipc_fuzzer/replay/replay_process.cc
+++ b/tools/ipc_fuzzer/replay/replay_process.cc
@@ -12,8 +12,10 @@
#include "base/logging.h"
#include "base/posix/global_descriptors.h"
#include "chrome/common/chrome_switches.h"
+#include "content/public/common/content_switches.h"
#include "ipc/ipc_descriptors.h"
#include "ipc/ipc_switches.h"
+#include "ipc/mojo/ipc_channel_mojo.h"
namespace ipc_fuzzer {
@@ -66,10 +68,22 @@ void ReplayProcess::OpenChannel() {
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kProcessChannelID);
- channel_ = IPC::ChannelProxy::Create(channel_name,
- IPC::Channel::MODE_CLIENT,
- this,
- io_thread_.message_loop_proxy());
+ // TODO(morrita): As the adoption of ChannelMojo spreads, this
+ // criteria has to be updated.
+ std::string process_type =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kProcessType);
+ bool should_use_mojo = process_type == switches::kRendererProcess &&
inferno 2015/01/30 19:21:49 We launch reply process with the following prefixe
Hajime Morrita 2015/01/30 19:29:49 I think so. ChannelMojo is enabled only for the re
+ IPC::ChannelMojo::ShouldBeUsed();
+ if (should_use_mojo) {
+ channel_ = IPC::ChannelProxy::Create(
+ IPC::ChannelMojo::CreateClientFactory(channel_name), this,
+ io_thread_.message_loop_proxy());
+ } else {
+ channel_ =
+ IPC::ChannelProxy::Create(channel_name, IPC::Channel::MODE_CLIENT, this,
+ io_thread_.message_loop_proxy());
+ }
}
bool ReplayProcess::OpenTestcase() {
« no previous file with comments | « tools/ipc_fuzzer/replay/replay.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698