When the receiving user agent is to start monitoring incoming presentation connections in a receiving browsing context from controlling browsing contexts, it MUST listen to and accept incoming connection requests from a controlling browsing context using an implementation specific mechanism. When a new connection request is received from a controlling browsing context, the receiving user agent MUST run the following steps:
- Input
- I, the presentation identifier passed by the controlling browsing context with the incoming connection request.
- presentationId, the presentation identifier used to create the receiving browsing context.
- presentationUrl, the presentation request URL used to create the receiving browsing context.
- If presentationId and I are not equal, refuse the connection and abort all remaining steps.
- Create a new
PresentationConnection
S. - Set the presentation identifier of S to I.
- Set the presentation URL of S to presentationUrl.
- Establish the connection between the controlling and receiving browsing contexts using an implementation specific mechanism.
- If connection establishment completes successfully, set the presentation connection state of S to
connected
. Otherwise, set the presentation connection state of S toclosed
and abort all remaining steps. - Add S to the set of presentation controllers.
- If the presentation controllers monitor is
null
, run the following steps in parallel.- Let the presentation controllers monitor be a new
PresentationConnectionList
. - Populate the presentation controllers monitor with the set of presentation controllers.
- If the presentation controllers promise is not
null
, resolve the presentation controllers promise with the presentation controllers monitor. - Abort all remaining steps.
- Let the presentation controllers monitor be a new
- Otherwise, run the following steps in parallel.
- Populate the presentation controllers monitor with the set of presentation controllers.
- Queue a task to fire a trusted event with the name
connectionavailable
, that uses thePresentationConnectionAvailableEvent
interface, with theconnection
attribute initialized to S, at the presentation controllers monitor. The event must not bubble, must not be cancelable, and has no default action.
Attribute
connections
- attribute MUST return the non-terminated set of presentation connections in the set of presentation controllers.
Event Handlers
The following are the event handlers (and their corresponding event handler event types) that must be supported, as event handler IDL attributes, by objects implementing the PresentationConnectionList
interface.
Event handler | Event handler event type |
---|---|
onconnectionavailable |
connectionavailable |