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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 //! have inherited it as their exception handler even after the process that | 115 //! have inherited it as their exception handler even after the process that |
116 //! called StartHandler() exits. | 116 //! called StartHandler() exits. |
117 //! | 117 //! |
118 //! On Windows, this method sets the unhandled exception handler to a local | 118 //! On Windows, this method sets the unhandled exception handler to a local |
119 //! function that when reached will "signal and wait" for the crash handler | 119 //! function that when reached will "signal and wait" for the crash handler |
120 //! process to create the dump. | 120 //! process to create the dump. |
121 //! | 121 //! |
122 //! \return `true` on success, `false` on failure with a message logged. | 122 //! \return `true` on success, `false` on failure with a message logged. |
123 bool UseHandler(); | 123 bool UseHandler(); |
124 | 124 |
| 125 #if defined(OS_MACOSX) || DOXYGEN |
| 126 //! \brief Configures the process to direct its crashes to the default handler |
| 127 //! for the operating system. |
| 128 //! |
| 129 //! On OS X, this sets the task’s exception port as in UseHandler(), but the |
| 130 //! exception handler used is obtained from SystemCrashReporterHandler(). If |
| 131 //! the system’s crash reporter handler cannot be determined, the task’s |
| 132 //! exception ports for crash-type exceptions are cleared. |
| 133 //! |
| 134 //! Use of this function is strongly discouraged. |
| 135 //! |
| 136 //! \warning After a successful call to this function, Crashpad will no longer |
| 137 //! monitor the process for crashes until a subsequent call to |
| 138 //! UseHandler(). |
| 139 //! |
| 140 //! \note This is provided as a static function to allow it to be used in |
| 141 //! situations where a CrashpadClient object is not otherwise available. |
| 142 //! This may be useful when a child process inherits its parent’s Crashpad |
| 143 //! handler, but wants to sever this tie. |
| 144 //! |
| 145 //! \return `true` on success, `false` on failure with a message logged. |
| 146 static bool UseSystemDefaultHandler(); |
| 147 #endif |
| 148 |
125 private: | 149 private: |
126 #if defined(OS_MACOSX) | 150 #if defined(OS_MACOSX) |
127 base::mac::ScopedMachSendRight exception_port_; | 151 base::mac::ScopedMachSendRight exception_port_; |
128 #endif | 152 #endif |
129 | 153 |
130 DISALLOW_COPY_AND_ASSIGN(CrashpadClient); | 154 DISALLOW_COPY_AND_ASSIGN(CrashpadClient); |
131 }; | 155 }; |
132 | 156 |
133 } // namespace crashpad | 157 } // namespace crashpad |
134 | 158 |
135 #endif // CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_ | 159 #endif // CRASHPAD_CLIENT_CRASHPAD_CLIENT_H_ |
OLD | NEW |