DescriptionServiceManager: Simplify Instance lifetime management
Makes Instance ownership and lifetime management easier to
follow. Root instances are now explicitly owned by the
ServiceManager and non-root instances are explicitly owned by
their parent Instance.
OnInstanceError always destroys the Instance, either by
removing it from the root instance set or delegating to the parent
Instance. This avoids the need for children to re-enter their
parent on destruction.
Notification logic has been extracted from OnInstanceError and
moved to a new OnInstanceStopped, which is always called by
each Instance's destructor. This allows parents to delete their
own children without calling through to OnInstanceError, while
still allowing the ServiceManager to know about the destruction
and dispatch notifications accordingly.
InstanceErrorType is removed: if an Instance becomes
unreachable it's simply removed from the identity map
via a new OnInstanceUnreachable call.
BUG=640488
Committed: https://crrev.com/262a9e00334328804c7515ba4e2f840aee8ec681
Cr-Commit-Position: refs/heads/master@{#418643}
Patch Set 1 #Patch Set 2 : . #
Messages
Total messages: 17 (12 generated)
|