| 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 #ifndef CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ | 15 #ifndef CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ |
| 16 #define CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ | 16 #define CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ |
| 17 | 17 |
| 18 #include <mach/mach.h> | 18 #include <mach/mach.h> |
| 19 | 19 |
| 20 #include <set> |
| 21 |
| 20 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 21 #include "util/mach/mach_message_server.h" | 23 #include "util/mach/mach_message_server.h" |
| 22 | 24 |
| 23 namespace crashpad { | 25 namespace crashpad { |
| 24 | 26 |
| 25 // Routines to provide a single unified front-end to the interfaces in | 27 // Routines to provide a single unified front-end to the interfaces in |
| 26 // <mach/exc.defs> and <mach/mach_exc.defs>. The two interfaces are identical, | 28 // <mach/exc.defs> and <mach/mach_exc.defs>. The two interfaces are identical, |
| 27 // except that the latter allows for 64-bit exception codes, and is requested by | 29 // except that the latter allows for 64-bit exception codes, and is requested by |
| 28 // setting the MACH_EXCEPTION_CODES behavior bit associated with an exception | 30 // setting the MACH_EXCEPTION_CODES behavior bit associated with an exception |
| 29 // port. | 31 // port. |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 //! | 113 //! |
| 112 //! \param[in] interface The interface to dispatch requests to. Weak. | 114 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 113 explicit ExcServer(Interface* interface); | 115 explicit ExcServer(Interface* interface); |
| 114 | 116 |
| 115 // MachMessageServer::Interface: | 117 // MachMessageServer::Interface: |
| 116 | 118 |
| 117 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 119 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 118 mach_msg_header_t* out_header, | 120 mach_msg_header_t* out_header, |
| 119 bool* destroy_complex_request) override; | 121 bool* destroy_complex_request) override; |
| 120 | 122 |
| 123 std::set<mach_msg_id_t> MachMessageServerRequestIDs() override; |
| 124 |
| 121 mach_msg_size_t MachMessageServerRequestSize() override; | 125 mach_msg_size_t MachMessageServerRequestSize() override; |
| 122 mach_msg_size_t MachMessageServerReplySize() override; | 126 mach_msg_size_t MachMessageServerReplySize() override; |
| 123 | 127 |
| 124 private: | 128 private: |
| 125 Interface* interface_; // weak | 129 Interface* interface_; // weak |
| 126 | 130 |
| 127 DISALLOW_COPY_AND_ASSIGN(ExcServer); | 131 DISALLOW_COPY_AND_ASSIGN(ExcServer); |
| 128 }; | 132 }; |
| 129 | 133 |
| 130 //! \brief A server interface for the `mach_exc` Mach subsystem. | 134 //! \brief A server interface for the `mach_exc` Mach subsystem. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 //! | 214 //! |
| 211 //! \param[in] interface The interface to dispatch requests to. Weak. | 215 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 212 explicit MachExcServer(Interface* interface); | 216 explicit MachExcServer(Interface* interface); |
| 213 | 217 |
| 214 // MachMessageServer::Interface: | 218 // MachMessageServer::Interface: |
| 215 | 219 |
| 216 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 220 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 217 mach_msg_header_t* out_header, | 221 mach_msg_header_t* out_header, |
| 218 bool* destroy_complex_request) override; | 222 bool* destroy_complex_request) override; |
| 219 | 223 |
| 224 std::set<mach_msg_id_t> MachMessageServerRequestIDs() override; |
| 225 |
| 220 mach_msg_size_t MachMessageServerRequestSize() override; | 226 mach_msg_size_t MachMessageServerRequestSize() override; |
| 221 mach_msg_size_t MachMessageServerReplySize() override; | 227 mach_msg_size_t MachMessageServerReplySize() override; |
| 222 | 228 |
| 223 private: | 229 private: |
| 224 Interface* interface_; // weak | 230 Interface* interface_; // weak |
| 225 | 231 |
| 226 DISALLOW_COPY_AND_ASSIGN(MachExcServer); | 232 DISALLOW_COPY_AND_ASSIGN(MachExcServer); |
| 227 }; | 233 }; |
| 228 | 234 |
| 229 //! \brief A server interface for the `exc` Mach subsystem, simplified to have | 235 //! \brief A server interface for the `exc` Mach subsystem, simplified to have |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 //! | 482 //! |
| 477 //! \param[in] interface The interface to dispatch requests to. Weak. | 483 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 478 explicit UniversalMachExcServer(Interface* interface); | 484 explicit UniversalMachExcServer(Interface* interface); |
| 479 | 485 |
| 480 // MachMessageServer::Interface: | 486 // MachMessageServer::Interface: |
| 481 | 487 |
| 482 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 488 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 483 mach_msg_header_t* out_header, | 489 mach_msg_header_t* out_header, |
| 484 bool* destroy_complex_request) override; | 490 bool* destroy_complex_request) override; |
| 485 | 491 |
| 492 std::set<mach_msg_id_t> MachMessageServerRequestIDs() override; |
| 493 |
| 486 mach_msg_size_t MachMessageServerRequestSize() override; | 494 mach_msg_size_t MachMessageServerRequestSize() override; |
| 487 mach_msg_size_t MachMessageServerReplySize() override; | 495 mach_msg_size_t MachMessageServerReplySize() override; |
| 488 | 496 |
| 489 // internal::SimplifiedExcServer::Interface: | 497 // internal::SimplifiedExcServer::Interface: |
| 490 | 498 |
| 491 kern_return_t CatchException(exception_behavior_t behavior, | 499 kern_return_t CatchException(exception_behavior_t behavior, |
| 492 exception_handler_t exception_port, | 500 exception_handler_t exception_port, |
| 493 thread_t thread, | 501 thread_t thread, |
| 494 task_t task, | 502 task_t task, |
| 495 exception_type_t exception, | 503 exception_type_t exception, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 //! \a behavior is not a state-carrying behavior, or when it is a | 616 //! \a behavior is not a state-carrying behavior, or when it is a |
| 609 //! state-carrying behavior and \a set_thread_state is `true`. | 617 //! state-carrying behavior and \a set_thread_state is `true`. |
| 610 //! `MACH_RCV_PORT_DIED` is used when \a behavior is a state-carrying | 618 //! `MACH_RCV_PORT_DIED` is used when \a behavior is a state-carrying |
| 611 //! behavior and \a set_thread_state is `false`. | 619 //! behavior and \a set_thread_state is `false`. |
| 612 kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, | 620 kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, |
| 613 bool set_thread_state); | 621 bool set_thread_state); |
| 614 | 622 |
| 615 } // namespace crashpad | 623 } // namespace crashpad |
| 616 | 624 |
| 617 #endif // CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ | 625 #endif // CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ |
| OLD | NEW |