OLD | NEW |
1 // Copyright 2014 The Crashpad Authors. All rights reserved. | 1 // Copyright 2014 The Crashpad Authors. All rights reserved. |
2 // | 2 // |
3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
6 // | 6 // |
7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
8 // | 8 // |
9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
13 // limitations under the License. | 13 // limitations under the License. |
14 | 14 |
15 #include "handler/mac/exception_handler_server.h" | 15 #include "handler/mac/exception_handler_server.h" |
16 | 16 |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/mac/mach_logging.h" | 18 #include "base/mac/mach_logging.h" |
19 #include "util/mach/composite_mach_message_server.h" | 19 #include "util/mach/composite_mach_message_server.h" |
20 #include "util/mach/mach_extensions.h" | 20 #include "util/mach/mach_extensions.h" |
21 #include "util/mach/mach_message.h" | 21 #include "util/mach/mach_message.h" |
22 #include "util/mach/mach_message_server.h" | 22 #include "util/mach/mach_message_server.h" |
23 #include "util/mach/notify_server.h" | 23 #include "util/mach/notify_server.h" |
| 24 #include "util/stdlib/move.h" |
24 | 25 |
25 namespace crashpad { | 26 namespace crashpad { |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface, | 30 class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface, |
30 public NotifyServer::DefaultInterface { | 31 public NotifyServer::DefaultInterface { |
31 public: | 32 public: |
32 ExceptionHandlerServerRun( | 33 ExceptionHandlerServerRun( |
33 mach_port_t exception_port, | 34 mach_port_t exception_port, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 bool launchd_; | 177 bool launchd_; |
177 | 178 |
178 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServerRun); | 179 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServerRun); |
179 }; | 180 }; |
180 | 181 |
181 } // namespace | 182 } // namespace |
182 | 183 |
183 ExceptionHandlerServer::ExceptionHandlerServer( | 184 ExceptionHandlerServer::ExceptionHandlerServer( |
184 base::mac::ScopedMachReceiveRight receive_port, | 185 base::mac::ScopedMachReceiveRight receive_port, |
185 bool launchd) | 186 bool launchd) |
186 : receive_port_(receive_port.Pass()), | 187 : receive_port_(crashpad::move(receive_port)), |
187 notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)), | 188 notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)), |
188 launchd_(launchd) { | 189 launchd_(launchd) { |
189 CHECK(receive_port_.is_valid()); | 190 CHECK(receive_port_.is_valid()); |
190 CHECK(notify_port_.is_valid()); | 191 CHECK(notify_port_.is_valid()); |
191 } | 192 } |
192 | 193 |
193 ExceptionHandlerServer::~ExceptionHandlerServer() { | 194 ExceptionHandlerServer::~ExceptionHandlerServer() { |
194 } | 195 } |
195 | 196 |
196 void ExceptionHandlerServer::Run( | 197 void ExceptionHandlerServer::Run( |
(...skipping 27 matching lines...) Expand all Loading... |
224 MACH_SEND_MSG, | 225 MACH_SEND_MSG, |
225 sizeof(no_senders_notification), | 226 sizeof(no_senders_notification), |
226 0, | 227 0, |
227 MACH_PORT_NULL, | 228 MACH_PORT_NULL, |
228 MACH_MSG_TIMEOUT_NONE, | 229 MACH_MSG_TIMEOUT_NONE, |
229 MACH_PORT_NULL); | 230 MACH_PORT_NULL); |
230 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg"; | 231 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg"; |
231 } | 232 } |
232 | 233 |
233 } // namespace crashpad | 234 } // namespace crashpad |
OLD | NEW |