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

Issue 177113013: Bluetooth: add Device events, and cleanup JS API (Closed)

Created:
6 years, 9 months ago by keybuk
Modified:
6 years, 9 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, Tim Song
Base URL:
https://chromium.googlesource.com/chromium/src.git@arman-patch
Visibility:
Public.

Description

Bluetooth: add Device events, and cleanup JS API The JavaScript API for getting the set of devices known to the adapter and dealing with discovery was difficult to use, and had a messy implementation. By streamlining the API not only does it become much easier to work with, but the implementation becomes much cleaner as well. chrome.bluetooth.getDevices() now simply returns an array of devices in its callback, it's up to the application to filter these since profile filtering is unreliable during discovery and on Low Energy. chrome.bluetooth.startDiscovery() now only has a callback to indicate a success to the command, the hidden event and listener has been removed in favor of the new device events. Add chrome.bluetooth.onDeviceAdded, chrome.bluetooth.onDeviceChanged and chrome.bluetooth.onDeviceRemoved events. These return updated device objects when they are first known, changed and removed respectively. Take the opportunity of writing a proper documentation page for these new methods and events showing their usage. BUG=345050 TEST=BluetoothApiTest updated and included R=armansito@chromium.org, miket@chromium.org, rpaquay@chromium.org, sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255706

Patch Set 1 #

Total comments: 23

Patch Set 2 : review nits #

Patch Set 3 : remove docs from CL #

Patch Set 4 : rebase onto discovery patch #

Patch Set 5 : I suck at rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+187 lines, -389 lines) Patch
M chrome/browser/extensions/api/bluetooth/bluetooth_api.h View 1 2 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_api.cc View 1 2 3 4 5 chunks +14 lines, -49 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc View 1 2 3 4 9 chunks +35 lines, -27 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h View 1 3 4 3 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc View 1 2 3 4 6 chunks +42 lines, -21 lines 0 comments Download
M chrome/browser/extensions/event_names.h View 1 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/extensions/event_names.cc View 1 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/common/extensions/api/bluetooth.idl View 1 6 chunks +21 lines, -32 lines 0 comments Download
M chrome/renderer/extensions/dispatcher.cc View 1 2 1 chunk +0 lines, -1 line 0 comments Download
D chrome/renderer/resources/extensions/bluetooth_custom_bindings.js View 1 chunk +0 lines, -158 lines 0 comments Download
M chrome/renderer/resources/renderer_resources.grd View 1 2 1 chunk +0 lines, -1 line 0 comments Download
A + chrome/test/data/extensions/api_test/bluetooth/device_events/manifest.json View 1 chunk +2 lines, -1 line 0 comments Download
A chrome/test/data/extensions/api_test/bluetooth/device_events/runtest.js View 1 chunk +44 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/bluetooth/discovery_callback/runtest.js View 1 chunk +7 lines, -6 lines 0 comments Download
M chrome/test/data/extensions/api_test/bluetooth/discovery_in_progress/runtest.js View 3 1 chunk +7 lines, -6 lines 0 comments Download
M chrome/test/data/extensions/api_test/bluetooth/get_devices/runtest.js View 2 chunks +9 lines, -29 lines 0 comments Download
D chrome/test/data/extensions/api_test/bluetooth/get_devices_error/manifest.json View 1 chunk +0 lines, -11 lines 0 comments Download
D chrome/test/data/extensions/api_test/bluetooth/get_devices_error/runtest.js View 1 chunk +0 lines, -24 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
keybuk
miket: for /extensions/ rpaquay: for /extensions/api/bluetooth/ mkearney: for /docs/ armansito: general bluetooth review
6 years, 9 months ago (2014-03-05 20:49:43 UTC) #1
miket_OOO
LGTM. Thanks! https://codereview.chromium.org/177113013/diff/1/chrome/common/extensions/api/bluetooth.idl File chrome/common/extensions/api/bluetooth.idl (right): https://codereview.chromium.org/177113013/diff/1/chrome/common/extensions/api/bluetooth.idl#newcode186 chrome/common/extensions/api/bluetooth.idl:186: // Get a list of bluetooth devices ...
6 years, 9 months ago (2014-03-05 21:30:08 UTC) #2
armansito
lgtm with nits. https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc File chrome/browser/extensions/api/bluetooth/bluetooth_api.cc (left): https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc#oldcode305 chrome/browser/extensions/api/bluetooth/bluetooth_api.cc:305: DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); Keep this assertion? https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_apitest.cc File ...
6 years, 9 months ago (2014-03-05 21:44:14 UTC) #3
rpaquay
lgtm with nits. https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc File chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc (right): https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc#newcode357 chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc:357: scoped_ptr<base::ListValue> args(new base::ListValue()); You should be ...
6 years, 9 months ago (2014-03-06 00:11:19 UTC) #4
keybuk
https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc File chrome/browser/extensions/api/bluetooth/bluetooth_api.cc (left): https://codereview.chromium.org/177113013/diff/1/chrome/browser/extensions/api/bluetooth/bluetooth_api.cc#oldcode305 chrome/browser/extensions/api/bluetooth/bluetooth_api.cc:305: DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); On 2014/03/05 21:44:15, armansito wrote: > Keep this ...
6 years, 9 months ago (2014-03-06 21:33:44 UTC) #5
keybuk
+sky for chrome/renderer/resources/
6 years, 9 months ago (2014-03-06 21:33:55 UTC) #6
armansito
On 2014/03/06 21:33:55, keybuk wrote: > +sky for chrome/renderer/resources/ FYI, https://src.chromium.org/viewvc/chrome?revision=255262&view=revision got reverted, which this ...
6 years, 9 months ago (2014-03-06 21:45:48 UTC) #7
sky
chrome/renderer/resources/renderer_resources.grd LGTM
6 years, 9 months ago (2014-03-06 22:05:10 UTC) #8
keybuk
6 years, 9 months ago (2014-03-07 22:13:06 UTC) #9
Message was sent while issue was closed.
Committed patchset #5 manually as r255706 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698