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

Issue 1054743003: Add CPP API for BLE advertisments. (Closed)

Created:
5 years, 8 months ago by rkc
Modified:
4 years, 8 months ago
CC:
chromium-reviews, scheib+watch_chromium.org, stevenjb+watch_chromium.org, oshima+watch_chromium.org, hashimoto+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add CPP API for BLE advertisments. This CL adds the new classes, changes to existing classes and tests for adding the CPP API for LE advertisements. The design for this is available at http://go/chrome-ble-advertising. R=armansito@chromium.org, jamuraa@chromium.org BUG=466375 Committed: https://crrev.com/c96da18077ef4b5ab28cb8b2684cd84386075e5a Cr-Commit-Position: refs/heads/master@{#327128}

Patch Set 1 #

Total comments: 10

Patch Set 2 : #

Total comments: 14

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Total comments: 21

Patch Set 6 : #

Total comments: 5

Patch Set 7 : #

Patch Set 8 : mac build fix #

Patch Set 9 : windows build fix #

Patch Set 10 : moar build fixes #

Patch Set 11 : win fix, again #

Patch Set 12 : tentative win fix #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+685 lines, -21 lines) Patch
M chromeos/dbus/bluetooth_le_advertisement_service_provider.h View 2 chunks +7 lines, -1 line 0 comments Download
M chromeos/dbus/bluetooth_le_advertisement_service_provider.cc View 1 2 3 4 5 5 chunks +6 lines, -10 lines 0 comments Download
M chromeos/dbus/fake_bluetooth_le_advertisement_service_provider.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chromeos/dbus/fake_bluetooth_le_advertisement_service_provider.cc View 2 chunks +4 lines, -3 lines 0 comments Download
M chromeos/dbus/fake_bluetooth_le_advertising_manager_client.h View 1 chunk +1 line, -1 line 0 comments Download
M chromeos/dbus/fake_bluetooth_le_advertising_manager_client.cc View 1 chunk +0 lines, -3 lines 0 comments Download
M device/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M device/bluetooth/BUILD.gn View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter.h View 1 2 3 4 5 6 3 chunks +13 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos.h View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos.cc View 1 2 2 chunks +10 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_mac.mm View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_unittest.cc View 1 2 1 chunk +5 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +8 lines, -0 lines 0 comments Download
A device/bluetooth/bluetooth_advertisement.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +137 lines, -0 lines 2 comments Download
A device/bluetooth/bluetooth_advertisement.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +37 lines, -0 lines 0 comments Download
A device/bluetooth/bluetooth_advertisement_chromeos.h View 1 2 3 1 chunk +59 lines, -0 lines 0 comments Download
A device/bluetooth/bluetooth_advertisement_chromeos.cc View 1 2 3 4 5 6 7 8 9 1 chunk +115 lines, -0 lines 0 comments Download
A device/bluetooth/bluetooth_advertisement_chromeos_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +242 lines, -0 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_adapter.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M device/bluetooth/test/mock_bluetooth_adapter.cc View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M device/device_tests.gyp View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 55 (20 generated)
rkc
5 years, 8 months ago (2015-04-16 21:40:18 UTC) #1
scheib
https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h#newcode377 device/bluetooth/bluetooth_adapter.h:377: typedef base::Callback<void(scoped_refptr<BluetoothAdvertisement>)> http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Declaration_Order https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_advertisement.h#newcode37 device/bluetooth/bluetooth_advertisement.h:37: ...
5 years, 8 months ago (2015-04-16 22:11:32 UTC) #3
rkc
https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h#newcode377 device/bluetooth/bluetooth_adapter.h:377: typedef base::Callback<void(scoped_refptr<BluetoothAdvertisement>)> On 2015/04/16 22:11:32, scheib wrote: > http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Declaration_Order ...
5 years, 8 months ago (2015-04-17 19:57:08 UTC) #4
armansito
https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_advertisement.h#newcode37 device/bluetooth/bluetooth_advertisement.h:37: ADVERTISEMENT_TYPE_BROADCAST, On 2015/04/17 19:57:08, Rahul Chaturvedi wrote: > On ...
5 years, 8 months ago (2015-04-17 20:15:14 UTC) #5
Marie Janssen
https://codereview.chromium.org/1054743003/diff/20001/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/20001/device/bluetooth/bluetooth_advertisement.h#newcode1 device/bluetooth/bluetooth_advertisement.h:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
5 years, 8 months ago (2015-04-21 18:15:10 UTC) #6
scheib
https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h#newcode377 device/bluetooth/bluetooth_adapter.h:377: typedef base::Callback<void(scoped_refptr<BluetoothAdvertisement>)> On 2015/04/17 19:57:08, Rahul Chaturvedi wrote: > ...
5 years, 8 months ago (2015-04-21 23:13:25 UTC) #7
rkc
https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/1/device/bluetooth/bluetooth_adapter.h#newcode377 device/bluetooth/bluetooth_adapter.h:377: typedef base::Callback<void(scoped_refptr<BluetoothAdvertisement>)> On 2015/04/21 23:13:25, scheib wrote: > On ...
5 years, 8 months ago (2015-04-23 19:32:17 UTC) #8
armansito
https://codereview.chromium.org/1054743003/diff/20001/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/20001/device/bluetooth/bluetooth_advertisement.h#newcode70 device/bluetooth/bluetooth_advertisement.h:70: scoped_ptr<ServiceData> service_data_; On 2015/04/23 19:32:17, Rahul Chaturvedi wrote: > ...
5 years, 8 months ago (2015-04-23 20:13:25 UTC) #9
rkc
https://codereview.chromium.org/1054743003/diff/20001/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/20001/device/bluetooth/bluetooth_advertisement.h#newcode70 device/bluetooth/bluetooth_advertisement.h:70: scoped_ptr<ServiceData> service_data_; On 2015/04/23 20:13:25, armansito wrote: > On ...
5 years, 8 months ago (2015-04-24 20:04:59 UTC) #10
Marie Janssen
lgtm
5 years, 8 months ago (2015-04-24 21:43:08 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/80001
5 years, 8 months ago (2015-04-24 21:52:01 UTC) #13
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
5 years, 8 months ago (2015-04-24 21:52:04 UTC) #15
armansito
Mostly nits. https://codereview.chromium.org/1054743003/diff/80001/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc File chromeos/dbus/bluetooth_le_advertisement_service_provider.cc (right): https://codereview.chromium.org/1054743003/diff/80001/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc#newcode408 chromeos/dbus/bluetooth_le_advertisement_service_provider.cc:408: new FakeBluetoothLEAdvertisementServiceProvider(object_path, delegate)); Why do you call ...
5 years, 8 months ago (2015-04-24 22:11:00 UTC) #16
rkc
https://codereview.chromium.org/1054743003/diff/80001/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc File chromeos/dbus/bluetooth_le_advertisement_service_provider.cc (right): https://codereview.chromium.org/1054743003/diff/80001/chromeos/dbus/bluetooth_le_advertisement_service_provider.cc#newcode408 chromeos/dbus/bluetooth_le_advertisement_service_provider.cc:408: new FakeBluetoothLEAdvertisementServiceProvider(object_path, delegate)); On 2015/04/24 22:11:00, armansito wrote: > ...
5 years, 8 months ago (2015-04-24 22:55:25 UTC) #17
armansito
https://codereview.chromium.org/1054743003/diff/80001/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/80001/device/bluetooth/bluetooth_advertisement.h#newcode119 device/bluetooth/bluetooth_advertisement.h:119: virtual ~BluetoothAdvertisement(); On 2015/04/24 22:55:25, Rahul Chaturvedi wrote: > ...
5 years, 8 months ago (2015-04-24 23:13:13 UTC) #18
rkc
https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h#newcode198 device/bluetooth/bluetooth_adapter.h:198: base::Callback<void(BluetoothAdvertisement::ErrorCode)>; On 2015/04/24 23:13:13, armansito wrote: > Now you ...
5 years, 8 months ago (2015-04-24 23:15:04 UTC) #19
armansito
https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h#newcode183 device/bluetooth/bluetooth_adapter.h:183: using InitCallback = base::Callback<void()>; Use base::Closure here. https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h#newcode198 device/bluetooth/bluetooth_adapter.h:198: ...
5 years, 8 months ago (2015-04-24 23:24:05 UTC) #20
rkc
https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1054743003/diff/100001/device/bluetooth/bluetooth_adapter.h#newcode198 device/bluetooth/bluetooth_adapter.h:198: base::Callback<void(BluetoothAdvertisement::ErrorCode)>; On 2015/04/24 23:24:05, armansito wrote: > On 2015/04/24 ...
5 years, 8 months ago (2015-04-24 23:29:59 UTC) #21
armansito
lgtm, thanks.
5 years, 8 months ago (2015-04-24 23:31:53 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/120001
5 years, 8 months ago (2015-04-24 23:33:15 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/31131)
5 years, 8 months ago (2015-04-24 23:47:44 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/120001
5 years, 8 months ago (2015-04-24 23:49:54 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/140001
5 years, 8 months ago (2015-04-24 23:57:11 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/160001
5 years, 8 months ago (2015-04-25 00:07:10 UTC) #35
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_gn_chromeos_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_gn_chromeos_rel/builds/31146)
5 years, 8 months ago (2015-04-25 00:29:27 UTC) #37
armansito
You'll need to update BUILD.gn as well.
5 years, 8 months ago (2015-04-25 05:50:12 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/180001
5 years, 8 months ago (2015-04-27 18:21:36 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/200001
5 years, 8 months ago (2015-04-27 18:46:31 UTC) #44
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/33104)
5 years, 8 months ago (2015-04-27 19:45:27 UTC) #46
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1054743003/220001
5 years, 8 months ago (2015-04-27 20:31:51 UTC) #49
commit-bot: I haz the power
Committed patchset #12 (id:220001)
5 years, 8 months ago (2015-04-27 21:29:31 UTC) #50
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/c96da18077ef4b5ab28cb8b2684cd84386075e5a Cr-Commit-Position: refs/heads/master@{#327128}
5 years, 8 months ago (2015-04-27 21:30:51 UTC) #51
spang
A revert of this CL (patchset #12 id:220001) has been created in https://codereview.chromium.org/1111563002/ by spang@chromium.org. ...
5 years, 8 months ago (2015-04-27 22:15:56 UTC) #52
Nico
https://codereview.chromium.org/1054743003/diff/220001/device/bluetooth/bluetooth_advertisement.h File device/bluetooth/bluetooth_advertisement.h (right): https://codereview.chromium.org/1054743003/diff/220001/device/bluetooth/bluetooth_advertisement.h#newcode64 device/bluetooth/bluetooth_advertisement.h:64: scoped_ptr<UUIDList> solicit_uuids() { return solicit_uuids_.Pass(); } Having regularly named ...
4 years, 8 months ago (2016-04-08 21:36:48 UTC) #54
rkc
4 years, 8 months ago (2016-04-08 21:57:27 UTC) #55
Message was sent while issue was closed.
https://codereview.chromium.org/1054743003/diff/220001/device/bluetooth/bluet...
File device/bluetooth/bluetooth_advertisement.h (right):

https://codereview.chromium.org/1054743003/diff/220001/device/bluetooth/bluet...
device/bluetooth/bluetooth_advertisement.h:64: scoped_ptr<UUIDList>
solicit_uuids() { return solicit_uuids_.Pass(); }
On 2016/04/08 21:36:48, Nico (hiding until Fri) wrote:
> Having regularly named accessors return scoped_ptrs seems very surprising. I
> wouldn't expect that if I do
> 
>   f(my_obj.solicit_uuids())
> 
> that my_obj's uuids have now been cleared out. Why was this design chosen?

This was a while ago but IIRC, all of these values were scopers we wanted to
pass to the DBus class and give it ownership. Instead of having 4-5 different
parameters to the method that was going to pass these forward, it seemed a bit
cleaner to put all the scopers in one structure and pass the structure along.
See //device/bluetooth/bluetooth_advertisement_bluez.cc:92

We would have liked to passed the entire structure, but at that time the DBus
code was not in //device/bluetooth but rather in //chromeos/dbus and due to
dependency rules (not sure which way it was, //cros/dbus couldn't depend on
//device/bt or the other way) made it so we couldn't share the structure between
the two classes.

Now that the DBus clients for Bluetooth are under //device/bluetooth/dbus, this
code can be made much simpler by simply sharing the structure and passing a
scoper to it rather than do this ugly hack.

Powered by Google App Engine
This is Rietveld 408576698