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 "components/nacl/broker/nacl_broker_listener.h" | 5 #include "components/nacl/broker/nacl_broker_listener.h" |
6 | 6 |
7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 IPC_MESSAGE_HANDLER(NaClProcessMsg_LaunchDebugExceptionHandler, | 78 IPC_MESSAGE_HANDLER(NaClProcessMsg_LaunchDebugExceptionHandler, |
79 OnLaunchDebugExceptionHandler) | 79 OnLaunchDebugExceptionHandler) |
80 IPC_MESSAGE_HANDLER(NaClProcessMsg_StopBroker, OnStopBroker) | 80 IPC_MESSAGE_HANDLER(NaClProcessMsg_StopBroker, OnStopBroker) |
81 IPC_MESSAGE_UNHANDLED(handled = false) | 81 IPC_MESSAGE_UNHANDLED(handled = false) |
82 IPC_END_MESSAGE_MAP() | 82 IPC_END_MESSAGE_MAP() |
83 return handled; | 83 return handled; |
84 } | 84 } |
85 | 85 |
86 void NaClBrokerListener::OnChannelError() { | 86 void NaClBrokerListener::OnChannelError() { |
87 // The browser died unexpectedly, quit to avoid a zombie process. | 87 // The browser died unexpectedly, quit to avoid a zombie process. |
88 base::MessageLoop::current()->Quit(); | 88 base::MessageLoop::current()->QuitWhenIdle(); |
89 } | 89 } |
90 | 90 |
91 void NaClBrokerListener::OnLaunchLoaderThroughBroker( | 91 void NaClBrokerListener::OnLaunchLoaderThroughBroker( |
92 const std::string& loader_channel_id) { | 92 const std::string& loader_channel_id) { |
93 base::ProcessHandle loader_handle_in_browser = 0; | 93 base::ProcessHandle loader_handle_in_browser = 0; |
94 | 94 |
95 // Create the path to the nacl broker/loader executable - it's the executable | 95 // Create the path to the nacl broker/loader executable - it's the executable |
96 // this code is running in. | 96 // this code is running in. |
97 base::FilePath exe_path; | 97 base::FilePath exe_path; |
98 PathService::Get(base::FILE_EXE, &exe_path); | 98 PathService::Get(base::FILE_EXE, &exe_path); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void NaClBrokerListener::OnLaunchDebugExceptionHandler( | 131 void NaClBrokerListener::OnLaunchDebugExceptionHandler( |
132 int32 pid, base::ProcessHandle process_handle, | 132 int32 pid, base::ProcessHandle process_handle, |
133 const std::string& startup_info) { | 133 const std::string& startup_info) { |
134 NaClStartDebugExceptionHandlerThread( | 134 NaClStartDebugExceptionHandlerThread( |
135 base::Process(process_handle), startup_info, | 135 base::Process(process_handle), startup_info, |
136 base::ThreadTaskRunnerHandle::Get(), | 136 base::ThreadTaskRunnerHandle::Get(), |
137 base::Bind(SendReply, channel_.get(), pid)); | 137 base::Bind(SendReply, channel_.get(), pid)); |
138 } | 138 } |
139 | 139 |
140 void NaClBrokerListener::OnStopBroker() { | 140 void NaClBrokerListener::OnStopBroker() { |
141 base::MessageLoop::current()->Quit(); | 141 base::MessageLoop::current()->QuitWhenIdle(); |
142 } | 142 } |
OLD | NEW |