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

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

Issue 872673008: Fix ipc fuzzer crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 return false; 56 return false;
57 } 57 }
58 58
59 // Log to both stderr and file destinations. 59 // Log to both stderr and file destinations.
60 logging::SetMinLogLevel(logging::LOG_ERROR); 60 logging::SetMinLogLevel(logging::LOG_ERROR);
61 logging::LoggingSettings settings; 61 logging::LoggingSettings settings;
62 settings.logging_dest = logging::LOG_TO_ALL; 62 settings.logging_dest = logging::LOG_TO_ALL;
63 settings.log_file = FILE_PATH_LITERAL("ipc_replay.log"); 63 settings.log_file = FILE_PATH_LITERAL("ipc_replay.log");
64 logging::InitLogging(settings); 64 logging::InitLogging(settings);
65 65
66 // Make sure to initialize Mojo before starting the IO thread.
67 InitializeMojo();
68
66 io_thread_.StartWithOptions( 69 io_thread_.StartWithOptions(
67 base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); 70 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
68 71
69 #if defined(OS_POSIX) 72 #if defined(OS_POSIX)
70 base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance(); 73 base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance();
71 g_fds->Set(kPrimaryIPCChannel, 74 g_fds->Set(kPrimaryIPCChannel,
72 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor); 75 kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
73 #endif 76 #endif
74 77
75 InitializeMojo();
76
77 return true; 78 return true;
78 } 79 }
79 80
80 void ReplayProcess::OpenChannel() { 81 void ReplayProcess::OpenChannel() {
81 std::string channel_name = 82 std::string channel_name =
82 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 83 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
83 switches::kProcessChannelID); 84 switches::kProcessChannelID);
84 85
85 // TODO(morrita): As the adoption of ChannelMojo spreads, this 86 // TODO(morrita): As the adoption of ChannelMojo spreads, this
86 // criteria has to be updated. 87 // criteria has to be updated.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 return true; 138 return true;
138 } 139 }
139 140
140 void ReplayProcess::OnChannelError() { 141 void ReplayProcess::OnChannelError() {
141 LOG(ERROR) << "Channel error, quitting after " 142 LOG(ERROR) << "Channel error, quitting after "
142 << message_index_ << " messages"; 143 << message_index_ << " messages";
143 base::MessageLoop::current()->Quit(); 144 base::MessageLoop::current()->Quit();
144 } 145 }
145 146
146 } // namespace ipc_fuzzer 147 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698