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

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

Issue 1025483002: Restructure the ipc_fuzzer directory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move more files around Created 5 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 unified diff | Download patch
« no previous file with comments | « tools/ipc_fuzzer/replay/replay.gyp ('k') | tools/ipc_fuzzer/replay/replay_process.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_
6 #define TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/synchronization/waitable_event.h"
11 #include "base/threading/thread.h"
12 #include "base/timer/timer.h"
13 #include "ipc/ipc_channel_proxy.h"
14 #include "ipc/ipc_listener.h"
15 #include "ipc/ipc_message.h"
16 #include "tools/ipc_fuzzer/message_lib/message_file.h"
17
18 namespace ipc_fuzzer {
19
20 class ReplayProcess : public IPC::Listener {
21 public:
22 ReplayProcess();
23 ~ReplayProcess() override;
24
25 // Set up command line, logging, IO thread. Returns true on success, false
26 // otherwise.
27 bool Initialize(int argc, const char** argv);
28
29 // Open a channel to the browser process. It will think we are a renderer.
30 void OpenChannel();
31
32 // Extract messages from a file specified by --ipc-fuzzer-testcase=
33 // Returns true on success, false otherwise.
34 bool OpenTestcase();
35
36 // Send messages to the browser.
37 void Run();
38
39 // IPC::Listener implementation.
40 bool OnMessageReceived(const IPC::Message& message) override;
41 void OnChannelError() override;
42
43 private:
44 void SendNextMessage();
45
46 scoped_ptr<IPC::ChannelProxy> channel_;
47 base::MessageLoop main_loop_;
48 base::Thread io_thread_;
49 base::WaitableEvent shutdown_event_;
50 scoped_ptr<base::Timer> timer_;
51 MessageVector messages_;
52 size_t message_index_;
53
54 DISALLOW_COPY_AND_ASSIGN(ReplayProcess);
55 };
56
57 } // namespace ipc_fuzzer
58
59 #endif // TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_
OLDNEW
« no previous file with comments | « tools/ipc_fuzzer/replay/replay.gyp ('k') | tools/ipc_fuzzer/replay/replay_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698