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

Issue 2484273003: [Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destr… (Closed)

Created:
4 years, 1 month ago by zhaobin
Modified:
3 years, 9 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, haraken, jam, mlamouri+watch-content_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Presentation API] (1-UA) fire PresentationConnection onterminate event if receiver page gets destroyed We need to fire 'onterminate' event on controller frame if (Please add scenarios that are missing): Controller initiates termination: 1. call connection.terminate() in js 2. click 'stop' on MR dialog (closing controller frame will close but not terminate connection) 1. and 2. are equivalent in the sense that connection.terminate() just calls router->terminateRoute(). Cast MRP will notify state change and fire 'onterminate' event in these cases. (Existing implementation covers this) Receiver initiates termination: 1. receiver frame gets destroyed, e.g. call window.close() in js 2. call connection.terminate() in js We can make 1. and 2. equivalent, by having connection.terminate() call window.close(). When offscreen_tab is gone, cast MRP will get notified (mirroring has been stopped) and notify controller about state change. BUG=588874 Review-Url: https://codereview.chromium.org/2484273003 Cr-Commit-Position: refs/heads/master@{#454497} Committed: https://chromium.googlesource.com/chromium/src/+/ad129a062423b83cf71bbf1f3e114ea7d8828fab

Patch Set 1 #

Total comments: 2

Patch Set 2 : resolve code review comments from haraken #

Total comments: 14

Patch Set 3 : merge with master #

Total comments: 8

Patch Set 4 : resolve code review comments from Derek #

Patch Set 5 : resolve code review comments from Mark #

Total comments: 2

Patch Set 6 : fix unit test errors #

Patch Set 7 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+185 lines, -20 lines) Patch
M content/renderer/presentation/presentation_dispatcher.h View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.cc View 1 2 3 4 5 6 2 chunks +14 lines, -1 line 0 comments Download
M content/renderer/presentation/presentation_dispatcher_unittest.cc View 1 2 3 4 5 6 2 chunks +5 lines, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/presentation/presentation-controller-terminate-connection.html View 1 2 3 4 1 chunk +29 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/presentation/presentation-onreceiverconnection.html View 1 2 3 4 1 chunk +9 lines, -12 lines 0 comments Download
A third_party/WebKit/LayoutTests/presentation/presentation-receiver-terminate-connection.html View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/presentation/resources/presentation-receiver-postmessage.html View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/presentation/resources/presentation-service-mock.js View 1 2 3 4 2 chunks +18 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationConnection.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp View 1 2 3 4 5 6 2 chunks +11 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationReceiver.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp View 1 2 3 4 2 chunks +22 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationReceiverTest.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/public/platform/modules/presentation/WebPresentationClient.h View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/public/platform/modules/presentation/WebPresentationReceiver.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 45 (25 generated)
zhaobin
4 years, 1 month ago (2016-11-08 22:56:31 UTC) #2
haraken
Drive-by https://codereview.chromium.org/2484273003/diff/1/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp File third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp (right): https://codereview.chromium.org/2484273003/diff/1/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp#newcode73 third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp:73: if (!window->closed()) You need to check if frame(), ...
4 years, 1 month ago (2016-11-08 23:44:50 UTC) #4
zhaobin
https://codereview.chromium.org/2484273003/diff/1/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp File third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp (right): https://codereview.chromium.org/2484273003/diff/1/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp#newcode73 third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp:73: if (!window->closed()) On 2016/11/08 23:44:50, haraken wrote: > > ...
4 years, 1 month ago (2016-11-09 03:40:12 UTC) #5
imcheng
Some preliminary comments but I didn't look too far since I'd imagine this would change ...
4 years ago (2016-11-28 22:12:01 UTC) #6
haraken
https://codereview.chromium.org/2484273003/diff/20001/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp File third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp (right): https://codereview.chromium.org/2484273003/diff/20001/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp#newcode80 third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp:80: if (!document) This check won't be needed. You can ...
4 years ago (2016-11-29 02:15:50 UTC) #7
mark a. foltz
It sounds like this is still relevant to land - but needs to be rebased ...
3 years, 10 months ago (2017-02-14 21:43:00 UTC) #8
zhaobin
On 2017/02/14 21:43:00, mark a. foltz wrote: > It sounds like this is still relevant ...
3 years, 10 months ago (2017-02-14 22:31:58 UTC) #9
zhaobin
https://codereview.chromium.org/2484273003/diff/20001/content/browser/presentation/presentation_service_impl.cc File content/browser/presentation/presentation_service_impl.cc (right): https://codereview.chromium.org/2484273003/diff/20001/content/browser/presentation/presentation_service_impl.cc#newcode580 content/browser/presentation/presentation_service_impl.cc:580: if (receiver_delegate_) { On 2016/11/28 22:12:00, imcheng wrote: > ...
3 years, 10 months ago (2017-02-16 00:42:31 UTC) #10
imcheng
The controller-initiated terminate logic makes sense but I would like to get some clarification on ...
3 years, 10 months ago (2017-02-24 19:20:33 UTC) #11
zhaobin
https://codereview.chromium.org/2484273003/diff/20001/content/browser/presentation/presentation_service_impl.cc File content/browser/presentation/presentation_service_impl.cc (right): https://codereview.chromium.org/2484273003/diff/20001/content/browser/presentation/presentation_service_impl.cc#newcode580 content/browser/presentation/presentation_service_impl.cc:580: if (receiver_delegate_) { On 2017/02/24 19:20:33, imcheng wrote: > ...
3 years, 10 months ago (2017-02-25 01:31:03 UTC) #12
mark a. foltz
https://codereview.chromium.org/2484273003/diff/20001/content/browser/presentation/presentation_service_impl.cc File content/browser/presentation/presentation_service_impl.cc (right): https://codereview.chromium.org/2484273003/diff/20001/content/browser/presentation/presentation_service_impl.cc#newcode580 content/browser/presentation/presentation_service_impl.cc:580: if (receiver_delegate_) { On 2017/02/24 at 19:20:33, imcheng wrote: ...
3 years, 10 months ago (2017-02-25 01:43:12 UTC) #13
mark a. foltz
Would it be possible to write a layout test that verifies that a receiver frame ...
3 years, 10 months ago (2017-02-25 01:47:35 UTC) #14
zhaobin
Added layout test for connection.terminate(). Receiver connection state changes to 'terminated' after onbeforeunload() and before ...
3 years, 9 months ago (2017-02-28 04:25:19 UTC) #15
mark a. foltz
lgtm
3 years, 9 months ago (2017-03-01 05:13:16 UTC) #16
imcheng
lgtm https://codereview.chromium.org/2484273003/diff/80001/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp File third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp (right): https://codereview.chromium.org/2484273003/diff/80001/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp#newcode72 third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp:72: for (auto connection : m_connectionList->connections()) Can this be ...
3 years, 9 months ago (2017-03-02 01:15:03 UTC) #17
zhaobin
https://codereview.chromium.org/2484273003/diff/80001/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp File third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp (right): https://codereview.chromium.org/2484273003/diff/80001/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp#newcode72 third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp:72: for (auto connection : m_connectionList->connections()) On 2017/03/02 01:15:03, imcheng ...
3 years, 9 months ago (2017-03-02 23:44:33 UTC) #34
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/2484273003/100001
3 years, 9 months ago (2017-03-02 23:45:21 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/377396)
3 years, 9 months ago (2017-03-02 23:53:47 UTC) #39
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/2484273003/120001
3 years, 9 months ago (2017-03-03 01:30:38 UTC) #42
commit-bot: I haz the power
3 years, 9 months ago (2017-03-03 03:20:53 UTC) #45
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/ad129a062423b83cf71bbf1f3e11...

Powered by Google App Engine
This is Rietveld 408576698