class InitializationState

Defined at line 36 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

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.

Public Methods

void InitializationState ()

Defined at line 58 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

void InitializationState (State state)

Defined at line 59 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

void InitializationState (const InitializationState & )

Defined at line 61 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

InitializationState & operator= (const InitializationState & )

Defined at line 62 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

void ~InitializationState ()

Defined at line 64 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

bool is_uninitialized ()

Returns `true` if the object’s state is #kStateUninitialized and it

is safe to begin initializing it.

Defined at line 68 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

void set_invalid ()

Sets the object’s state to #kStateInvalid, marking initialization

as being in process.

Defined at line 72 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

void set_valid ()

Sets the object’s state to #kStateValid, marking it initialized.

Defined at line 75 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

bool is_valid ()

Returns `true` if the the object’s state is #kStateValid and it has

been fully initialized and may be used.

Defined at line 79 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

Protected Methods

State state ()

Returns the object’s state.

Consumers of this class should use an is_state_*() method instead.

Defined at line 85 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

void set_state (State state)

Sets the object’s state.

Consumers of this class should use a set_state_*() method instead.

Defined at line 90 of file ../../third_party/crashpad/src/util/misc/initialization_state.h

Enumerations

enum State
Name Value
kStateUninitialized 0
kStateInvalid 1
kStateValid 2
kStateDestroyed 3

The object’s state.

Defined at line 39 of file ../../third_party/crashpad/src/util/misc/initialization_state.h