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

Issue 1389553002: bluetooth: Detect and fix incorrect thread usage of BluetoothDispatcherHost. (Closed)

Created:
5 years, 2 months ago by scheib
Modified:
5 years, 2 months ago
Reviewers:
ortuno, qinmin
CC:
chromium-reviews, asanka, darin-cc_chromium.org, benjhayden+dwatch_chromium.org, jam, scheib+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bluetooth: Detect and fix incorrect thread usage of BluetoothDispatcherHost. Android GATT connection state changes may arrive on threads other than UI. However, this wasn't previously detected. This patch adds a WeakPtr instance to ensure all future WeakPtrs created by the factory enforce UI thread usage. Android device implementation is adjusted to run callbacks from UI thread. The nature of WeakPtr has been more clearly documented here: https://codereview.chromium.org/1384863002/ BUG=537471 Committed: https://crrev.com/0e9bbf5fff69296187af509f460b813fc6c64e67 Cr-Commit-Position: refs/heads/master@{#352462}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address qinmin #

Patch Set 3 : DCHECK_CURRENTLY_ON(BrowserThread::UI); #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -17 lines) Patch
M content/browser/bluetooth/bluetooth_dispatcher_host.h View 1 1 chunk +4 lines, -1 line 0 comments Download
M content/browser/bluetooth/bluetooth_dispatcher_host.cc View 1 2 21 chunks +32 lines, -11 lines 0 comments Download
M device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java View 1 2 chunks +11 lines, -5 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 12 (3 generated)
scheib
qinmin: Please check my thread hopping in device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothDevice.java ortuno: PTAL overall.
5 years, 2 months ago (2015-10-04 04:30:16 UTC) #2
qinmin
https://codereview.chromium.org/1389553002/diff/1/content/browser/bluetooth/bluetooth_dispatcher_host.cc File content/browser/bluetooth/bluetooth_dispatcher_host.cc (right): https://codereview.chromium.org/1389553002/diff/1/content/browser/bluetooth/bluetooth_dispatcher_host.cc#newcode182 content/browser/bluetooth/bluetooth_dispatcher_host.cc:182: weak_ptr_factory_.GetWeakPtr())); use weak_ptr_on_ui_thread_ and everywhere else in this file? ...
5 years, 2 months ago (2015-10-05 18:38:54 UTC) #3
scheib
https://codereview.chromium.org/1389553002/diff/1/content/browser/bluetooth/bluetooth_dispatcher_host.cc File content/browser/bluetooth/bluetooth_dispatcher_host.cc (right): https://codereview.chromium.org/1389553002/diff/1/content/browser/bluetooth/bluetooth_dispatcher_host.cc#newcode182 content/browser/bluetooth/bluetooth_dispatcher_host.cc:182: weak_ptr_factory_.GetWeakPtr())); On 2015/10/05 18:38:54, qinmin wrote: > use weak_ptr_on_ui_thread_ ...
5 years, 2 months ago (2015-10-05 21:01:34 UTC) #4
ortuno
LGTM. Does it make sense to add the DCHECK_CURRENTLY_ONs in this patch as well?
5 years, 2 months ago (2015-10-05 21:03:10 UTC) #5
qinmin
lgtm
5 years, 2 months ago (2015-10-05 21:33:29 UTC) #6
scheib
On 2015/10/05 21:03:10, ortuno wrote: > LGTM. Does it make sense to add the DCHECK_CURRENTLY_ONs ...
5 years, 2 months ago (2015-10-05 21:45:12 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1389553002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1389553002/40001
5 years, 2 months ago (2015-10-05 21:47:19 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 2 months ago (2015-10-05 23:36:01 UTC) #11
commit-bot: I haz the power
5 years, 2 months ago (2015-10-05 23:36:54 UTC) #12
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/0e9bbf5fff69296187af509f460b813fc6c64e67
Cr-Commit-Position: refs/heads/master@{#352462}

Powered by Google App Engine
This is Rietveld 408576698