Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 | 21 |
| 22 #include "base/mac/scoped_mach_port.h" | 22 #include "base/mac/scoped_mach_port.h" |
| 23 #include "util/mach/exc_server_variants.h" | 23 #include "util/mach/exc_server_variants.h" |
| 24 | 24 |
| 25 namespace crashpad { | 25 namespace crashpad { |
| 26 | 26 |
| 27 //! \brief Runs the main exception-handling server in Crashpad’s handler | 27 //! \brief Runs the main exception-handling server in Crashpad’s handler |
| 28 //! process. | 28 //! process. |
| 29 class ExceptionHandlerServer { | 29 class ExceptionHandlerServer { |
| 30 public: | 30 public: |
| 31 ExceptionHandlerServer(); | 31 explicit ExceptionHandlerServer( |
|
Robert Sesek
2015/10/29 21:04:00
No comment?
Mark Mentovai
2015/10/29 21:39:58
Robert Sesek wrote:
| |
| 32 base::mac::ScopedMachReceiveRight receive_port); | |
| 32 ~ExceptionHandlerServer(); | 33 ~ExceptionHandlerServer(); |
| 33 | 34 |
| 34 //! \brief Runs the exception-handling server. | 35 //! \brief Runs the exception-handling server. |
| 35 //! | 36 //! |
| 36 //! \param[in] exception_interface An object to send exception messages to. | 37 //! \param[in] exception_interface An object to send exception messages to. |
| 37 //! | 38 //! |
| 38 //! This method monitors receive_port() for exception messages and no-senders | 39 //! This method monitors receive_port() for exception messages and no-senders |
| 39 //! notifications. It continues running until it has no more clients, | 40 //! notifications. It continues running until it has no more clients, |
| 40 //! indicated by the receipt of a no-senders notification. It is important to | 41 //! indicated by the receipt of a no-senders notification. It is important to |
| 41 //! assure that a send right has been transferred to a client (or queued by | 42 //! assure that a send right has been transferred to a client (or queued by |
| 42 //! `mach_msg()` to be sent to a client) prior to calling this method, or it | 43 //! `mach_msg()` to be sent to a client) prior to calling this method, or it |
| 43 //! will detect that it is sender-less and return immediately. | 44 //! will detect that it is sender-less and return immediately. |
| 44 //! | 45 //! |
| 45 //! All exception messages will be passed to \a exception_interface. | 46 //! All exception messages will be passed to \a exception_interface. |
| 46 //! | 47 //! |
| 47 //! This method must only be called once on an ExceptionHandlerServer object. | 48 //! This method must only be called once on an ExceptionHandlerServer object. |
| 48 //! | 49 //! |
| 49 //! If an unexpected condition that prevents this method from functioning is | 50 //! If an unexpected condition that prevents this method from functioning is |
| 50 //! encountered, it will log a message and terminate execution. Receipt of an | 51 //! encountered, it will log a message and terminate execution. Receipt of an |
| 51 //! invalid message on receive_port() will cause a message to be logged, but | 52 //! invalid message on receive_port() will cause a message to be logged, but |
| 52 //! this method will continue running normally. | 53 //! this method will continue running normally. |
| 53 void Run(UniversalMachExcServer::Interface* exception_interface); | 54 void Run(UniversalMachExcServer::Interface* exception_interface); |
| 54 | 55 |
| 55 //! \brief Returns the receive right that will be monitored for exception | |
| 56 //! messages. | |
| 57 //! | |
| 58 //! The caller does not take ownership of this port. The caller must not use | |
| 59 //! this port for any purpose other than to make send rights for clients. | |
| 60 mach_port_t receive_port() const { return receive_port_.get(); } | |
| 61 | |
| 62 private: | 56 private: |
| 63 base::mac::ScopedMachReceiveRight receive_port_; | 57 base::mac::ScopedMachReceiveRight receive_port_; |
| 64 | 58 |
| 65 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer); | 59 DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer); |
| 66 }; | 60 }; |
| 67 | 61 |
| 68 } // namespace crashpad | 62 } // namespace crashpad |
| 69 | 63 |
| 70 #endif // CRASHPAD_HANDLER_MAC_EXCEPTION_HANDLER_SERVER_H_ | 64 #endif // CRASHPAD_HANDLER_MAC_EXCEPTION_HANDLER_SERVER_H_ |
| OLD | NEW |