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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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]. |
136 //! base::ScopedFD server_write_fd(atoi(argv[1])); | 136 //! base::ScopedFD server_write_fd(atoi(argv[1])); |
137 //! | 137 //! |
138 //! // Obtain a receive right from the parent process. | 138 //! // Obtain a receive right from the parent process. |
139 //! base::mac::ScopedMachReceiveRight receive_right( | 139 //! base::mac::ScopedMachReceiveRight receive_right( |
140 //! ChildPortHandshake::RunServerForFD( | 140 //! ChildPortHandshake::RunServerForFD( |
141 //! server_write_fd.Pass(), | 141 //! crashpad::move(server_write_fd), |
142 //! ChildPortHandshake::PortRightType::kReceiveRight)); | 142 //! ChildPortHandshake::PortRightType::kReceiveRight)); |
143 //! } | 143 //! } |
144 //! \endcode | 144 //! \endcode |
145 class ChildPortHandshake { | 145 class ChildPortHandshake { |
146 public: | 146 public: |
147 //! \brief Controls whether a receive or send right is expected to be | 147 //! \brief Controls whether a receive or send right is expected to be |
148 //! obtained from the client by the server’s call to RunServer(). | 148 //! obtained from the client by the server’s call to RunServer(). |
149 enum class PortRightType { | 149 enum class PortRightType { |
150 //! \brief The server expects to receive a receive right. | 150 //! \brief The server expects to receive a receive right. |
151 kReceiveRight = 0, | 151 kReceiveRight = 0, |
(...skipping 166 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 |