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

Issue 2658473002: Refactor BluetoothAllowedDevicesMap (Closed)

Created:
3 years, 11 months ago by juncai
Modified:
3 years, 10 months ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, extensions-reviews_chromium.org, jam, jochen+watch_chromium.org, mlamouri+watch-content_chromium.org, ortuno+watch_chromium.org, Peter Beverloo, scheib+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor BluetoothAllowedDevicesMap This CL makes each browser profile have a BluetoothAllowedDevicesMap. And in the map it has 1:1 mapping from origin to BluetoothAllowedDevices. BUG=610343 Review-Url: https://codereview.chromium.org/2658473002 Cr-Commit-Position: refs/heads/master@{#449793} Committed: https://chromium.googlesource.com/chromium/src/+/f70c51172084e2166d9e56acb3e13ce562a1cc45

Patch Set 1 : refactor BluetoothAllowedDevicesMap #

Patch Set 2 : changed --similairty when did git cl upload #

Patch Set 3 : set --similarity=20 when did git cl upload #

Total comments: 20

Patch Set 4 : address comments #

Patch Set 5 : updated test code #

Total comments: 14

Patch Set 6 : merge master #

Patch Set 7 : resolve conflicts #

Patch Set 8 : address comments #

Patch Set 9 : address comments #

Patch Set 10 : address comments #

Patch Set 11 : address comments #

Patch Set 12 : clean up code #

Total comments: 12

Patch Set 13 : added layout test and address comments #

Patch Set 14 : merge master #

Patch Set 15 : cleaned up layout test code #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+475 lines, -1169 lines) Patch
M chrome/browser/browsing_data/browsing_data_remover_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
A + content/browser/bluetooth/bluetooth_allowed_devices.h View 1 2 3 4 5 6 7 5 chunks +33 lines, -49 lines 0 comments Download
A + content/browser/bluetooth/bluetooth_allowed_devices.cc View 1 2 3 4 5 6 7 10 4 chunks +36 lines, -84 lines 0 comments Download
D content/browser/bluetooth/bluetooth_allowed_devices_map.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +22 lines, -89 lines 0 comments Download
D content/browser/bluetooth/bluetooth_allowed_devices_map.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +15 lines, -166 lines 0 comments Download
D content/browser/bluetooth/bluetooth_allowed_devices_map_unittest.cc View 1 chunk +0 lines, -522 lines 0 comments Download
A + content/browser/bluetooth/bluetooth_allowed_devices_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +220 lines, -238 lines 0 comments Download
M content/browser/bluetooth/web_bluetooth_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +2 lines, -4 lines 0 comments Download
M content/browser/bluetooth/web_bluetooth_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +24 lines, -16 lines 0 comments Download
M content/browser/storage_partition_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +4 lines, -0 lines 0 comments Download
M content/browser/storage_partition_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +11 lines, -0 lines 0 comments Download
M content/public/browser/storage_partition.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +3 lines, -0 lines 0 comments Download
M content/shell/browser/layout_test/blink_test_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/bluetooth/server/getPrimaryService/two-iframes-from-same-origin.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +53 lines, -0 lines 4 comments Download

Messages

Total messages: 85 (51 generated)
juncai
Please take a look.
3 years, 11 months ago (2017-01-24 19:00:08 UTC) #5
scheib
Thanks. It's hard to review the files that were renamed because they don't diff to ...
3 years, 11 months ago (2017-01-25 06:18:17 UTC) #8
juncai
On 2017/01/25 06:18:17, scheib wrote: > Thanks. It's hard to review the files that were ...
3 years, 11 months ago (2017-01-25 18:11:21 UTC) #11
scheib
We need to keep the unique origin CHECK and related tests. https://codereview.chromium.org/2658473002/diff/40001/content/browser/bluetooth/bluetooth_allowed_devices.cc File content/browser/bluetooth/bluetooth_allowed_devices.cc (left): ...
3 years, 11 months ago (2017-01-26 04:27:36 UTC) #14
juncai
https://codereview.chromium.org/2658473002/diff/40001/content/browser/bluetooth/bluetooth_allowed_devices.cc File content/browser/bluetooth/bluetooth_allowed_devices.cc (left): https://codereview.chromium.org/2658473002/diff/40001/content/browser/bluetooth/bluetooth_allowed_devices.cc#oldcode32 content/browser/bluetooth/bluetooth_allowed_devices.cc:32: CHECK(!origin.unique()); On 2017/01/26 04:27:36, scheib wrote: > This must ...
3 years, 10 months ago (2017-01-30 20:34:55 UTC) #17
scheib
LGTM
3 years, 10 months ago (2017-01-31 01:16:37 UTC) #20
juncai
reillyg@chromium.org: Please review changes in //chrome/browser/extensions //extensions/browser erg@chromium.org: Please review changes in //chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc dpranke@chromium.org: Please ...
3 years, 10 months ago (2017-01-31 18:43:34 UTC) #26
ortuno
This is still missing layout tests...
3 years, 10 months ago (2017-01-31 18:46:02 UTC) #28
juncai
dcheng@chromium.org: Please review changes in //content/shell/common/shell_messages.h
3 years, 10 months ago (2017-01-31 18:46:16 UTC) #30
juncai
On 2017/01/31 18:46:02, ortuno wrote: > This is still missing layout tests... Thanks! Working on ...
3 years, 10 months ago (2017-01-31 18:48:29 UTC) #31
Elliot Glaysher
profiles lgtm
3 years, 10 months ago (2017-01-31 20:31:49 UTC) #32
sky
c/b/ui LGTM
3 years, 10 months ago (2017-01-31 23:38:36 UTC) #33
Reilly Grant (use Gerrit)
lgtm https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/bluetooth_allowed_devices.cc File content/browser/bluetooth/bluetooth_allowed_devices.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/bluetooth_allowed_devices.cc#newcode74 content/browser/bluetooth/bluetooth_allowed_devices.cc:74: } nit: no braces around single-line if
3 years, 10 months ago (2017-01-31 23:47:37 UTC) #34
jam
https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc File content/public/browser/bluetooth_allowed_devices_map_base.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc#newcode18 content/public/browser/bluetooth_allowed_devices_map_base.cc:18: BluetoothAllowedDevicesMapBase::GetOrCreateAllowedDevices(url::Origin origin) { See https://www.chromium.org/developers/content-module/content-api for guidelines on content/public. ...
3 years, 10 months ago (2017-02-01 01:18:24 UTC) #35
juncai
https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc File content/public/browser/bluetooth_allowed_devices_map_base.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc#newcode18 content/public/browser/bluetooth_allowed_devices_map_base.cc:18: BluetoothAllowedDevicesMapBase::GetOrCreateAllowedDevices(url::Origin origin) { On 2017/02/01 01:18:24, jam wrote: > ...
3 years, 10 months ago (2017-02-01 05:19:28 UTC) #36
dcheng
https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1130 content/browser/bluetooth/web_bluetooth_service_impl.cc:1130: allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin()); Is this expected to be immutable per-origin? https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.h ...
3 years, 10 months ago (2017-02-01 07:54:09 UTC) #37
juncai
https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1130 content/browser/bluetooth/web_bluetooth_service_impl.cc:1130: allowed_devices_map->GetOrCreateAllowedDevices(GetOrigin()); On 2017/02/01 07:54:09, dcheng wrote: > Is this ...
3 years, 10 months ago (2017-02-02 01:44:33 UTC) #38
Dirk Pranke
lgtm
3 years, 10 months ago (2017-02-02 01:51:45 UTC) #39
dcheng
https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc File content/public/browser/bluetooth_allowed_devices_map_base.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc#newcode21 content/public/browser/bluetooth_allowed_devices_map_base.cc:21: CHECK(!origin.unique()); Why is this a CHECK()? This appears to ...
3 years, 10 months ago (2017-02-02 05:26:03 UTC) #40
jam
https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc File content/public/browser/bluetooth_allowed_devices_map_base.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/public/browser/bluetooth_allowed_devices_map_base.cc#newcode18 content/public/browser/bluetooth_allowed_devices_map_base.cc:18: BluetoothAllowedDevicesMapBase::GetOrCreateAllowedDevices(url::Origin origin) { On 2017/02/01 05:19:27, juncai wrote: > ...
3 years, 10 months ago (2017-02-02 06:13:28 UTC) #41
juncai
https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/bluetooth_allowed_devices.cc File content/browser/bluetooth/bluetooth_allowed_devices.cc (right): https://codereview.chromium.org/2658473002/diff/80001/content/browser/bluetooth/bluetooth_allowed_devices.cc#newcode74 content/browser/bluetooth/bluetooth_allowed_devices.cc:74: } On 2017/01/31 23:47:37, Reilly Grant wrote: > nit: ...
3 years, 10 months ago (2017-02-03 04:47:55 UTC) #54
ortuno
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1194 content/browser/bluetooth/web_bluetooth_service_impl.cc:1194: return allowed_devices_; Can this be null? If so we ...
3 years, 10 months ago (2017-02-03 20:16:51 UTC) #56
scheib
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1185 content/browser/bluetooth/web_bluetooth_service_impl.cc:1185: StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( I suppose check with jam@, ...
3 years, 10 months ago (2017-02-03 23:28:13 UTC) #57
dcheng
mojo lgtm
3 years, 10 months ago (2017-02-05 09:41:26 UTC) #58
jam
lgtm
3 years, 10 months ago (2017-02-06 18:51:45 UTC) #59
juncai
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1185 content/browser/bluetooth/web_bluetooth_service_impl.cc:1185: StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( On 2017/02/03 23:28:13, scheib wrote: ...
3 years, 10 months ago (2017-02-08 06:43:50 UTC) #68
jam1
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1185 content/browser/bluetooth/web_bluetooth_service_impl.cc:1185: StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( On 2017/02/08 06:43:49, juncai wrote: ...
3 years, 10 months ago (2017-02-10 05:24:39 UTC) #74
scheib
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1185 content/browser/bluetooth/web_bluetooth_service_impl.cc:1185: StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( On 2017/02/10 05:24:39, jam1 wrote: ...
3 years, 10 months ago (2017-02-10 06:33:59 UTC) #75
juncai
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1185 content/browser/bluetooth/web_bluetooth_service_impl.cc:1185: StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( On 2017/02/10 06:33:59, scheib wrote: ...
3 years, 10 months ago (2017-02-10 22:30:43 UTC) #76
scheib
https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc File content/browser/bluetooth/web_bluetooth_service_impl.cc (right): https://codereview.chromium.org/2658473002/diff/210001/content/browser/bluetooth/web_bluetooth_service_impl.cc#newcode1185 content/browser/bluetooth/web_bluetooth_service_impl.cc:1185: StoragePartitionImpl* partition = static_cast<StoragePartitionImpl*>( On 2017/02/10 22:30:43, juncai wrote: ...
3 years, 10 months ago (2017-02-10 23:31:21 UTC) #77
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/2658473002/270001
3 years, 10 months ago (2017-02-10 23:38:51 UTC) #80
commit-bot: I haz the power
Committed patchset #15 (id:270001) as https://chromium.googlesource.com/chromium/src/+/f70c51172084e2166d9e56acb3e13ce562a1cc45
3 years, 10 months ago (2017-02-10 23:50:05 UTC) #83
ortuno
You might want to read about promises a bit: https://developers.google.com/web/fundamentals/getting-started/primers/promises https://codereview.chromium.org/2658473002/diff/270001/third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html File third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html (right): https://codereview.chromium.org/2658473002/diff/270001/third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html#newcode29 ...
3 years, 10 months ago (2017-02-14 02:52:28 UTC) #84
juncai
3 years, 10 months ago (2017-02-14 05:52:47 UTC) #85
Message was sent while issue was closed.
https://codereview.chromium.org/2658473002/diff/270001/third_party/WebKit/Lay...
File
third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html
(right):

https://codereview.chromium.org/2658473002/diff/270001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html:29:
gattServer.getPrimaryService('heart_rate');
On 2017/02/14 02:52:28, ortuno wrote:
> Why are we calling getPrimaryService here? We are not doing anything with the
> promise so even if it rejects we won't know.

Thanks! I'll fix it in a separate CL.

https://codereview.chromium.org/2658473002/diff/270001/third_party/WebKit/Lay...
third_party/WebKit/LayoutTests/resources/bluetooth/heart-rate-two-iframes.html:44:
gattServer.getPrimaryService('generic_access');
On 2017/02/14 02:52:28, ortuno wrote:
> Same here. The promise could reject and we would still pass the test.

ditto.

Powered by Google App Engine
This is Rietveld 408576698