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() { |