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

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

Issue 1350023003: Add a Mojo EDK for Chrome that uses one OS pipe per message pipe. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to mojo::edk namespace in preparation for runtim flag Created 5 years, 3 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
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/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 "chrome/common/chrome_switches.h" 14 #include "chrome/common/chrome_switches.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "content/public/common/mojo_channel_switches.h" 16 #include "content/public/common/mojo_channel_switches.h"
17 #include "ipc/ipc_descriptors.h" 17 #include "ipc/ipc_descriptors.h"
18 #include "ipc/ipc_switches.h" 18 #include "ipc/ipc_switches.h"
19 #include "ipc/mojo/ipc_channel_mojo.h" 19 #include "ipc/mojo/ipc_channel_mojo.h"
20
21 #if defined(USE_CHROME_EDK)
22 #include "mojo/edk/embedder/embedder.h"
23 #include "mojo/edk/embedder/simple_platform_support.h"
24 #else
20 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h" 25 #include "third_party/mojo/src/mojo/edk/embedder/configuration.h"
21 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" 26 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
22 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h" 27 #include "third_party/mojo/src/mojo/edk/embedder/simple_platform_support.h"
28 #endif
23 29
24 namespace ipc_fuzzer { 30 namespace ipc_fuzzer {
25 31
26 // TODO(morrita): content::InitializeMojo() should be used once it becomes 32 // TODO(morrita): content::InitializeMojo() should be used once it becomes
27 // a public API. See src/content/app/mojo/mojo_init.cc 33 // a public API. See src/content/app/mojo/mojo_init.cc
28 void InitializeMojo() { 34 void InitializeMojo() {
35 #if defined(USE_CHROME_EDK)
36 mojo::embedder::SetMaxMessageSize(64 * 1024 * 1024);
37 #else
29 mojo::embedder::GetConfiguration()->max_message_num_bytes = 38 mojo::embedder::GetConfiguration()->max_message_num_bytes =
30 64 * 1024 * 1024; 39 64 * 1024 * 1024;
40 #endif
31 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>( 41 mojo::embedder::Init(scoped_ptr<mojo::embedder::PlatformSupport>(
32 new mojo::embedder::SimplePlatformSupport())); 42 new mojo::embedder::SimplePlatformSupport()));
33 } 43 }
34 44
35 ReplayProcess::ReplayProcess() 45 ReplayProcess::ReplayProcess()
36 : io_thread_("Chrome_ChildIOThread"), 46 : io_thread_("Chrome_ChildIOThread"),
37 shutdown_event_(true, false), 47 shutdown_event_(true, false),
38 message_index_(0) { 48 message_index_(0) {
39 } 49 }
40 50
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 return true; 150 return true;
141 } 151 }
142 152
143 void ReplayProcess::OnChannelError() { 153 void ReplayProcess::OnChannelError() {
144 LOG(ERROR) << "Channel error, quitting after " 154 LOG(ERROR) << "Channel error, quitting after "
145 << message_index_ << " messages"; 155 << message_index_ << " messages";
146 base::MessageLoop::current()->Quit(); 156 base::MessageLoop::current()->Quit();
147 } 157 }
148 158
149 } // namespace ipc_fuzzer 159 } // namespace ipc_fuzzer
OLDNEW
« mojo/edk/system/raw_channel_win.cc ('K') | « tools/ipc_fuzzer/message_replay/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698