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 #include "tools/ipc_fuzzer/message_replay/replay_process.h" | 5 #include "tools/ipc_fuzzer/message_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" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/posix/global_descriptors.h" | 13 #include "base/posix/global_descriptors.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 #include "content/public/common/mojo_channel_switches.h" | 17 #include "content/public/common/mojo_channel_switches.h" |
18 #include "ipc/ipc_descriptors.h" | 18 #include "ipc/ipc_descriptors.h" |
19 #include "ipc/ipc_switches.h" | 19 #include "ipc/ipc_switches.h" |
20 #include "ipc/mojo/ipc_channel_mojo.h" | 20 #include "ipc/mojo/ipc_channel_mojo.h" |
21 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 21 #include "mojo/edk/embedder/embedder.h" |
22 | 22 |
23 namespace ipc_fuzzer { | 23 namespace ipc_fuzzer { |
24 | 24 |
25 // TODO(morrita): content::InitializeMojo() should be used once it becomes | 25 // TODO(morrita): content::InitializeMojo() should be used once it becomes |
26 // a public API. See src/content/app/mojo/mojo_init.cc | 26 // a public API. See src/content/app/mojo/mojo_init.cc |
27 void InitializeMojo() { | 27 void InitializeMojo() { |
28 mojo::embedder::SetMaxMessageSize(64 * 1024 * 1024); | 28 mojo::edk::SetMaxMessageSize(64 * 1024 * 1024); |
29 mojo::embedder::Init(); | 29 mojo::edk::Init(); |
30 } | 30 } |
31 | 31 |
32 ReplayProcess::ReplayProcess() | 32 ReplayProcess::ReplayProcess() |
33 : io_thread_("Chrome_ChildIOThread"), | 33 : io_thread_("Chrome_ChildIOThread"), |
34 shutdown_event_(true, false), | 34 shutdown_event_(true, false), |
35 message_index_(0) { | 35 message_index_(0) { |
36 } | 36 } |
37 | 37 |
38 ReplayProcess::~ReplayProcess() { | 38 ReplayProcess::~ReplayProcess() { |
39 channel_.reset(); | 39 channel_.reset(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 return true; | 137 return true; |
138 } | 138 } |
139 | 139 |
140 void ReplayProcess::OnChannelError() { | 140 void ReplayProcess::OnChannelError() { |
141 LOG(ERROR) << "Channel error, quitting after " | 141 LOG(ERROR) << "Channel error, quitting after " |
142 << message_index_ << " messages"; | 142 << message_index_ << " messages"; |
143 base::MessageLoop::current()->QuitWhenIdle(); | 143 base::MessageLoop::current()->QuitWhenIdle(); |
144 } | 144 } |
145 | 145 |
146 } // namespace ipc_fuzzer | 146 } // namespace ipc_fuzzer |
OLD | NEW |