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

Issue 1611773002: bluetooth: Disconnect if the page becomes hidden or is closed. (Closed)

Created:
4 years, 11 months ago by ortuno
Modified:
4 years, 11 months ago
CC:
blink-reviews, chromium-reviews, scheib+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@my-origin
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

bluetooth: Disconnect if the page becomes hidden or is closed. This means closing connection when: 1. BluetoothGATTRemoteServer is destroyed. 2. The parent document is detached. 3. The page becomes hidden. BUG=579746 Committed: https://crrev.com/2eec1c80c538f99ac3538a40c4a6584079ff7d47 Cr-Commit-Position: refs/heads/master@{#371542}

Patch Set 1 #

Patch Set 2 : Clean up #

Patch Set 3 : Disconnect if page hidden when connected. Clean up #

Total comments: 16

Patch Set 4 : Address jyasskin's comments #

Total comments: 8

Patch Set 5 : Address jyasskin's comments #2 #

Total comments: 8

Patch Set 6 : Address haraken's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+274 lines, -13 lines) Patch
M third_party/WebKit/LayoutTests/bluetooth/connectGATT.html View 1 2 3 1 chunk +24 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html View 1 2 3 4 1 chunk +30 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/gc-detach.html View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/hide-detach.html View 1 2 3 4 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/bluetooth/disconnect-when-hidden-or-closed.html View 1 2 3 1 chunk +61 lines, -0 lines 0 comments Download
A + third_party/WebKit/LayoutTests/bluetooth/resources/connectGATT-iframe.html View 1 2 3 1 chunk +5 lines, -7 lines 0 comments Download
M third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.h View 1 2 3 4 2 chunks +35 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp View 1 2 3 4 5 2 chunks +46 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.idl View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 31 (7 generated)
ortuno
jyasskin: PTAL
4 years, 11 months ago (2016-01-20 23:57:12 UTC) #2
ortuno
Found an issue with this approach. If you call connectGATT() and then change tabs before ...
4 years, 11 months ago (2016-01-21 18:33:57 UTC) #3
Jeffrey Yasskin
On 2016/01/21 18:33:57, ortuno wrote: > Found an issue with this approach. If you call ...
4 years, 11 months ago (2016-01-21 19:54:20 UTC) #4
ortuno
Implemented proposed solution.
4 years, 11 months ago (2016-01-21 22:05:53 UTC) #5
Jeffrey Yasskin
This looks great! Once you've gone through the numerous but small comments below, LGTM. https://codereview.chromium.org/1611773002/diff/40001/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html ...
4 years, 11 months ago (2016-01-21 23:44:34 UTC) #6
ortuno
PTAL. Also added more tests. https://codereview.chromium.org/1611773002/diff/40001/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html File third_party/WebKit/LayoutTests/bluetooth/connectGATT.html (right): https://codereview.chromium.org/1611773002/diff/40001/third_party/WebKit/LayoutTests/bluetooth/connectGATT.html#newcode136 third_party/WebKit/LayoutTests/bluetooth/connectGATT.html:136: }).then(() => testRunner.setPageVisibility('visible')); On ...
4 years, 11 months ago (2016-01-22 21:34:12 UTC) #7
Jeffrey Yasskin
https://codereview.chromium.org/1611773002/diff/60001/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html File third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html (right): https://codereview.chromium.org/1611773002/diff/60001/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html#newcode21 third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html:21: assert_unreached('iframe send invalid data: ' + messageEvent.data); s/send/sent/ I ...
4 years, 11 months ago (2016-01-22 21:59:02 UTC) #8
ortuno
https://codereview.chromium.org/1611773002/diff/60001/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html File third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html (right): https://codereview.chromium.org/1611773002/diff/60001/third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html#newcode21 third_party/WebKit/LayoutTests/bluetooth/disconnect-frame-detached/detach-gc.html:21: assert_unreached('iframe send invalid data: ' + messageEvent.data); On 2016/01/22 ...
4 years, 11 months ago (2016-01-22 22:18:14 UTC) #9
Jeffrey Yasskin
lgtm
4 years, 11 months ago (2016-01-22 22:20:40 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1611773002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1611773002/80001
4 years, 11 months ago (2016-01-23 00:08:16 UTC) #12
ortuno
haraken: We want to send a message to the browser process to disconnect from a ...
4 years, 11 months ago (2016-01-23 00:17:02 UTC) #15
haraken
https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp File third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp (right): https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp#newcode22 third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp:22: PageVisibilityState getPageVisibilityState(ScriptState* scriptState) As commented in the other file, ...
4 years, 11 months ago (2016-01-23 02:02:02 UTC) #16
Jeffrey Yasskin
https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp File third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp (right): https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp#newcode70 third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp:70: WebBluetooth* webbluetooth = BluetoothSupplement::fromExecutionContext(executionContext()); On 2016/01/23 02:02:02, haraken wrote: ...
4 years, 11 months ago (2016-01-23 02:33:36 UTC) #17
haraken
On 2016/01/23 02:33:36, Jeffrey Yasskin wrote: > https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp > File third_party/WebKit/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp > (right): > > ...
4 years, 11 months ago (2016-01-23 02:42:38 UTC) #18
Jeffrey Yasskin
On 2016/01/23 02:42:38, haraken wrote: > On 2016/01/23 02:33:36, Jeffrey Yasskin wrote: > > > ...
4 years, 11 months ago (2016-01-23 03:10:42 UTC) #19
haraken
On 2016/01/23 03:10:42, Jeffrey Yasskin wrote: > On 2016/01/23 02:42:38, haraken wrote: > > On ...
4 years, 11 months ago (2016-01-23 03:33:40 UTC) #20
blink-reviews
FWIW this is leftover for when we were targeting workers. Now that we are not ...
4 years, 11 months ago (2016-01-23 03:37:31 UTC) #21
chromium-reviews
FWIW this is leftover for when we were targeting workers. Now that we are not ...
4 years, 11 months ago (2016-01-23 03:37:34 UTC) #22
haraken
On 2016/01/23 03:37:34, chromium-reviews wrote: > FWIW this is leftover for when we were targeting ...
4 years, 11 months ago (2016-01-23 03:41:07 UTC) #23
ortuno
https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp File third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp (right): https://codereview.chromium.org/1611773002/diff/80001/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp#newcode22 third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp:22: PageVisibilityState getPageVisibilityState(ScriptState* scriptState) On 2016/01/23 at 02:02:02, haraken wrote: ...
4 years, 11 months ago (2016-01-25 23:55:07 UTC) #24
haraken
Thanks, LGTM
4 years, 11 months ago (2016-01-25 23:57:28 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1611773002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1611773002/100001
4 years, 11 months ago (2016-01-26 16:32:40 UTC) #28
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 11 months ago (2016-01-26 18:16:31 UTC) #29
commit-bot: I haz the power
4 years, 11 months ago (2016-01-26 18:18:08 UTC) #31
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/2eec1c80c538f99ac3538a40c4a6584079ff7d47
Cr-Commit-Position: refs/heads/master@{#371542}

Powered by Google App Engine
This is Rietveld 408576698