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

Issue 2244693002: bluetooth: Refactor how we update based on Advertising Data (Closed)

Created:
4 years, 4 months ago by ortuno
Modified:
4 years, 4 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, elijahtaylor+arcwatch_chromium.org, extensions-reviews_chromium.org, hidehiko+watch_chromium.org, jam, lhchavez+watch_chromium.org, ortuno+watch_chromium.org, scheib+watch_chromium.org, yusukes+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: Refactor how we update based on Advertising Data Changes: 1. GetUUIDs now returns a set. Most clients check if the device contains an specific UUID so it makes more sense to return a set rather than force clients to iterate over all services. 2. Service Data is now stored as a map from UUIDs to std::vector<uint8_t> 3. Change how we expose Advertisement Data: The old model: Advertisement Data was kept indefinitely meaning it would never expire. This could lead to exposing stale data to clients of the API. The new model: Every time a packet arrives we discard the old advertising data and replace it with the received Advertisement Data. Once discovery finishes we clear the data. This matches what BlueZ does and gives clients the most up to date information regarding the Advertisement Data. BUG=568135 Committed: https://crrev.com/7a8399b1e00b3cd796396021c99472ef43d5f7a7 Cr-Commit-Position: refs/heads/master@{#413780}

Patch Set 1 #

Patch Set 2 : Implement Service Data on mac #

Patch Set 3 : Clean up #

Patch Set 4 : Fix issues #

Patch Set 5 : Fix arc #

Patch Set 6 : Fix component unittests #

Patch Set 7 : Fix browser tests #

Patch Set 8 : Rebase #

Patch Set 9 : Fixes #

Patch Set 10 : Fix windows #

Patch Set 11 : Fix conflict #

Patch Set 12 : Fix arc #

Patch Set 13 : Fix windows #

Patch Set 14 : Fix arc #

Total comments: 71

Patch Set 15 : Address jyasskin's comments #

Patch Set 16 : Typo #

Total comments: 8

Patch Set 17 : Address jyasskin's comments #2 #

Patch Set 18 : Fix mac #

Patch Set 19 : Rebase #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+964 lines, -371 lines) Patch
M chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M components/arc/bluetooth/arc_bluetooth_bridge.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +21 lines, -20 lines 3 comments Download
M components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc View 1 2 3 1 chunk +8 lines, -10 lines 0 comments Download
M components/proximity_auth/ble/bluetooth_low_energy_connection_finder_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +5 lines, -5 lines 0 comments Download
M content/browser/bluetooth/bluetooth_device_chooser_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 14 1 chunk +1 line, -3 lines 0 comments Download
M device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java View 2 chunks +8 lines, -7 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +33 lines, -13 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +63 lines, -29 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_unittest.cc View 1 3 chunks +2 lines, -15 lines 0 comments Download
M device/bluetooth/bluetooth_classic_device_mac.h View 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/bluetooth_classic_device_mac.mm View 2 chunks +3 lines, -3 lines 0 comments Download
M device/bluetooth/bluetooth_device.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 9 chunks +69 lines, -33 lines 0 comments Download
M device/bluetooth/bluetooth_device.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +75 lines, -46 lines 0 comments Download
M device/bluetooth/bluetooth_device_android.h View 1 chunk +0 lines, -4 lines 0 comments Download
M device/bluetooth/bluetooth_device_android.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +3 lines, -13 lines 0 comments Download
M device/bluetooth/bluetooth_device_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 4 chunks +568 lines, -32 lines 0 comments Download
M device/bluetooth/bluetooth_device_win.h View 2 chunks +2 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_device_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +4 lines, -17 lines 0 comments Download
M device/bluetooth/bluetooth_device_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -3 lines 0 comments Download
M device/bluetooth/bluetooth_low_energy_device_mac.h View 1 3 chunks +1 line, -11 lines 0 comments Download
M device/bluetooth/bluetooth_low_energy_device_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 7 chunks +6 lines, -44 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_bluez_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 9 chunks +29 lines, -29 lines 0 comments Download
M device/bluetooth/bluez/bluetooth_device_bluez.h View 15 16 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/bluez/bluetooth_device_bluez.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -6 lines 0 comments Download
M device/bluetooth/test/bluetooth_test.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +5 lines, -2 lines 0 comments Download
M device/bluetooth/test/bluetooth_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -0 lines 0 comments Download
M device/bluetooth/test/bluetooth_test_mac.mm View 1 5 chunks +33 lines, -8 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_device.h View 3 chunks +3 lines, -3 lines 0 comments Download
M extensions/browser/api/bluetooth/bluetooth_api_utils.cc View 1 chunk +4 lines, -4 lines 0 comments Download
M extensions/browser/api/bluetooth/bluetooth_apitest.cc View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 68 (49 generated)
ortuno
scheib: PTAL
4 years, 4 months ago (2016-08-13 00:04:12 UTC) #8
ortuno
jyasskin: Could you take a look since scheib is OOO?
4 years, 4 months ago (2016-08-15 17:56:49 UTC) #15
Jeffrey Yasskin
More later. https://codereview.chromium.org/2244693002/diff/250001/chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js File chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js (right): https://codereview.chromium.org/2244693002/diff/250001/chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js#newcode18 chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js:18: let uuids = new Set(devices[0].uuids); We should ...
4 years, 4 months ago (2016-08-18 16:04:33 UTC) #38
Jeffrey Yasskin
Another partial review: https://codereview.chromium.org/2244693002/diff/250001/device/bluetooth/bluetooth_adapter_mac.mm File device/bluetooth/bluetooth_adapter_mac.mm (right): https://codereview.chromium.org/2244693002/diff/250001/device/bluetooth/bluetooth_adapter_mac.mm#newcode490 device/bluetooth/bluetooth_adapter_mac.mm:490: bool is_new_device = device_mac == nullptr; ...
4 years, 4 months ago (2016-08-18 19:56:31 UTC) #39
Jeffrey Yasskin
Ok, that's all my comments. https://codereview.chromium.org/2244693002/diff/250001/device/bluetooth/bluetooth_device.cc File device/bluetooth/bluetooth_device.cc (right): https://codereview.chromium.org/2244693002/diff/250001/device/bluetooth/bluetooth_device.cc#newcode289 device/bluetooth/bluetooth_device.cc:289: BluetoothDevice::UUIDSet BluetoothDevice::GetUUIDs() const { ...
4 years, 4 months ago (2016-08-19 15:09:53 UTC) #40
ortuno
https://codereview.chromium.org/2244693002/diff/250001/chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js File chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js (right): https://codereview.chromium.org/2244693002/diff/250001/chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js#newcode18 chrome/test/data/extensions/api_test/bluetooth/device_info/runtest.js:18: let uuids = new Set(devices[0].uuids); On 2016/08/18 at 16:04:32, ...
4 years, 4 months ago (2016-08-19 20:50:34 UTC) #42
Jeffrey Yasskin
LGTM after you check the nits and see if making GetServiceData() return a reference makes ...
4 years, 4 months ago (2016-08-19 22:08:10 UTC) #43
ortuno
Thanks! https://codereview.chromium.org/2244693002/diff/250001/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java File device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java (right): https://codereview.chromium.org/2244693002/diff/250001/device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java#newcode245 device/bluetooth/android/java/src/org/chromium/device/bluetooth/ChromeBluetoothAdapter.java:245: String[] uuid_strings; On 2016/08/19 at 22:08:09, Jeffrey Yasskin ...
4 years, 4 months ago (2016-08-23 00:38:04 UTC) #50
ortuno
puthik: PTAL at components/arc sacomoto: PTAL at components/proximity_auth stevenjb: PTAL at extensions rkc: FYI this ...
4 years, 4 months ago (2016-08-23 00:43:40 UTC) #52
puthik_chromium
components/arc LGTM Didn't look at other code
4 years, 4 months ago (2016-08-23 01:08:52 UTC) #53
ortuno
lhchavez: PTAL at components/arc
4 years, 4 months ago (2016-08-23 01:11:00 UTC) #55
sacomoto
components/proximity_auth LGTM.
4 years, 4 months ago (2016-08-23 09:58:27 UTC) #58
stevenjb
extensions/ lgtm
4 years, 4 months ago (2016-08-23 15:36:41 UTC) #59
Luis Héctor Chávez
lgtm with a nit https://codereview.chromium.org/2244693002/diff/350001/components/arc/bluetooth/arc_bluetooth_bridge.cc File components/arc/bluetooth/arc_bluetooth_bridge.cc (right): https://codereview.chromium.org/2244693002/diff/350001/components/arc/bluetooth/arc_bluetooth_bridge.cc#newcode1480 components/arc/bluetooth/arc_bluetooth_bridge.cc:1480: for (const auto& uuid : ...
4 years, 4 months ago (2016-08-23 15:49:27 UTC) #60
ortuno
https://codereview.chromium.org/2244693002/diff/350001/components/arc/bluetooth/arc_bluetooth_bridge.cc File components/arc/bluetooth/arc_bluetooth_bridge.cc (right): https://codereview.chromium.org/2244693002/diff/350001/components/arc/bluetooth/arc_bluetooth_bridge.cc#newcode1480 components/arc/bluetooth/arc_bluetooth_bridge.cc:1480: for (const auto& uuid : uuids) { On 2016/08/23 ...
4 years, 4 months ago (2016-08-23 17:40:19 UTC) #61
Luis Héctor Chávez
https://codereview.chromium.org/2244693002/diff/350001/components/arc/bluetooth/arc_bluetooth_bridge.cc File components/arc/bluetooth/arc_bluetooth_bridge.cc (right): https://codereview.chromium.org/2244693002/diff/350001/components/arc/bluetooth/arc_bluetooth_bridge.cc#newcode1480 components/arc/bluetooth/arc_bluetooth_bridge.cc:1480: for (const auto& uuid : uuids) { On 2016/08/23 ...
4 years, 4 months ago (2016-08-23 17:44:28 UTC) #62
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/2244693002/350001
4 years, 4 months ago (2016-08-23 17:46:09 UTC) #65
commit-bot: I haz the power
Committed patchset #19 (id:350001)
4 years, 4 months ago (2016-08-23 17:51:10 UTC) #66
commit-bot: I haz the power
4 years, 4 months ago (2016-08-23 17:52:51 UTC) #68
Message was sent while issue was closed.
Patchset 19 (id:??) landed as
https://crrev.com/7a8399b1e00b3cd796396021c99472ef43d5f7a7
Cr-Commit-Position: refs/heads/master@{#413780}

Powered by Google App Engine
This is Rietveld 408576698