| 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 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 //! \brief An interface that the request message that is a part of the | 29 //! \brief An interface that the request message that is a part of the |
| 30 //! `child_port` Mach subsystem can be dispatched to. | 30 //! `child_port` Mach subsystem can be dispatched to. |
| 31 class Interface { | 31 class Interface { |
| 32 public: | 32 public: |
| 33 //! \brief Handles check-ins sent by `child_port_check_in()`. | 33 //! \brief Handles check-ins sent by `child_port_check_in()`. |
| 34 //! | 34 //! |
| 35 //! This behaves equivalently to a `handle_child_port_check_in()` function | 35 //! This behaves equivalently to a `handle_child_port_check_in()` function |
| 36 //! used with `child_port_server()`. | 36 //! used with `child_port_server()`. |
| 37 //! | 37 //! |
| 38 //! \param[in] trailer The trailer received with the request message. |
| 38 //! \param[out] destroy_request `true` if the request message is to be | 39 //! \param[out] destroy_request `true` if the request message is to be |
| 39 //! destroyed even when this method returns success. See | 40 //! destroyed even when this method returns success. See |
| 40 //! MachMessageServer::Interface. | 41 //! MachMessageServer::Interface. |
| 41 virtual kern_return_t HandleChildPortCheckIn( | 42 virtual kern_return_t HandleChildPortCheckIn( |
| 42 child_port_server_t server, | 43 child_port_server_t server, |
| 43 const child_port_token_t token, | 44 const child_port_token_t token, |
| 44 mach_port_t port, | 45 mach_port_t port, |
| 45 mach_msg_type_name_t right_type, | 46 mach_msg_type_name_t right_type, |
| 47 const mach_msg_trailer_t* trailer, |
| 46 bool* destroy_complex_request) = 0; | 48 bool* destroy_complex_request) = 0; |
| 47 | 49 |
| 48 protected: | 50 protected: |
| 49 ~Interface() {} | 51 ~Interface() {} |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 //! \brief Constructs an object of this class. | 54 //! \brief Constructs an object of this class. |
| 53 //! | 55 //! |
| 54 //! \param[in] interface The interface to dispatch requests to. Weak. | 56 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 55 explicit ChildPortServer(Interface* interface); | 57 explicit ChildPortServer(Interface* interface); |
| 56 | 58 |
| 57 // MachMessageServer::Interface: | 59 // MachMessageServer::Interface: |
| 58 | 60 |
| 59 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 61 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 60 mach_msg_header_t* out_header, | 62 mach_msg_header_t* out_header, |
| 61 bool* destroy_complex_request) override; | 63 bool* destroy_complex_request) override; |
| 62 | 64 |
| 63 mach_msg_size_t MachMessageServerRequestSize() override; | 65 mach_msg_size_t MachMessageServerRequestSize() override; |
| 64 mach_msg_size_t MachMessageServerReplySize() override; | 66 mach_msg_size_t MachMessageServerReplySize() override; |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 Interface* interface_; // weak | 69 Interface* interface_; // weak |
| 68 | 70 |
| 69 DISALLOW_COPY_AND_ASSIGN(ChildPortServer); | 71 DISALLOW_COPY_AND_ASSIGN(ChildPortServer); |
| 70 }; | 72 }; |
| 71 | 73 |
| 72 } // namespace crashpad | 74 } // namespace crashpad |
| 73 | 75 |
| 74 #endif // CRASHPAD_UTIL_MACH_CHILD_PORT_SERVER_H_ | 76 #endif // CRASHPAD_UTIL_MACH_CHILD_PORT_SERVER_H_ |
| OLD | NEW |