OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Crashpad Authors. All rights reserved. |
| 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (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 |
| 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. |
| 14 |
| 15 #ifndef CRASHPAD_SNAPSHOT_MAC_CRASHPAD_INFO_CLIENT_OPTIONS_H_ |
| 16 #define CRASHPAD_SNAPSHOT_MAC_CRASHPAD_INFO_CLIENT_OPTIONS_H_ |
| 17 |
| 18 #include "util/misc/tri_state.h" |
| 19 |
| 20 namespace crashpad { |
| 21 |
| 22 //! \brief Options represented in a client’s CrashpadInfo structure. |
| 23 //! |
| 24 //! The CrashpadInfo structure is not suitable to expose client options |
| 25 //! in a generic way at the snapshot level. This structure duplicates |
| 26 //! option-related fields from the client structure for general use within the |
| 27 //! snapshot layer and by users of this layer. |
| 28 //! |
| 29 //! For objects of this type corresponding to a module, option values are taken |
| 30 //! from the module’s CrashpadInfo structure directly. If the module has no such |
| 31 //! such structure, option values appear unset. |
| 32 //! |
| 33 //! For objects of this type corresponding to an entire process, option values |
| 34 //! are taken from the CrashpadInfo structures of modules within the process. |
| 35 //! The first module found with a set value (enabled or disabled) will provide |
| 36 //! an option value for the process. Different modules may provide values for |
| 37 //! different options. If no module in the process sets a value for an option, |
| 38 //! the option will appear unset for the process. If no module in the process |
| 39 //! has a CrashpadInfo structure, all option values will appear unset. |
| 40 struct CrashpadInfoClientOptions { |
| 41 public: |
| 42 //! \brief Converts `uint8_t` value to a TriState value. |
| 43 //! |
| 44 //! The process_types layer exposes TriState as a `uint8_t` rather than an |
| 45 //! enum type. This function converts these values into the equivalent enum |
| 46 //! values used in the snapshot layer. |
| 47 //! |
| 48 //! \return The TriState equivalent of \a crashpad_info_tri_state, if it is a |
| 49 //! valid TriState value. Otherwise, logs a warning and returns |
| 50 //! TriState::kUnset. |
| 51 static TriState TriStateFromCrashpadInfo(uint8_t crashpad_info_tri_state); |
| 52 |
| 53 CrashpadInfoClientOptions(); |
| 54 |
| 55 //! \sa CrashpadInfo::set_crashpad_handler_behavior() |
| 56 TriState crashpad_handler_behavior; |
| 57 |
| 58 //! \sa CrashpadInfo::set_system_crash_reporter_forwarding() |
| 59 TriState system_crash_reporter_forwarding; |
| 60 }; |
| 61 |
| 62 } // namespace crashpad |
| 63 |
| 64 #endif // CRASHPAD_SNAPSHOT_MAC_CRASHPAD_INFO_CLIENT_OPTIONS_H_ |
OLD | NEW |