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

Unified Diff: tools/ipc_fuzzer/replay/replay_process.cc

Issue 861113003: Fix issues with replay_process in ipc fuzzer. Make it compile on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Log to both stderr, file since stderr is hard to get on windows. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/ipc_fuzzer/play_testcase.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/replay/replay_process.cc
diff --git a/tools/ipc_fuzzer/replay/replay_process.cc b/tools/ipc_fuzzer/replay/replay_process.cc
index 500e4d4779a3a3d428fc23f2e8f1c2e4ebcc14ef..38a72e238eb69b541b77d60b728ff18d4e4a4780 100644
--- a/tools/ipc_fuzzer/replay/replay_process.cc
+++ b/tools/ipc_fuzzer/replay/replay_process.cc
@@ -25,6 +25,11 @@ ReplayProcess::ReplayProcess()
ReplayProcess::~ReplayProcess() {
channel_.reset();
+
+ // Signal this event before shutting down the service process. That way all
+ // background threads can cleanup.
+ shutdown_event_.Signal();
+ io_thread_.Stop();
}
bool ReplayProcess::Initialize(int argc, const char** argv) {
@@ -37,16 +42,22 @@ bool ReplayProcess::Initialize(int argc, const char** argv) {
return false;
}
- // Log to default destination.
+ // Log to both stderr and file destinations.
logging::SetMinLogLevel(logging::LOG_ERROR);
- logging::InitLogging(logging::LoggingSettings());
+ logging::LoggingSettings settings;
+ settings.logging_dest = logging::LOG_TO_ALL;
+ settings.log_file = FILE_PATH_LITERAL("ipc_replay.log");
+ logging::InitLogging(settings);
io_thread_.StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
+#if defined(OS_POSIX)
base::GlobalDescriptors* g_fds = base::GlobalDescriptors::GetInstance();
g_fds->Set(kPrimaryIPCChannel,
kPrimaryIPCChannel + base::GlobalDescriptors::kBaseDescriptor);
+#endif
+
return true;
}
« no previous file with comments | « tools/ipc_fuzzer/play_testcase.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698