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

Side by Side Diff: tools/ipc_fuzzer/replay/replay_process.cc

Issue 301973003: Introduce IPC::ChannelProxy::Create*() and IPC::SynChannel::Create*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing mac build Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "tools/ipc_fuzzer/replay/replay_process.h" 5 #include "tools/ipc_fuzzer/replay/replay_process.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <string> 8 #include <string>
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 g_fds->Set(kPrimaryIPCChannel, 48 g_fds->Set(kPrimaryIPCChannel,
49 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor); 49 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
50 return true; 50 return true;
51 } 51 }
52 52
53 void ReplayProcess::OpenChannel() { 53 void ReplayProcess::OpenChannel() {
54 std::string channel_name = 54 std::string channel_name =
55 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 55 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
56 switches::kProcessChannelID); 56 switches::kProcessChannelID);
57 57
58 channel_.reset( 58 channel_ = IPC::ChannelProxy::CreateClient(
59 new IPC::ChannelProxy(channel_name, 59 channel_name, this, io_thread_.message_loop_proxy());
60 IPC::Channel::MODE_CLIENT,
61 this,
62 io_thread_.message_loop_proxy()));
63 } 60 }
64 61
65 bool ReplayProcess::OpenTestcase() { 62 bool ReplayProcess::OpenTestcase() {
66 base::FilePath path = CommandLine::ForCurrentProcess()->GetSwitchValuePath( 63 base::FilePath path = CommandLine::ForCurrentProcess()->GetSwitchValuePath(
67 switches::kIpcFuzzerTestcase); 64 switches::kIpcFuzzerTestcase);
68 return MessageFile::Read(path, &messages_); 65 return MessageFile::Read(path, &messages_);
69 } 66 }
70 67
71 void ReplayProcess::SendNextMessage() { 68 void ReplayProcess::SendNextMessage() {
72 if (message_index_ >= messages_.size()) { 69 if (message_index_ >= messages_.size()) {
(...skipping 25 matching lines...) Expand all
98 return true; 95 return true;
99 } 96 }
100 97
101 void ReplayProcess::OnChannelError() { 98 void ReplayProcess::OnChannelError() {
102 LOG(ERROR) << "Channel error, quitting after " 99 LOG(ERROR) << "Channel error, quitting after "
103 << message_index_ << " messages"; 100 << message_index_ << " messages";
104 base::MessageLoop::current()->Quit(); 101 base::MessageLoop::current()->Quit();
105 } 102 }
106 103
107 } // namespace ipc_fuzzer 104 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « remoting/host/win/worker_process_launcher_unittest.cc ('k') | win8/metro_driver/chrome_app_view_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698