New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 712858 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug


Participants' hotlists:
presentation-api-1ua


Sign in to add a comment

[Presentation API] connection.terminate() for presentation does not terminate connection

Project Member Reported by mfo...@chromium.org, Apr 18 2017

Issue description

Reported by @tomoyukilabs (not confirmed):

https://github.com/w3c/presentation-api/issues/422#issuecomment-294406040

Chrome Version: 60.0.3074.0
OS: Mac OS X

What steps will reproduce the problem?
(1) Start a 1-UA presentation
(2) Call terminate() in the receiver page

What is the expected result?
terminate event fires on the controller connection and its state is terminated

What happens instead?
Chrome closes the presentation connection with error as reason and Remove route as message.

---

It looks like we rely on the MRP to generate this state change, but it is not generating the correct state change in response to a deliberate teardown of the offscreen tab.  Maybe we should handle this in the OffscreenPresentationManager?

 
Saw this happen when terminate immediately in connection.onconnect handler. Connection has changed to 'connected', but MRP has not finished all set up, so terminate state is not passed correctly back to MR.

Should work if wait 1-2s before calling connection.terminate() in js file. Will work on a fix to handle 1-UA terminate in PresentationConnectionProxy and OffscreenPresentationManager.

Comment 2 by sko...@chromium.org, Apr 19 2017

Cc: -zhaobin@chromium.org
Owner: zhaobin@chromium.org
Status: Assigned (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, May 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/265357c7a152a62f98e998111f8b77c3779a234a

commit 265357c7a152a62f98e998111f8b77c3779a234a
Author: zhaobin <zhaobin@chromium.org>
Date: Thu May 18 17:40:13 2017

[Presentation API] Change controller connection to 'terminated' when receiver connection terminates

When calling receiver connection.terminate(), we rely on MRP to change controller connection to 'terminated'. If receiver page goes away before MRP finishes setting up mirroring, MPR will signal 'closed' instead of 'terminated'. Fix this by making receiver connection proxy signal 'terminated' to controller connection when receiver frame goes away at browser side.

BUG= 712858 

Review-Url: https://codereview.chromium.org/2863903002
Cr-Commit-Position: refs/heads/master@{#472860}

[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/content/renderer/presentation/presentation_connection_proxy.cc
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/content/renderer/presentation/presentation_connection_proxy.h
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/content/renderer/presentation/presentation_connection_proxy_unittest.cc
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/third_party/WebKit/LayoutTests/presentation/presentation-receiver-terminate-connection.html
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/third_party/WebKit/LayoutTests/presentation/resources/presentation-receiver-postmessage.html
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/third_party/WebKit/Source/modules/presentation/PresentationConnection.cpp
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/third_party/WebKit/Source/modules/presentation/PresentationConnection.h
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/third_party/WebKit/Source/modules/presentation/PresentationReceiver.cpp
[modify] https://crrev.com/265357c7a152a62f98e998111f8b77c3779a234a/third_party/WebKit/public/platform/modules/presentation/WebPresentationConnectionProxy.h

Comment 4 by sko...@chromium.org, May 31 2017

Status: Fixed (was: Assigned)

Sign in to add a comment