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 <utility> |
| 18 |
17 #include "base/logging.h" | 19 #include "base/logging.h" |
18 #include "base/mac/mach_logging.h" | 20 #include "base/mac/mach_logging.h" |
19 #include "util/mach/composite_mach_message_server.h" | 21 #include "util/mach/composite_mach_message_server.h" |
20 #include "util/mach/mach_extensions.h" | 22 #include "util/mach/mach_extensions.h" |
21 #include "util/mach/mach_message.h" | 23 #include "util/mach/mach_message.h" |
22 #include "util/mach/mach_message_server.h" | 24 #include "util/mach/mach_message_server.h" |
23 #include "util/mach/notify_server.h" | 25 #include "util/mach/notify_server.h" |
24 #include "util/stdlib/move.h" | |
25 | 26 |
26 namespace crashpad { | 27 namespace crashpad { |
27 | 28 |
28 namespace { | 29 namespace { |
29 | 30 |
30 class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface, | 31 class ExceptionHandlerServerRun : public UniversalMachExcServer::Interface, |
31 public NotifyServer::DefaultInterface { | 32 public NotifyServer::DefaultInterface { |
32 public: | 33 public: |
33 ExceptionHandlerServerRun( | 34 ExceptionHandlerServerRun( |
34 mach_port_t exception_port, | 35 mach_port_t exception_port, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 bool launchd_; | 178 bool launchd_; |
178 | 179 |
179 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServerRun); | 180 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServerRun); |
180 }; | 181 }; |
181 | 182 |
182 } // namespace | 183 } // namespace |
183 | 184 |
184 ExceptionHandlerServer::ExceptionHandlerServer( | 185 ExceptionHandlerServer::ExceptionHandlerServer( |
185 base::mac::ScopedMachReceiveRight receive_port, | 186 base::mac::ScopedMachReceiveRight receive_port, |
186 bool launchd) | 187 bool launchd) |
187 : receive_port_(crashpad::move(receive_port)), | 188 : receive_port_(std::move(receive_port)), |
188 notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)), | 189 notify_port_(NewMachPort(MACH_PORT_RIGHT_RECEIVE)), |
189 launchd_(launchd) { | 190 launchd_(launchd) { |
190 CHECK(receive_port_.is_valid()); | 191 CHECK(receive_port_.is_valid()); |
191 CHECK(notify_port_.is_valid()); | 192 CHECK(notify_port_.is_valid()); |
192 } | 193 } |
193 | 194 |
194 ExceptionHandlerServer::~ExceptionHandlerServer() { | 195 ExceptionHandlerServer::~ExceptionHandlerServer() { |
195 } | 196 } |
196 | 197 |
197 void ExceptionHandlerServer::Run( | 198 void ExceptionHandlerServer::Run( |
(...skipping 27 matching lines...) Expand all Loading... |
225 MACH_SEND_MSG, | 226 MACH_SEND_MSG, |
226 sizeof(no_senders_notification), | 227 sizeof(no_senders_notification), |
227 0, | 228 0, |
228 MACH_PORT_NULL, | 229 MACH_PORT_NULL, |
229 MACH_MSG_TIMEOUT_NONE, | 230 MACH_MSG_TIMEOUT_NONE, |
230 MACH_PORT_NULL); | 231 MACH_PORT_NULL); |
231 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg"; | 232 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg"; |
232 } | 233 } |
233 | 234 |
234 } // namespace crashpad | 235 } // namespace crashpad |
OLD | NEW |