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, |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "base/mac/mach_logging.h" | 29 #include "base/mac/mach_logging.h" |
30 #include "base/mac/scoped_mach_port.h" | 30 #include "base/mac/scoped_mach_port.h" |
31 #include "base/posix/eintr_wrapper.h" | 31 #include "base/posix/eintr_wrapper.h" |
32 #include "base/rand_util.h" | 32 #include "base/rand_util.h" |
33 #include "base/strings/stringprintf.h" | 33 #include "base/strings/stringprintf.h" |
34 #include "util/file/file_io.h" | 34 #include "util/file/file_io.h" |
35 #include "util/mach/child_port.h" | 35 #include "util/mach/child_port.h" |
36 #include "util/mach/mach_extensions.h" | 36 #include "util/mach/mach_extensions.h" |
37 #include "util/mach/mach_message.h" | 37 #include "util/mach/mach_message.h" |
38 #include "util/mach/mach_message_server.h" | 38 #include "util/mach/mach_message_server.h" |
| 39 #include "util/misc/implicit_cast.h" |
39 | 40 |
40 namespace crashpad { | 41 namespace crashpad { |
41 | 42 |
42 ChildPortHandshake::ChildPortHandshake() | 43 ChildPortHandshake::ChildPortHandshake() |
43 : token_(0), | 44 : token_(0), |
44 pipe_read_(), | 45 pipe_read_(), |
45 pipe_write_(), | 46 pipe_write_(), |
46 child_port_(MACH_PORT_NULL), | 47 child_port_(MACH_PORT_NULL), |
47 checked_in_(false) { | 48 checked_in_(false) { |
48 // Use socketpair() instead of pipe(). There is no way to suppress SIGPIPE on | 49 // Use socketpair() instead of pipe(). There is no way to suppress SIGPIPE on |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 bootstrap_look_up(bootstrap_port, service_name.c_str(), &server_port); | 339 bootstrap_look_up(bootstrap_port, service_name.c_str(), &server_port); |
339 BOOTSTRAP_CHECK(kr == BOOTSTRAP_SUCCESS, kr) << "bootstrap_look_up"; | 340 BOOTSTRAP_CHECK(kr == BOOTSTRAP_SUCCESS, kr) << "bootstrap_look_up"; |
340 base::mac::ScopedMachSendRight server_port_owner(server_port); | 341 base::mac::ScopedMachSendRight server_port_owner(server_port); |
341 | 342 |
342 // Check in with the server. | 343 // Check in with the server. |
343 kr = child_port_check_in(server_port, token, port, right_type); | 344 kr = child_port_check_in(server_port, token, port, right_type); |
344 MACH_CHECK(kr == KERN_SUCCESS, kr) << "child_port_check_in"; | 345 MACH_CHECK(kr == KERN_SUCCESS, kr) << "child_port_check_in"; |
345 } | 346 } |
346 | 347 |
347 } // namespace crashpad | 348 } // namespace crashpad |
OLD | NEW |