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

Issue 2379573006: bluetooth: Standardize Bluetooth adapter access in Adapter service. (Closed)

Created:
4 years, 2 months ago by mbrunson
Modified:
4 years, 2 months ago
Reviewers:
scheib, ortuno, dcheng, dpapad
CC:
chromium-reviews, ortuno+watch_chromium.org, scheib+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bluetooth: Standardize Bluetooth adapter access in Adapter service. Every implemented function of the Adapter Mojo service requires a reference to the system's Bluetooth adapter. Since any function could be called at any time in the service, the adapter must be available from the creation of the Adapter service. To satisfy this requirement, a factory pattern has been implemented to create instances of the Adapter service with the required reference to a Bluetooth adapter. BUG=651282 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/8bd80fe58ce9c15bfd896cb902727e1066edbc2c Cr-Commit-Position: refs/heads/master@{#423730}

Patch Set 1 #

Patch Set 2 : Simplify WithAdapter #

Patch Set 3 : Add continuation in WithAdapter, remove functional import #

Patch Set 4 : Add function comments #

Total comments: 9

Patch Set 5 : Simplify WithAdapter logic #

Total comments: 2

Patch Set 6 : Add missing return #

Patch Set 7 : Implement AdapterFactory #

Patch Set 8 : Revert chrome content browser formatting changes #

Patch Set 9 : Comment updates #

Total comments: 10

Patch Set 10 : Change to new getProxy function in connection #

Patch Set 11 : Change Mojo interface #

Total comments: 6

Patch Set 12 : Fix comment, localize variables #

Patch Set 13 : Globalize client to receive callback events #

Total comments: 8

Patch Set 14 : dcheng fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -72 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/resources/bluetooth_internals/bluetooth_internals.js View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +21 lines, -13 lines 0 comments Download
M device/bluetooth/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M device/bluetooth/adapter.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -12 lines 0 comments Download
M device/bluetooth/adapter.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +14 lines, -44 lines 0 comments Download
A device/bluetooth/adapter_factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +41 lines, -0 lines 0 comments Download
A device/bluetooth/adapter_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +43 lines, -0 lines 0 comments Download
M device/bluetooth/public/interfaces/adapter.mojom View 1 2 3 4 5 6 7 8 9 10 1 chunk +5 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 53 (22 generated)
mbrunson
Please review. Any suggestions on ways to simplify this further would be appreciated.
4 years, 2 months ago (2016-09-29 22:04:56 UTC) #10
ortuno
Since the service is supposed to be a thin wrapper around device/bluetooth what about adding ...
4 years, 2 months ago (2016-09-29 22:55:54 UTC) #13
mbrunson
https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc#newcode33 device/bluetooth/adapter.cc:33: WithAdapter(base::Bind( On 2016/09/29 22:55:54, ortuno wrote: > We can't ...
4 years, 2 months ago (2016-09-30 00:15:07 UTC) #14
scheib
https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc#newcode33 device/bluetooth/adapter.cc:33: WithAdapter(base::Bind( On 2016/09/30 00:15:07, mbrunson wrote: > On 2016/09/29 ...
4 years, 2 months ago (2016-09-30 06:35:42 UTC) #15
scheib
https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc#newcode33 device/bluetooth/adapter.cc:33: WithAdapter(base::Bind( On 2016/09/30 06:35:42, scheib wrote: > On 2016/09/30 ...
4 years, 2 months ago (2016-09-30 06:50:27 UTC) #16
mbrunson
On 2016/09/29 22:55:54, ortuno wrote: > Since the service is supposed to be a thin ...
4 years, 2 months ago (2016-09-30 20:00:58 UTC) #17
scheib
On 2016/09/30 20:00:58, mbrunson wrote: > I hesitate to go that route in case there ...
4 years, 2 months ago (2016-09-30 20:24:31 UTC) #18
mbrunson
On 2016/09/30 20:24:31, scheib wrote: > On 2016/09/30 20:00:58, mbrunson wrote: > > I hesitate ...
4 years, 2 months ago (2016-09-30 20:43:58 UTC) #19
mbrunson
https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc#newcode89 device/bluetooth/adapter.cc:89: if (!adapter_.get()) { On 2016/09/30 06:35:42, scheib wrote: > ...
4 years, 2 months ago (2016-09-30 21:14:38 UTC) #20
scheib
https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/60001/device/bluetooth/adapter.cc#newcode33 device/bluetooth/adapter.cc:33: WithAdapter(base::Bind( On 2016/09/30 06:50:27, scheib wrote: > On 2016/09/30 ...
4 years, 2 months ago (2016-09-30 21:52:02 UTC) #21
mbrunson
https://codereview.chromium.org/2379573006/diff/80001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/80001/device/bluetooth/adapter.cc#newcode89 device/bluetooth/adapter.cc:89: action.Run(adapter_); On 2016/09/30 21:52:01, scheib wrote: > add return ...
4 years, 2 months ago (2016-09-30 22:13:02 UTC) #22
scheib
LGTM, deferring to ortuno's opinion for if we use AdapterFactory or not.
4 years, 2 months ago (2016-09-30 22:36:17 UTC) #23
ortuno
On 2016/09/30 at 22:36:17, scheib wrote: > LGTM, deferring to ortuno's opinion for if we ...
4 years, 2 months ago (2016-10-04 00:00:16 UTC) #24
mbrunson
On 2016/10/04 00:00:16, ortuno wrote: > On 2016/09/30 at 22:36:17, scheib wrote: > > LGTM, ...
4 years, 2 months ago (2016-10-04 02:29:33 UTC) #25
mbrunson
On 2016/10/04 00:00:16, ortuno wrote: > On 2016/09/30 at 22:36:17, scheib wrote: > > LGTM, ...
4 years, 2 months ago (2016-10-04 21:19:35 UTC) #27
ortuno
You also have to change the description. https://codereview.chromium.org/2379573006/diff/150001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/150001/device/bluetooth/adapter.cc#newcode32 device/bluetooth/adapter.cc:32: mojo::MakeStrongBinding(base::MakeUnique<Adapter>(adapter, std::move(client)), ...
4 years, 2 months ago (2016-10-05 02:07:51 UTC) #28
mbrunson
https://codereview.chromium.org/2379573006/diff/150001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/150001/device/bluetooth/adapter.cc#newcode32 device/bluetooth/adapter.cc:32: mojo::MakeStrongBinding(base::MakeUnique<Adapter>(adapter, std::move(client)), On 2016/10/05 02:07:51, ortuno wrote: > If ...
4 years, 2 months ago (2016-10-05 17:59:04 UTC) #30
ortuno
lgtm! Please update the comment to reflect the changes. https://codereview.chromium.org/2379573006/diff/190001/device/bluetooth/adapter.h File device/bluetooth/adapter.h (right): https://codereview.chromium.org/2379573006/diff/190001/device/bluetooth/adapter.h#newcode37 device/bluetooth/adapter.h:37: ...
4 years, 2 months ago (2016-10-05 22:21:44 UTC) #31
mbrunson
Which comment are you referring to? https://codereview.chromium.org/2379573006/diff/190001/device/bluetooth/adapter.h File device/bluetooth/adapter.h (right): https://codereview.chromium.org/2379573006/diff/190001/device/bluetooth/adapter.h#newcode37 device/bluetooth/adapter.h:37: static mojom::DeviceInfoPtr ConstructDeviceInfoStruct( ...
4 years, 2 months ago (2016-10-05 22:30:41 UTC) #32
ortuno
On 2016/10/05 at 22:30:41, mbrunson wrote: > Which comment are you referring to? > > ...
4 years, 2 months ago (2016-10-05 22:45:53 UTC) #33
mbrunson
OWNERS review, please: dcheng: device/bluetooth/public/interfaces/adapter.mojom dpapad: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
4 years, 2 months ago (2016-10-05 23:21:24 UTC) #34
mbrunson
OWNERS review, please: dcheng: device/bluetooth/public/interfaces/adapter.mojom dpapad: chrome/browser/resources/bluetooth_internals/bluetooth_internals.js
4 years, 2 months ago (2016-10-05 23:22:14 UTC) #36
dpapad
https://codereview.chromium.org/2379573006/diff/190001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2379573006/diff/190001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode56 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:56: * @return {!Promise} resolves if adapter is acquired Nit: ...
4 years, 2 months ago (2016-10-06 00:52:45 UTC) #37
mbrunson
https://codereview.chromium.org/2379573006/diff/190001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2379573006/diff/190001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode56 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:56: * @return {!Promise} resolves if adapter is acquired On ...
4 years, 2 months ago (2016-10-06 01:13:59 UTC) #38
dcheng
mojo lgtm https://codereview.chromium.org/2379573006/diff/230001/device/bluetooth/adapter.cc File device/bluetooth/adapter.cc (right): https://codereview.chromium.org/2379573006/diff/230001/device/bluetooth/adapter.cc#newcode18 device/bluetooth/adapter.cc:18: : adapter_(adapter), client_(nullptr), weak_ptr_factory_(this) { Nit: std::move(adapter) ...
4 years, 2 months ago (2016-10-06 04:01:39 UTC) #39
dpapad
JS LGTM https://codereview.chromium.org/2379573006/diff/230001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2379573006/diff/230001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode74 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:74: return adapterFactory.getAdapter().then(function(response) { Nit (optional): You could ...
4 years, 2 months ago (2016-10-06 17:13:32 UTC) #40
dcheng
mojom lgtm with previous comments addressed (sorry I meant to include this in the previous ...
4 years, 2 months ago (2016-10-06 18:28:15 UTC) #43
mbrunson
https://codereview.chromium.org/2379573006/diff/230001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js File chrome/browser/resources/bluetooth_internals/bluetooth_internals.js (right): https://codereview.chromium.org/2379573006/diff/230001/chrome/browser/resources/bluetooth_internals/bluetooth_internals.js#newcode74 chrome/browser/resources/bluetooth_internals/bluetooth_internals.js:74: return adapterFactory.getAdapter().then(function(response) { On 2016/10/06 17:13:32, dpapad wrote: > ...
4 years, 2 months ago (2016-10-06 20:25:57 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/2379573006/250001
4 years, 2 months ago (2016-10-06 21:06:49 UTC) #49
commit-bot: I haz the power
Committed patchset #14 (id:250001)
4 years, 2 months ago (2016-10-06 23:23:34 UTC) #51
commit-bot: I haz the power
4 years, 2 months ago (2016-10-06 23:26:42 UTC) #53
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/8bd80fe58ce9c15bfd896cb902727e1066edbc2c
Cr-Commit-Position: refs/heads/master@{#423730}

Powered by Google App Engine
This is Rietveld 408576698