| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 //! mach_msg_type_name_t send_right_type; | 115 //! mach_msg_type_name_t send_right_type; |
| 116 //! mach_port_extract_right(mach_task_self(), | 116 //! mach_port_extract_right(mach_task_self(), |
| 117 //! receive_right.get(), | 117 //! receive_right.get(), |
| 118 //! MACH_MSG_TYPE_MAKE_SEND, | 118 //! MACH_MSG_TYPE_MAKE_SEND, |
| 119 //! &send_right, | 119 //! &send_right, |
| 120 //! &send_right_type); | 120 //! &send_right_type); |
| 121 //! base::mac::ScopedMachSendRight send_right_owner(send_right); | 121 //! base::mac::ScopedMachSendRight send_right_owner(send_right); |
| 122 //! | 122 //! |
| 123 //! // Send the receive right to the child process, retaining the send right | 123 //! // Send the receive right to the child process, retaining the send right |
| 124 //! // for use in the parent process. | 124 //! // for use in the parent process. |
| 125 //! if (child_port_handshake.RunClient(receive_right, | 125 //! if (child_port_handshake.RunClient(receive_right.get(), |
| 126 //! MACH_MSG_TYPE_MOVE_RECEIVE)) { | 126 //! MACH_MSG_TYPE_MOVE_RECEIVE)) { |
| 127 //! ignore_result(receive_right.release()); | 127 //! ignore_result(receive_right.release()); |
| 128 //! } | 128 //! } |
| 129 //! \endcode | 129 //! \endcode |
| 130 //! | 130 //! |
| 131 //! Example child process, running a server that receives a receive right from | 131 //! Example child process, running a server that receives a receive right from |
| 132 //! its parent: | 132 //! its parent: |
| 133 //! \code | 133 //! \code |
| 134 //! int main(int argc, char* argv[]) { | 134 //! int main(int argc, char* argv[]) { |
| 135 //! // The parent passed server_write_fd in argv[1]. | 135 //! // The parent passed server_write_fd in argv[1]. |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 base::ScopedFD server_write_fd_; | 318 base::ScopedFD server_write_fd_; |
| 319 | 319 |
| 320 friend class test::ChildPortHandshakeTest; | 320 friend class test::ChildPortHandshakeTest; |
| 321 | 321 |
| 322 DISALLOW_COPY_AND_ASSIGN(ChildPortHandshake); | 322 DISALLOW_COPY_AND_ASSIGN(ChildPortHandshake); |
| 323 }; | 323 }; |
| 324 | 324 |
| 325 } // namespace crashpad | 325 } // namespace crashpad |
| 326 | 326 |
| 327 #endif // CRASHPAD_UTIL_MACH_CHILD_PORT_HANDSHAKE_H_ | 327 #endif // CRASHPAD_UTIL_MACH_CHILD_PORT_HANDSHAKE_H_ |
| OLD | NEW |