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

Issue 848613003: bluetooth: Shutdown BluetoothAdapter before DBus on ChromeOS. (Closed)

Created:
5 years, 11 months ago by scheib
Modified:
5 years, 11 months ago
Reviewers:
armansito, stevenjb
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, nkostylev+watch_chromium.org, jam, darin-cc_chromium.org, jochen+watch_chromium.org, oshima+watch_chromium.org, mkwst+moarreviews-shell_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@lkcr
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bluetooth: Shutdown BluetoothAdapter before DBus on ChromeOS. The BluetoothAdapter is a lazy instance that may live due to references until the shutdown of the browser. On ChromeOS the adapter and related classes must release references to the DBusThreadManager before it is shutdown. This patch adds an explicit call for that shutdown. BUG=447387 Committed: https://crrev.com/5d49416fd60af9a9b7ee7e6d57835aa28ce9c909 Cr-Commit-Position: refs/heads/master@{#311986}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Limit shutdown to defined(CHROMEOS); add checks that methods aren't run after shutdown #

Total comments: 8

Patch Set 3 : Remove from BluetoothAdapter and use static_cast; comments. #

Patch Set 4 : unit test #

Total comments: 2

Patch Set 5 : MockBluetoothAdapter::OnDBusThreadManagerShutdown (and a rebase) #

Total comments: 4

Patch Set 6 : Rename back to Shutdown #

Patch Set 7 : --set-upstream-to=origin/master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -21 lines) Patch
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 2 3 4 5 2 chunks +2 lines, -7 lines 0 comments Download
M device/bluetooth/bluetooth_adapter.h View 1 2 3 4 5 1 chunk +8 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter.cc View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos.h View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos.cc View 1 2 3 4 5 34 chunks +68 lines, -14 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_factory.h View 1 2 3 4 5 1 chunk +6 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_factory.cc View 1 2 3 4 5 2 chunks +12 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_chromeos_unittest.cc View 1 2 3 4 5 1 chunk +70 lines, -0 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_adapter.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_adapter.cc View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (15 generated)
scheib
5 years, 11 months ago (2015-01-14 04:39:34 UTC) #2
stevenjb
Combining an explicit shutdown with a lazy initializer is awkward. Can we make initialization of ...
5 years, 11 months ago (2015-01-14 16:54:27 UTC) #4
scheib
On 2015/01/14 16:54:27, stevenjb wrote: > Combining an explicit shutdown with a lazy initializer is ...
5 years, 11 months ago (2015-01-14 17:27:29 UTC) #5
armansito
On 2015/01/14 17:27:29, scheib wrote: > On 2015/01/14 16:54:27, stevenjb wrote: > > Combining an ...
5 years, 11 months ago (2015-01-14 19:52:36 UTC) #6
armansito
https://codereview.chromium.org/848613003/diff/20001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/848613003/diff/20001/device/bluetooth/bluetooth_adapter.h#newcode193 device/bluetooth/bluetooth_adapter.h:193: virtual void Shutdown(); Again, should this just be a ...
5 years, 11 months ago (2015-01-14 19:52:43 UTC) #7
stevenjb
Taking a closer look at how BluetoothAdapter is created and use, I propose the following: ...
5 years, 11 months ago (2015-01-14 20:25:07 UTC) #8
armansito
On 2015/01/14 20:25:07, stevenjb wrote: > Taking a closer look at how BluetoothAdapter is created ...
5 years, 11 months ago (2015-01-14 20:29:32 UTC) #9
armansito
https://codereview.chromium.org/848613003/diff/20001/device/bluetooth/bluetooth_adapter_chromeos.cc File device/bluetooth/bluetooth_adapter_chromeos.cc (right): https://codereview.chromium.org/848613003/diff/20001/device/bluetooth/bluetooth_adapter_chromeos.cc#newcode78 device/bluetooth/bluetooth_adapter_chromeos.cc:78: is_shutdown_ = true; Here I would explicitly set present ...
5 years, 11 months ago (2015-01-14 20:49:04 UTC) #10
scheib
On 2015/01/14 20:29:32, armansito wrote: > On 2015/01/14 20:25:07, stevenjb wrote: > > Taking a ...
5 years, 11 months ago (2015-01-14 23:07:18 UTC) #11
scheib
https://codereview.chromium.org/848613003/diff/20001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/848613003/diff/20001/device/bluetooth/bluetooth_adapter.h#newcode193 device/bluetooth/bluetooth_adapter.h:193: virtual void Shutdown(); On 2015/01/14 19:52:43, armansito wrote: > ...
5 years, 11 months ago (2015-01-14 23:07:27 UTC) #12
stevenjb
lgtm https://codereview.chromium.org/848613003/diff/60001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/848613003/diff/60001/device/bluetooth/bluetooth_adapter.h#newcode194 device/bluetooth/bluetooth_adapter.h:194: virtual void OnDBusThreadManagerShutdown(); nit: We could make this ...
5 years, 11 months ago (2015-01-14 23:44:14 UTC) #15
armansito
https://codereview.chromium.org/848613003/diff/60001/device/bluetooth/bluetooth_adapter.cc File device/bluetooth/bluetooth_adapter.cc (right): https://codereview.chromium.org/848613003/diff/60001/device/bluetooth/bluetooth_adapter.cc#newcode31 device/bluetooth/bluetooth_adapter.cc:31: #endif Remove https://codereview.chromium.org/848613003/diff/60001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/848613003/diff/60001/device/bluetooth/bluetooth_adapter.h#newcode195 device/bluetooth/bluetooth_adapter.h:195: #endif ...
5 years, 11 months ago (2015-01-14 23:49:47 UTC) #16
scheib
keybuk, it (with a quick blame) appears you introduced BluetoothSocketChromeOSTest_ListenBeforeAdapterStart which validates that BluetoothAdapterChromeOS::CreateRfcommService can ...
5 years, 11 months ago (2015-01-14 23:50:04 UTC) #17
scheib
keybuk, it (with a quick blame) appears you introduced BluetoothSocketChromeOSTest_ListenBeforeAdapterStart which validates that BluetoothAdapterChromeOS::CreateRfcommService can ...
5 years, 11 months ago (2015-01-14 23:50:23 UTC) #19
keybuk
Because you can create services at any time, and adapters can come and go. The ...
5 years, 11 months ago (2015-01-14 23:56:59 UTC) #20
scheib
keybuk, nevermind, armansito and I are content with reading the code to see how this ...
5 years, 11 months ago (2015-01-15 00:03:40 UTC) #21
scheib
5 years, 11 months ago (2015-01-15 00:05:24 UTC) #23
scheib
jam: OWNERS for content/shell/DEPS content/shell/browser/shell_views.cc
5 years, 11 months ago (2015-01-15 00:07:52 UTC) #25
armansito
Can you please add a unit test for this to bluetooth_chromeos_unittest.cc?
5 years, 11 months ago (2015-01-15 00:09:03 UTC) #26
scheib
How much unit testing do you think we need. I've added a basic one. Would ...
5 years, 11 months ago (2015-01-15 18:30:24 UTC) #28
jam
https://codereview.chromium.org/848613003/diff/120001/content/shell/browser/shell_views.cc File content/shell/browser/shell_views.cc (right): https://codereview.chromium.org/848613003/diff/120001/content/shell/browser/shell_views.cc#newcode444 content/shell/browser/shell_views.cc:444: device::BluetoothAdapterFactory::OnDBusThreadManagerShutdown(); it seems a bit odd that content shell ...
5 years, 11 months ago (2015-01-15 23:24:13 UTC) #29
scheib
https://codereview.chromium.org/848613003/diff/120001/content/shell/browser/shell_views.cc File content/shell/browser/shell_views.cc (right): https://codereview.chromium.org/848613003/diff/120001/content/shell/browser/shell_views.cc#newcode444 content/shell/browser/shell_views.cc:444: device::BluetoothAdapterFactory::OnDBusThreadManagerShutdown(); On 2015/01/15 23:24:12, jam wrote: > it seems ...
5 years, 11 months ago (2015-01-16 17:41:53 UTC) #30
scheib
I've gone back to virtual dispatch, static casting fails with the MockBluetoothAdapter.
5 years, 11 months ago (2015-01-16 21:49:25 UTC) #34
armansito
https://codereview.chromium.org/848613003/diff/180001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/848613003/diff/180001/device/bluetooth/bluetooth_adapter.h#newcode200 device/bluetooth/bluetooth_adapter.h:200: void OnDBusThreadManagerShutdown(); If we're going to have this in ...
5 years, 11 months ago (2015-01-16 21:57:19 UTC) #35
scheib
https://codereview.chromium.org/848613003/diff/180001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/848613003/diff/180001/device/bluetooth/bluetooth_adapter.h#newcode200 device/bluetooth/bluetooth_adapter.h:200: void OnDBusThreadManagerShutdown(); On 2015/01/16 21:57:18, armansito wrote: > If ...
5 years, 11 months ago (2015-01-16 22:28:27 UTC) #37
armansito
lgtm
5 years, 11 months ago (2015-01-16 22:46:52 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/848613003/220001
5 years, 11 months ago (2015-01-16 23:15:44 UTC) #40
commit-bot: I haz the power
CLs for remote refs other than refs/pending/heads/master must contain NOTRY=true in order for the CQ ...
5 years, 11 months ago (2015-01-16 23:15:50 UTC) #42
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/848613003/240001
5 years, 11 months ago (2015-01-16 23:23:36 UTC) #44
commit-bot: I haz the power
Committed patchset #7 (id:240001)
5 years, 11 months ago (2015-01-17 00:18:43 UTC) #45
commit-bot: I haz the power
5 years, 11 months ago (2015-01-17 00:19:49 UTC) #46
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/5d49416fd60af9a9b7ee7e6d57835aa28ce9c909
Cr-Commit-Position: refs/heads/master@{#311986}

Powered by Google App Engine
This is Rietveld 408576698