[CrOS Tether] Disconnect cleanly from active Tether networks when the user logs out or the Tether component is killed

Desktop / Chromium - khorimoto [chromium.org] - 12 July 2017 16:19 EDT

Under normal circumstances, when a user disconnects from a Tether network, we start up an asynchronous connection flow. However, when these two edge cases occur, the Tether component is destroyed synchronously, and the full disconnection flow cannot complete (namely, the old Wi-Fi network supporting the Tether network is not removed). This CL fixes this problem by persisting the disconnecting Wi-Fi network GUID and removing it next time the Tether componentn starts up.

This CL also: (1) Changes TetherDisconnector to an interface and moves the implementation to TetherDisconnectorImpl to make testing easier. (2) Updates the shutdown flow for the Tether component by leaving the Tether TechnologyState intact during shutdown to prevent UI jank.

BUG=672263

Review-Url: https://codereview.chromium.org/2975483002 Cr-Commit-Position: refs/heads/master@{#486072}

73dc567 [CrOS Tether] Disconnect cleanly from active Tether networks when the user logs out or the Tether component is killed.
chrome/browser/chromeos/tether/tether_service.cc | 7 +-
.../chromeos/tether/tether_service_unittest.cc | 10 +-
chromeos/components/tether/BUILD.gn | 5 +-
.../components/tether/fake_tether_host_fetcher.h | 9 +-
chromeos/components/tether/initializer.cc | 7 +-
..._connection_handler_tether_delegate_unittest.cc | 10 +-
chromeos/components/tether/pref_names.cc | 3 +
chromeos/components/tether/pref_names.h | 11 ++
chromeos/components/tether/tether_disconnector.h | 78 +--------
...disconnector.cc => tether_disconnector_impl.cc} | 85 +++++++--
.../components/tether/tether_disconnector_impl.h | 113 ++++++++++++
...est.cc => tether_disconnector_impl_unittest.cc} | 192 +++++++++++++++------
12 files changed, 371 insertions(+), 159 deletions(-)

Upstream: git.chromium.org


  • Share