DescriptionMake HostController/DeviceListener deletion fully synchronous.
These classes are responsible for creating Forwarder instances that operate on
their own thread. The Forwarder class used to self-delete independently of its
creator (HostController/DeviceListener) lifecycle. This could have led to
Forwarder instances still operating although HostController/DeviceListener were
deleted.
r229931 recently added support for adb port unmapping once there is no
HostController instance anymore operating for a specific device. This change
assumed (very reasonably) that ~HostController() was fully synchronous which
was unfortunately not the case.
This CL makes the Forwarder instances now explicitly owned by their creator.
This is not as trivial as it sounds since the Forwarder instance creators
(HostController and DeviceListener) live on a thread other than the one
Forwarder instances are created on.
This complexity is encapsulated into the new ForwardersManager class that
creates and manages the lifecycle (e.g. explicit destruction or destruction on
error) of a set of Forwarder instances. This class is used both by
HostController and DeviceListener.
BUG=313809
R=digit@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245895
Patch Set 1 #Patch Set 2 : #Patch Set 3 : #Patch Set 4 : #Patch Set 5 : #Patch Set 6 : Factor out Forwarder instances management #Patch Set 7 : #Patch Set 8 : #Patch Set 9 : #Patch Set 10 : #Patch Set 11 : #Patch Set 12 : #Patch Set 13 : #
Total comments: 2
Patch Set 14 : Rebase #Patch Set 15 : Rebase #Patch Set 16 : #Messages
Total messages: 9 (0 generated)
|