| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 const natural_t* old_state, | 93 const natural_t* old_state, |
| 94 mach_msg_type_number_t old_state_count, | 94 mach_msg_type_number_t old_state_count, |
| 95 thread_state_t new_state, | 95 thread_state_t new_state, |
| 96 mach_msg_type_number_t* new_state_count, | 96 mach_msg_type_number_t* new_state_count, |
| 97 bool* destroy_request) = 0; | 97 bool* destroy_request) = 0; |
| 98 | 98 |
| 99 protected: | 99 protected: |
| 100 ~Interface() {} | 100 ~Interface() {} |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 //! \brief Constructs an object of this class. |
| 104 //! |
| 105 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 103 explicit ExcServer(Interface* interface); | 106 explicit ExcServer(Interface* interface); |
| 104 | 107 |
| 105 // MachMessageServer::Interface: | 108 // MachMessageServer::Interface: |
| 106 | 109 |
| 107 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 110 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 108 mach_msg_header_t* out_header, | 111 mach_msg_header_t* out_header, |
| 109 bool* destroy_complex_request) override; | 112 bool* destroy_complex_request) override; |
| 110 | 113 |
| 111 mach_msg_size_t MachMessageServerRequestSize() override; | 114 mach_msg_size_t MachMessageServerRequestSize() override; |
| 112 mach_msg_size_t MachMessageServerReplySize() override; | 115 mach_msg_size_t MachMessageServerReplySize() override; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 const natural_t* old_state, | 185 const natural_t* old_state, |
| 183 mach_msg_type_number_t old_state_count, | 186 mach_msg_type_number_t old_state_count, |
| 184 thread_state_t new_state, | 187 thread_state_t new_state, |
| 185 mach_msg_type_number_t* new_state_count, | 188 mach_msg_type_number_t* new_state_count, |
| 186 bool* destroy_request) = 0; | 189 bool* destroy_request) = 0; |
| 187 | 190 |
| 188 protected: | 191 protected: |
| 189 ~Interface() {} | 192 ~Interface() {} |
| 190 }; | 193 }; |
| 191 | 194 |
| 195 //! \brief Constructs an object of this class. |
| 196 //! |
| 197 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 192 explicit MachExcServer(Interface* interface); | 198 explicit MachExcServer(Interface* interface); |
| 193 | 199 |
| 194 // MachMessageServer::Interface: | 200 // MachMessageServer::Interface: |
| 195 | 201 |
| 196 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 202 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 197 mach_msg_header_t* out_header, | 203 mach_msg_header_t* out_header, |
| 198 bool* destroy_complex_request) override; | 204 bool* destroy_complex_request) override; |
| 199 | 205 |
| 200 mach_msg_size_t MachMessageServerRequestSize() override; | 206 mach_msg_size_t MachMessageServerRequestSize() override; |
| 201 mach_msg_size_t MachMessageServerReplySize() override; | 207 mach_msg_size_t MachMessageServerReplySize() override; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 const natural_t* old_state, | 247 const natural_t* old_state, |
| 242 mach_msg_type_number_t old_state_count, | 248 mach_msg_type_number_t old_state_count, |
| 243 thread_state_t new_state, | 249 thread_state_t new_state, |
| 244 mach_msg_type_number_t* new_state_count, | 250 mach_msg_type_number_t* new_state_count, |
| 245 bool* destroy_complex_request) = 0; | 251 bool* destroy_complex_request) = 0; |
| 246 | 252 |
| 247 protected: | 253 protected: |
| 248 ~Interface() {} | 254 ~Interface() {} |
| 249 }; | 255 }; |
| 250 | 256 |
| 257 //! \brief Constructs an object of this class. |
| 258 //! |
| 259 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 251 explicit SimplifiedExcServer(Interface* interface); | 260 explicit SimplifiedExcServer(Interface* interface); |
| 252 | 261 |
| 253 // ExcServer::Interface: | 262 // ExcServer::Interface: |
| 254 | 263 |
| 255 kern_return_t CatchExceptionRaise(exception_handler_t exception_port, | 264 kern_return_t CatchExceptionRaise(exception_handler_t exception_port, |
| 256 thread_t thread, | 265 thread_t thread, |
| 257 task_t task, | 266 task_t task, |
| 258 exception_type_t exception, | 267 exception_type_t exception, |
| 259 const exception_data_type_t* code, | 268 const exception_data_type_t* code, |
| 260 mach_msg_type_number_t code_count, | 269 mach_msg_type_number_t code_count, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 const natural_t* old_state, | 343 const natural_t* old_state, |
| 335 mach_msg_type_number_t old_state_count, | 344 mach_msg_type_number_t old_state_count, |
| 336 thread_state_t new_state, | 345 thread_state_t new_state, |
| 337 mach_msg_type_number_t* new_state_count, | 346 mach_msg_type_number_t* new_state_count, |
| 338 bool* destroy_complex_request) = 0; | 347 bool* destroy_complex_request) = 0; |
| 339 | 348 |
| 340 protected: | 349 protected: |
| 341 ~Interface() {} | 350 ~Interface() {} |
| 342 }; | 351 }; |
| 343 | 352 |
| 353 //! \brief Constructs an object of this class. |
| 354 //! |
| 355 //! \param[in] interface The interface to dispatch requests to. Weak. |
| 344 explicit SimplifiedMachExcServer(Interface* interface); | 356 explicit SimplifiedMachExcServer(Interface* interface); |
| 345 | 357 |
| 346 // MachExcServer::Interface: | 358 // MachExcServer::Interface: |
| 347 | 359 |
| 348 kern_return_t CatchMachExceptionRaise(exception_handler_t exception_port, | 360 kern_return_t CatchMachExceptionRaise(exception_handler_t exception_port, |
| 349 thread_t thread, | 361 thread_t thread, |
| 350 task_t task, | 362 task_t task, |
| 351 exception_type_t exception, | 363 exception_type_t exception, |
| 352 const mach_exception_data_type_t* code, | 364 const mach_exception_data_type_t* code, |
| 353 mach_msg_type_number_t code_count, | 365 mach_msg_type_number_t code_count, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 //! field, from `exception_data_type_t` to `mach_exception_data_type_t`. | 407 //! field, from `exception_data_type_t` to `mach_exception_data_type_t`. |
| 396 //! This is achieved by implementing SimplifiedExcServer::Interface and having | 408 //! This is achieved by implementing SimplifiedExcServer::Interface and having |
| 397 //! it forward translated messages to SimplifiedMachExcServer::Interface, which | 409 //! it forward translated messages to SimplifiedMachExcServer::Interface, which |
| 398 //! is left unimplemented here so that users of this class can provide their own | 410 //! is left unimplemented here so that users of this class can provide their own |
| 399 //! implementations. | 411 //! implementations. |
| 400 class UniversalMachExcServer | 412 class UniversalMachExcServer |
| 401 : public MachMessageServer::Interface, | 413 : public MachMessageServer::Interface, |
| 402 public internal::SimplifiedExcServer::Interface, | 414 public internal::SimplifiedExcServer::Interface, |
| 403 public internal::SimplifiedMachExcServer::Interface { | 415 public internal::SimplifiedMachExcServer::Interface { |
| 404 public: | 416 public: |
| 417 //! \brief Constructs an object of this class. |
| 405 UniversalMachExcServer(); | 418 UniversalMachExcServer(); |
| 406 | 419 |
| 407 // MachMessageServer::Interface: | 420 // MachMessageServer::Interface: |
| 408 | 421 |
| 409 bool MachMessageServerFunction(const mach_msg_header_t* in_header, | 422 bool MachMessageServerFunction(const mach_msg_header_t* in_header, |
| 410 mach_msg_header_t* out_header, | 423 mach_msg_header_t* out_header, |
| 411 bool* destroy_complex_request) override; | 424 bool* destroy_complex_request) override; |
| 412 | 425 |
| 413 mach_msg_size_t MachMessageServerRequestSize() override; | 426 mach_msg_size_t MachMessageServerRequestSize() override; |
| 414 mach_msg_size_t MachMessageServerReplySize() override; | 427 mach_msg_size_t MachMessageServerReplySize() override; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 //! \a behavior is not a state-carrying behavior, or when it is a | 529 //! \a behavior is not a state-carrying behavior, or when it is a |
| 517 //! state-carrying behavior and \a set_thread_state is `true`. | 530 //! state-carrying behavior and \a set_thread_state is `true`. |
| 518 //! `MACH_RCV_PORT_DIED` is used when \a behavior is a state-carrying | 531 //! `MACH_RCV_PORT_DIED` is used when \a behavior is a state-carrying |
| 519 //! behavior and \a set_thread_state is `false`. | 532 //! behavior and \a set_thread_state is `false`. |
| 520 kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, | 533 kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior, |
| 521 bool set_thread_state); | 534 bool set_thread_state); |
| 522 | 535 |
| 523 } // namespace crashpad | 536 } // namespace crashpad |
| 524 | 537 |
| 525 #endif // CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ | 538 #endif // CRASHPAD_UTIL_MACH_EXC_SERVER_VARIANTS_H_ |
| OLD | NEW |