Crashpad
|
Tracks whether data are initialized. More...
#include "util/misc/initialization_state.h"
Public Types | |
enum | State : uint8_t |
The object’s state. More... | |
Public Member Functions | |
bool | is_uninitialized () const |
Returns true if the object’s state is kStateUninitialized and it is safe to begin initializing it. | |
void | set_invalid () |
Sets the object’s state to kStateInvalid, marking initialization as being in process. | |
void | set_valid () |
Sets the object’s state to kStateValid, marking it initialized. | |
bool | is_valid () const |
Returns true if the the object’s state is kStateValid and it has been fully initialized and may be used. | |
Protected Member Functions | |
State | state () const |
Returns the object’s state. More... | |
void | set_state (State state) |
Sets the object’s state. More... | |
Tracks whether data are initialized.
Objects of this type track whether the data they’re guarding are initialized. The three possible states are uninitialized (the initial state), initializing, and valid. As the guarded data are initialized, an InitializationState object will normally transition through these three states. A fourth state corresponds to the destruction of objects of this type, making it less likely that a use-after-free of an InitializationState object will appear in the valid state.
If the only purpose for tracking the initialization state of guarded data is to DCHECK when the object is in an unexpected state, use InitializationStateDcheck instead.
enum crashpad::InitializationState::State : uint8_t |
The object’s state.
|
inlineprotected |
Sets the object’s state.
Consumers of this class should use a set_state_*() method instead.
|
inlineprotected |
Returns the object’s state.
Consumers of this class should use an is_state_*() method instead.