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

Issue 256413003: chrome.bluetoothLowEnergy: Implement getService and getServices. (Closed)

Created:
6 years, 8 months ago by armansito
Modified:
6 years, 7 months ago
Reviewers:
keybuk, miket_OOO, rpaquay
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Visibility:
Public.

Description

chrome.bluetoothLowEnergy: Implement getService and getServices. This patch implements the getService and getServices functions of the bluetoothLowEnergy API. The key changes introduced are: * BluetoothLowEnergyEventRouter, which tracks Observer events from the device/bluetooth API, maintains a mapping from instance IDs to the necessary metadata to look up a GATT object from the adapter, and handles basic logic such as conversion between device::BluetoothGatt* and extensions::api::bluetooth_low_energy::* objects and sending of API events. * Implementation of getService and getServices functions. * In browser unit tests for the above functions. BUG=265663 TEST=browser_tests --gtest_filter=BluetoothLowEnergyApiTest.*, device_unittests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266484

Patch Set 1 #

Total comments: 10

Patch Set 2 : keybuk@'s comments. #

Patch Set 3 : rpaquay@'s comments. #

Total comments: 2

Patch Set 4 : Removed BluetoothLowEnergyApi::weak_ptr_factory_. #

Patch Set 5 : Fixed clang errors. #

Patch Set 6 : Fixed compile error. #

Patch Set 7 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1202 lines, -60 lines) Patch
M chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h View 1 2 3 4 12 chunks +97 lines, -33 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc View 1 2 3 4 5 1 chunk +174 lines, -17 lines 0 comments Download
A chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_apitest.cc View 1 chunk +159 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.h View 1 2 3 4 1 chunk +170 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc View 1 2 3 4 5 1 chunk +369 lines, -0 lines 0 comments Download
M chrome/browser/extensions/browser_context_keyed_service_factories.cc View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/bluetooth_low_energy.idl View 1 1 chunk +3 lines, -3 lines 0 comments Download
A + chrome/test/data/extensions/api_test/bluetooth_low_energy/get_service/manifest.json View 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/extensions/api_test/bluetooth_low_energy/get_service/runtest.js View 1 1 chunk +59 lines, -0 lines 0 comments Download
A + chrome/test/data/extensions/api_test/bluetooth_low_energy/get_services/manifest.json View 1 chunk +1 line, -1 line 0 comments Download
A chrome/test/data/extensions/api_test/bluetooth_low_energy/get_services/runtest.js View 1 1 chunk +54 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth.gyp View 1 chunk +2 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_device.h View 1 chunk +3 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_gatt_service.h View 3 chunks +6 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_service_chromeos.h View 1 chunk +2 lines, -1 line 0 comments Download
M device/bluetooth/bluetooth_remote_gatt_service_chromeos.cc View 3 chunks +6 lines, -1 line 0 comments Download
M device/bluetooth/test/mock_bluetooth_device.h View 1 chunk +3 lines, -0 lines 0 comments Download
A device/bluetooth/test/mock_bluetooth_gatt_service.h View 1 1 chunk +52 lines, -0 lines 0 comments Download
A device/bluetooth/test/mock_bluetooth_gatt_service.cc View 1 1 chunk +36 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
armansito
miket@: PTAL at c/b/e/browser_context_keyed_service_factories.cc rpaquay@: overall API logic in c/b/e/a/bluetooth_low_energy/*, tests etc. keybuk@: everything
6 years, 8 months ago (2014-04-24 02:24:15 UTC) #1
keybuk
https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc (right): https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc#newcode41 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc:41: apibt::BluetoothDeviceToApiDevice(*service->GetDevice(), device); I'm thinking now that this is overkill, ...
6 years, 8 months ago (2014-04-24 15:05:20 UTC) #2
rpaquay
https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc (right): https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc#newcode89 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc:89: weak_ptr_factory_.GetWeakPtr()))) { Does this work? I would think you ...
6 years, 8 months ago (2014-04-24 20:38:45 UTC) #3
armansito
https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc (right): https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc#newcode41 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_event_router.cc:41: apibt::BluetoothDeviceToApiDevice(*service->GetDevice(), device); On 2014/04/24 15:05:20, keybuk wrote: > I'm ...
6 years, 8 months ago (2014-04-24 20:51:22 UTC) #4
armansito
https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc (right): https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc#newcode89 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc:89: weak_ptr_factory_.GetWeakPtr()))) { On 2014/04/24 20:38:45, rpaquay wrote: > Does ...
6 years, 8 months ago (2014-04-24 22:02:00 UTC) #5
rpaquay
https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc (right): https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc#newcode89 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc:89: weak_ptr_factory_.GetWeakPtr()))) { On 2014/04/24 22:02:00, armansito wrote: > On ...
6 years, 8 months ago (2014-04-24 22:12:46 UTC) #6
armansito
https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc (right): https://codereview.chromium.org/256413003/diff/1/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc#newcode89 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.cc:89: weak_ptr_factory_.GetWeakPtr()))) { On 2014/04/24 22:12:46, rpaquay wrote: > On ...
6 years, 8 months ago (2014-04-24 22:38:33 UTC) #7
rpaquay
https://codereview.chromium.org/256413003/diff/40001/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h (right): https://codereview.chromium.org/256413003/diff/40001/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h#newcode75 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h:75: base::WeakPtrFactory<BluetoothLowEnergyExtensionFunction> weak_ptr_factory_; Is this field still needed?
6 years, 8 months ago (2014-04-24 23:00:03 UTC) #8
armansito
https://codereview.chromium.org/256413003/diff/40001/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h File chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h (right): https://codereview.chromium.org/256413003/diff/40001/chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h#newcode75 chrome/browser/extensions/api/bluetooth_low_energy/bluetooth_low_energy_api.h:75: base::WeakPtrFactory<BluetoothLowEnergyExtensionFunction> weak_ptr_factory_; On 2014/04/24 23:00:04, rpaquay wrote: > Is ...
6 years, 8 months ago (2014-04-24 23:02:31 UTC) #9
rpaquay
lgtm
6 years, 8 months ago (2014-04-24 23:07:26 UTC) #10
keybuk
lgtm
6 years, 8 months ago (2014-04-25 00:30:54 UTC) #11
miket_OOO
lgtm
6 years, 8 months ago (2014-04-25 18:25:16 UTC) #12
armansito
The CQ bit was checked by armansito@chromium.org
6 years, 8 months ago (2014-04-25 18:25:42 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/armansito@chromium.org/256413003/60001
6 years, 8 months ago (2014-04-25 22:12:26 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-26 00:52:11 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_rel
6 years, 8 months ago (2014-04-26 00:52:11 UTC) #16
armansito
The CQ bit was checked by armansito@chromium.org
6 years, 8 months ago (2014-04-26 21:34:15 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/armansito@chromium.org/256413003/100001
6 years, 8 months ago (2014-04-26 21:34:49 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-26 21:35:03 UTC) #19
commit-bot: I haz the power
Failed to apply patch for chrome/chrome_browser_extensions.gypi: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 8 months ago (2014-04-26 21:35:04 UTC) #20
armansito
The CQ bit was checked by armansito@chromium.org
6 years, 8 months ago (2014-04-26 22:15:53 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/armansito@chromium.org/256413003/120001
6 years, 8 months ago (2014-04-26 22:18:16 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-26 22:55:29 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_x64_rel
6 years, 8 months ago (2014-04-26 22:55:29 UTC) #24
armansito
The CQ bit was checked by armansito@chromium.org
6 years, 8 months ago (2014-04-26 23:02:59 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/armansito@chromium.org/256413003/120001
6 years, 8 months ago (2014-04-26 23:03:52 UTC) #26
commit-bot: I haz the power
6 years, 7 months ago (2014-04-28 08:06:15 UTC) #27
Message was sent while issue was closed.
Change committed as 266484

Powered by Google App Engine
This is Rietveld 408576698