class NodeShutdownCoordinator
Defined at line 82 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.h
Coordinates and keeps track of the node's shutdown process.
Public Methods
void NodeShutdownCoordinator (std::string_view name, NodeShutdownBridge * bridge, async_dispatcher_t * dispatcher, bool enable_test_shutdown_delays, std::weak_ptr<std::mt19937> rng_gen)
Defined at line 21 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void ~NodeShutdownCoordinator ()
Defined at line 88 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.h
const char * NodeStateAsString (NodeState state)
Defined at line 275 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void Remove (std::shared_ptr<Node> node, RemovalSet removal_set, NodeRemovalTracker * removal_tracker)
Begin the removal process for a Node. This function ensures that a Node is
only removed after all of its children are removed. It also ensures that
a Node is only removed after the driver that is bound to it has been stopped.
This is safe to call multiple times.
There are multiple reasons a Node's removal will be started:
- The system is being stopped.
- The Node had an unexpected error or disconnect
During a system stop, Remove is expected to be called twice:
once with |removal_set| == kPackage, and once with |removal_set| == kAll.
Errors and disconnects that are unrecoverable should call Remove(kAll, nullptr).
Defined at line 32 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void ResetShutdown ()
Reset the shutdown values. Should only be called after shutdown is complete.
Defined at line 101 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void CheckNodeState ()
Functions that check and transition the node's state.
Defined at line 109 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
const char * NodeStateAsString ()
Defined at line 127 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.h
NodeState node_state ()
Defined at line 131 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.h
void set_shutdown_intent (ShutdownIntent intent)
TODO(https://fxbug.dev/42082343): Handle shutdown intent priority. Currently it's possible
for rebind or restart to override a a removal in process.
Defined at line 135 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.h
ShutdownIntent shutdown_intent ()
Defined at line 136 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.h
void CheckWaitingOnDriverBind ()
Defined at line 146 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void CheckWaitingOnChildren ()
Defined at line 159 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void CheckWaitingOnDriver ()
Defined at line 174 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void CheckWaitingOnDriverComponent ()
Defined at line 190 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void CheckStopped ()
Defined at line 205 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void CheckWaitingOnDestroy ()
Defined at line 225 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void PerformTransition (fit::function<void ()> action)
Invokes |action|, which is the actions for transitioning to the next
another state. If |kEnableShutdownDelay| is true and generates a randomized
delay, then the action is invoked asynchronously with the delay.
Defined at line 241 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void UpdateAndNotifyState (NodeState state)
Defined at line 259 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
void NotifyRemovalTracker ()
Defined at line 266 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc
bool IsShuttingDown ()
Defined at line 273 of file ../../src/devices/bin/driver_manager/shutdown/node_shutdown_coordinator.cc