Chromium Code Reviews| 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 <stdint.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 at their defaults. | |
| 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 non-default value will provide each option | |
| 36 //! value. Different modules may provide values for different options. If every | |
| 37 //! module in the process specifies the default for an option, it will appear at | |
| 38 //! its default. If no module in the process has a CrashpadInfo structure, all | |
| 39 //! option values will appear at their defaults. | |
| 40 struct CrashpadInfoClientOptions { | |
| 41 public: | |
| 42 //! \brief Options to enable and disable features. | |
| 43 //! | |
| 44 //! Values of this type are produced from CrashpadInfo structures by | |
| 45 //! TriStateFromCrashpadInfo(). | |
| 46 //! | |
| 47 //! \sa CrashpadInfo::TriState | |
| 48 enum class TriState : uint8_t { | |
|
Robert Sesek
2015/03/11 19:25:30
This could be moved into util/ and then it wouldn'
Mark Mentovai
2015/03/11 19:45:53
Robert Sesek wrote:
| |
| 49 //! \brief No special behavior is requested, and the defaults are desired. | |
| 50 kDefault = 0, | |
| 51 | |
| 52 //! \brief The behavior should be enabled. | |
| 53 kEnabled, | |
| 54 | |
| 55 //! \brief The behavior should be disabled. | |
| 56 kDisabled, | |
| 57 }; | |
| 58 | |
| 59 //! \brief Converts a CrashpadInfo::TriState value to a TriState value. | |
| 60 //! | |
| 61 //! The process_types layer exposes CrashpadInfo::TriState as a `uint8_t` | |
| 62 //! rather than an enum type. This function converts these values into the | |
| 63 //! equivalent enum values used in the snapshot layer. | |
| 64 //! | |
| 65 //! \return The TriState equivalent of \a crashpad_info_tri_state, if it is a | |
| 66 //! valid CrashpadInfo::TriState value. Otherwise, logs a warning and | |
| 67 //! returns TriState::kDefault. | |
| 68 static TriState TriStateFromCrashpadInfo(uint8_t crashpad_info_tri_state); | |
| 69 | |
| 70 CrashpadInfoClientOptions(); | |
| 71 | |
| 72 //! \sa CrashpadInfo::set_crashpad_handler_behavior() | |
| 73 TriState crashpad_handler_behavior; | |
| 74 | |
| 75 //! \sa CrashpadInfo::set_system_crash_reporter_forwarding() | |
| 76 TriState system_crash_reporter_forwarding; | |
| 77 }; | |
| 78 | |
| 79 } // namespace crashpad | |
| 80 | |
| 81 #endif // CRASHPAD_SNAPSHOT_MAC_CRASHPAD_INFO_CLIENT_OPTIONS_H_ | |
| OLD | NEW |