| OLD | NEW |
| 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 #ifndef TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_ | 5 #ifndef TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_ |
| 6 #define TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_ | 6 #define TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
| 13 #include "base/synchronization/waitable_event.h" | 13 #include "base/synchronization/waitable_event.h" |
| 14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "ipc/ipc_channel_proxy.h" | 16 #include "ipc/ipc_channel_proxy.h" |
| 17 #include "ipc/ipc_listener.h" | 17 #include "ipc/ipc_listener.h" |
| 18 #include "ipc/ipc_message.h" | 18 #include "ipc/ipc_message.h" |
| 19 #include "ipc/mojo/scoped_ipc_support.h" |
| 19 #include "tools/ipc_fuzzer/message_lib/message_file.h" | 20 #include "tools/ipc_fuzzer/message_lib/message_file.h" |
| 20 | 21 |
| 21 namespace ipc_fuzzer { | 22 namespace ipc_fuzzer { |
| 22 | 23 |
| 23 class ReplayProcess : public IPC::Listener { | 24 class ReplayProcess : public IPC::Listener { |
| 24 public: | 25 public: |
| 25 ReplayProcess(); | 26 ReplayProcess(); |
| 26 ~ReplayProcess() override; | 27 ~ReplayProcess() override; |
| 27 | 28 |
| 28 // Set up command line, logging, IO thread. Returns true on success, false | 29 // Set up command line, logging, IO thread. Returns true on success, false |
| (...skipping 10 matching lines...) Expand all Loading... |
| 39 // Send messages to the browser. | 40 // Send messages to the browser. |
| 40 void Run(); | 41 void Run(); |
| 41 | 42 |
| 42 // IPC::Listener implementation. | 43 // IPC::Listener implementation. |
| 43 bool OnMessageReceived(const IPC::Message& message) override; | 44 bool OnMessageReceived(const IPC::Message& message) override; |
| 44 void OnChannelError() override; | 45 void OnChannelError() override; |
| 45 | 46 |
| 46 private: | 47 private: |
| 47 void SendNextMessage(); | 48 void SendNextMessage(); |
| 48 | 49 |
| 50 scoped_ptr<IPC::ScopedIPCSupport> mojo_ipc_support_; |
| 49 scoped_ptr<IPC::ChannelProxy> channel_; | 51 scoped_ptr<IPC::ChannelProxy> channel_; |
| 50 base::MessageLoop main_loop_; | 52 base::MessageLoop main_loop_; |
| 51 base::Thread io_thread_; | 53 base::Thread io_thread_; |
| 52 base::WaitableEvent shutdown_event_; | 54 base::WaitableEvent shutdown_event_; |
| 53 scoped_ptr<base::Timer> timer_; | 55 scoped_ptr<base::Timer> timer_; |
| 54 MessageVector messages_; | 56 MessageVector messages_; |
| 55 size_t message_index_; | 57 size_t message_index_; |
| 56 | 58 |
| 57 DISALLOW_COPY_AND_ASSIGN(ReplayProcess); | 59 DISALLOW_COPY_AND_ASSIGN(ReplayProcess); |
| 58 }; | 60 }; |
| 59 | 61 |
| 60 } // namespace ipc_fuzzer | 62 } // namespace ipc_fuzzer |
| 61 | 63 |
| 62 #endif // TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_ | 64 #endif // TOOLS_IPC_FUZZER_REPLAY_REPLAY_PROCESS_H_ |
| OLD | NEW |