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

Issue 2638653002: Bluetooth: macOS: DidModifyServices can happens while scanning (Closed)

Created:
3 years, 11 months ago by jlebel
Modified:
3 years, 7 months ago
CC:
chromium-reviews, mac-reviews_chromium.org, ortuno+watch_chromium.org, scheib+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Bluetooth: macOS: DidModifyServices can happens while scanning This patch is to fix this scenario: * Device: DidModifyServices notification - Chrome: Scan for primary services * Device: DidDiscoverServices - Chrome: Scan for characteristics * Device: DidModifyServices notification - Chrome: Scan for primary services * Device: DidDiscoverCharacteristics * Device: DidDiscoverServices - Chrome: Scan for characteristics * Device: DidDiscoverCharacteristics We need to wait until all the pending characteristic discoveries are done until we can start scanning for descriptors. We need to make sure descriptors are not ready if DidModifyServices notification is received while scanning for descriptors. Adding discovery_pending_count_ in BluetoothRemoteGattServiceMac and BluetoothRemoteGattCharacteristicMac. |is_discovery_complete_| can be set to true when discovery_pending_count_ is equal to 0. BUG=690204 Review-Url: https://codereview.chromium.org/2638653002 Cr-Commit-Position: refs/heads/master@{#469457} Committed: https://chromium.googlesource.com/chromium/src/+/74fe98e203e687c3c96f25128fc55e94981465a7

Patch Set 1 #

Patch Set 2 : Counter version #

Patch Set 3 : Merge from top of tree #

Patch Set 4 : Adding unit tests #

Patch Set 5 : Removing useless modification #

Total comments: 4

Patch Set 6 #

Patch Set 7 : More unit tests #

Total comments: 8

Patch Set 8 : Adding comments and Mac suffix #

Total comments: 5

Patch Set 9 : First and Mac suffix #

Patch Set 10 : Merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+488 lines, -76 lines) Patch
M device/bluetooth/bluetooth_device_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +24 lines, -12 lines 0 comments Download
M device/bluetooth/bluetooth_low_energy_device_mac.mm View 1 2 3 4 5 6 7 4 chunks +16 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm View 1 2 3 4 5 6 7 8 9 4 chunks +13 lines, -3 lines 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +121 lines, -5 lines 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_descriptor_unittest.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_service_mac.h View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_service_mac.mm View 1 2 3 4 5 6 7 5 chunks +23 lines, -4 lines 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_service_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +172 lines, -1 line 0 comments Download
M device/bluetooth/test/bluetooth_test_mac.h View 1 2 3 4 5 6 7 8 2 chunks +23 lines, -8 lines 0 comments Download
M device/bluetooth/test/bluetooth_test_mac.mm View 1 2 3 4 5 6 7 8 6 chunks +62 lines, -21 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h View 1 2 3 4 5 6 7 1 chunk +1 line, -2 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.mm View 1 2 3 4 5 6 7 3 chunks +4 lines, -9 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_cbperipheral_mac.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm View 1 2 3 4 5 6 7 3 chunks +14 lines, -6 lines 0 comments Download

Messages

Total messages: 58 (30 generated)
jlebel
Hello Vincent, Can you review this patch? Thanks,
3 years, 11 months ago (2017-01-15 21:57:58 UTC) #5
scheib
Please add a test to reproduces this.
3 years, 11 months ago (2017-01-17 18:37:57 UTC) #7
ortuno
Why is this needed? DiscoverCharacteristics and DiscoveryDescriptors should only be called once per Service/Characteristic.
3 years, 11 months ago (2017-01-19 23:54:21 UTC) #9
ortuno
Do we need tests for this?
3 years, 10 months ago (2017-02-09 00:38:08 UTC) #14
jlebel
On 2017/02/09 00:38:08, ortuno wrote: > Do we need tests for this? Tests are nicer. ...
3 years, 10 months ago (2017-02-09 00:54:34 UTC) #15
jlebel
On 2017/02/09 00:54:34, jlebel wrote: > On 2017/02/09 00:38:08, ortuno wrote: > > Do we ...
3 years, 8 months ago (2017-04-10 00:24:16 UTC) #17
scheib
Yay for tests! A few comment requests: https://codereview.chromium.org/2638653002/diff/120001/device/bluetooth/bluetooth_remote_gatt_service_unittest.cc File device/bluetooth/bluetooth_remote_gatt_service_unittest.cc (right): https://codereview.chromium.org/2638653002/diff/120001/device/bluetooth/bluetooth_remote_gatt_service_unittest.cc#newcode287 device/bluetooth/bluetooth_remote_gatt_service_unittest.cc:287: // Tests ...
3 years, 8 months ago (2017-04-10 20:55:54 UTC) #18
ortuno
Looking at how complex this is and how hard the code is to follow I ...
3 years, 8 months ago (2017-04-11 00:58:35 UTC) #19
jlebel
For the BluetoothGattExplorer class idea: crbug.com/710599 https://codereview.chromium.org/2638653002/diff/120001/device/bluetooth/bluetooth_remote_gatt_service_unittest.cc File device/bluetooth/bluetooth_remote_gatt_service_unittest.cc (right): https://codereview.chromium.org/2638653002/diff/120001/device/bluetooth/bluetooth_remote_gatt_service_unittest.cc#newcode287 device/bluetooth/bluetooth_remote_gatt_service_unittest.cc:287: // Tests to ...
3 years, 8 months ago (2017-04-11 20:44:41 UTC) #21
ortuno
Does this include a test for this crash http://crbug.com/707601?
3 years, 8 months ago (2017-04-11 22:36:08 UTC) #22
jlebel
On 2017/04/11 22:36:08, ortuno wrote: > Does this include a test for this crash http://crbug.com/707601 ...
3 years, 8 months ago (2017-04-11 22:38:45 UTC) #23
ortuno
On 2017/04/11 at 22:38:45, jlebel wrote: > On 2017/04/11 22:36:08, ortuno wrote: > > Does ...
3 years, 8 months ago (2017-04-11 22:40:00 UTC) #24
jlebel
On 2017/04/11 22:38:45, jlebel wrote: > On 2017/04/11 22:36:08, ortuno wrote: > > Does this ...
3 years, 8 months ago (2017-04-11 22:50:08 UTC) #25
jlebel
On 2017/04/11 22:50:08, jlebel wrote: > On 2017/04/11 22:38:45, jlebel wrote: > > On 2017/04/11 ...
3 years, 8 months ago (2017-04-13 01:12:24 UTC) #26
jlebel
On 2017/04/13 01:12:24, jlebel wrote: > On 2017/04/11 22:50:08, jlebel wrote: > > On 2017/04/11 ...
3 years, 8 months ago (2017-04-13 07:45:46 UTC) #31
scheib
On 2017/04/13 07:45:46, jlebel wrote: > On 2017/04/13 01:12:24, jlebel wrote: > > On 2017/04/11 ...
3 years, 8 months ago (2017-04-17 21:25:48 UTC) #33
scheib
I think this looks good code logic wise. I ask below for comments to help ...
3 years, 8 months ago (2017-04-18 04:43:21 UTC) #34
scheib
I see https://crbug.com/713922 suggesting the full device>service>characteristic>descriptor tree be built in mocks before starting test ...
3 years, 8 months ago (2017-04-21 17:49:11 UTC) #35
jlebel
I'm not sure to understand: "Before we even get to that though, I took another ...
3 years, 7 months ago (2017-04-29 22:08:07 UTC) #37
ortuno
On 2017/04/29 at 22:08:07, jlebel wrote: > I'm not sure to understand: > "Before we ...
3 years, 7 months ago (2017-04-30 23:32:58 UTC) #41
jlebel
SimulateGattServicesDiscovered() does the same thing than: AddServicesToDevice() SimulateDidDiscoverServicesMac() SimulateDidDiscoverCharacteristicsMac() SimulateDidDiscoverDescriptorsMac() For some tests, I need ...
3 years, 7 months ago (2017-05-01 13:32:28 UTC) #42
scheib
lgtm https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/bluetooth_device_unittest.cc#newcode514 device/bluetooth/bluetooth_device_unittest.cc:514: // Fist system call to 'First' https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/test/bluetooth_test_mac.h File ...
3 years, 7 months ago (2017-05-01 17:20:34 UTC) #43
jlebel
https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/bluetooth_device_unittest.cc File device/bluetooth/bluetooth_device_unittest.cc (right): https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/bluetooth_device_unittest.cc#newcode514 device/bluetooth/bluetooth_device_unittest.cc:514: // Fist system call to On 2017/05/01 17:20:33, scheib ...
3 years, 7 months ago (2017-05-01 21:27:14 UTC) #45
scheib
https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/test/bluetooth_test_mac.h File device/bluetooth/test/bluetooth_test_mac.h (right): https://codereview.chromium.org/2638653002/diff/200001/device/bluetooth/test/bluetooth_test_mac.h#newcode131 device/bluetooth/test/bluetooth_test_mac.h:131: void AddServicesToDevice(BluetoothDevice* device, On 2017/05/01 21:27:14, jlebel wrote: > ...
3 years, 7 months ago (2017-05-01 21:44:22 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2638653002/240001
3 years, 7 months ago (2017-05-04 17:19:36 UTC) #50
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/261752) chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
3 years, 7 months ago (2017-05-04 17:23:21 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2638653002/280001
3 years, 7 months ago (2017-05-04 19:27:49 UTC) #55
commit-bot: I haz the power
3 years, 7 months ago (2017-05-04 20:45:33 UTC) #58
Message was sent while issue was closed.
Committed patchset #10 (id:280001) as
https://chromium.googlesource.com/chromium/src/+/74fe98e203e687c3c96f25128fc5...

Powered by Google App Engine
This is Rietveld 408576698