Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(877)

Issue 60033002: Make HostController/DeviceListener deletion fully synchronous. (Closed)

Created:
7 years, 1 month ago by Philippe
Modified:
6 years, 11 months ago
Reviewers:
bulach, digit1
CC:
chromium-reviews, craigdh+watch_chromium.org, bulach+watch_chromium.org, yfriedman+watch_chromium.org, ilevy-cc_chromium.org, klundberg+watch_chromium.org, frankf+watch_chromium.org
Visibility:
Public.

Description

Make 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 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -115 lines) Patch
M tools/android/forwarder2/device_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M tools/android/forwarder2/device_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -3 lines 0 comments Download
M tools/android/forwarder2/device_listener.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +9 lines, -9 lines 0 comments Download
M tools/android/forwarder2/device_listener.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +9 lines, -13 lines 0 comments Download
M tools/android/forwarder2/forwarder.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +37 lines, -1 line 0 comments Download
M tools/android/forwarder2/forwarder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +62 lines, -67 lines 0 comments Download
M tools/android/forwarder2/forwarder.gyp View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
A tools/android/forwarder2/forwarders_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +76 lines, -0 lines 0 comments Download
A tools/android/forwarder2/forwarders_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +91 lines, -0 lines 0 comments Download
M tools/android/forwarder2/host_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +13 lines, -6 lines 0 comments Download
M tools/android/forwarder2/host_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 chunks +4 lines, -15 lines 0 comments Download
M tools/android/forwarder2/self_deleter_helper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Philippe
FYI, this should be ready for review now. Not that it depends on https://codereview.chromium.org/68893013/. I ...
7 years, 1 month ago (2013-11-13 10:17:40 UTC) #1
digit1
https://chromiumcodereview.appspot.com/60033002/diff/560001/tools/android/forwarder2/device_listener.cc File tools/android/forwarder2/device_listener.cc (right): https://chromiumcodereview.appspot.com/60033002/diff/560001/tools/android/forwarder2/device_listener.cc#newcode134 tools/android/forwarder2/device_listener.cc:134: AssertIsRunningOnInternalThread(); Following of face-to-face discussion, please add a comment ...
7 years, 1 month ago (2013-11-14 09:50:04 UTC) #2
Philippe
FYI David, I rebased this on ToT + your patch (being CQ'ed I believe).
7 years, 1 month ago (2013-11-14 16:22:01 UTC) #3
Philippe
FYI David, I've just rebased this CL and it's also adding the PipeNotifier back (to ...
6 years, 11 months ago (2014-01-17 15:12:43 UTC) #4
digit1
rubberstamp lgtm :-) Thanks.
6 years, 11 months ago (2014-01-17 15:47:02 UTC) #5
Philippe
Thanks David! Monday would be a more appropriate time to submit this though :) On ...
6 years, 11 months ago (2014-01-17 16:35:58 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pliard@chromium.org/60033002/760001
6 years, 11 months ago (2014-01-20 08:38:40 UTC) #7
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=45507
6 years, 11 months ago (2014-01-20 08:54:45 UTC) #8
Philippe
6 years, 11 months ago (2014-01-20 10:38:29 UTC) #9
Message was sent while issue was closed.
Committed patchset #16 manually as r245895.

Powered by Google App Engine
This is Rietveld 408576698