diff --git a/source b/source index b7d731bcacb..e4d773ecd9c 100644 --- a/source +++ b/source @@ -102361,6 +102361,13 @@ new PaymentRequest(…); // Allowed to use
Set document's salvageable state to false.
Let ports be the list of MessagePort
s whose relevant global
+ object's associated Document
is
+ document.
For each port in ports, disentangle + port.
Run any unloading document cleanup steps for document that are defined by this specification and other applicable specifications.
The disentangle steps, given a MessagePort
initiatorPort
+ which initiates disentangling, are as follows:
Let otherPort be the MessagePort
which initiatorPort
+ was entangled with.
Assert: otherPort exists.
Disentangle initiatorPort and otherPort, so that they are no longer + entangled or associated with each other.
Fire an event named close
at otherPort.
The close
event will be fired even if the port is not
+ explicitly closed. The cases where this event is dispatched are:
close()
method was called;Document
was destroyed; orMessagePort
was garbage
+ collected.We only dispatch the event on otherPort because initiatorPort explicitly
+ triggered the close, its Document
no longer exists, or it was already garbage
+ collected, as described above.
Set this's [[Detached]] internal slot value to true. If this is entangled, disentangle it. If this is entangled, disentangle it. The first time a Broadcasting to many ports is in principle relatively simple: keep an array of
- When a When a When a Furthermore, a Of course, if this was to occur on both sides of the channel, then both ports could be garbage
collected, since they would not be reachable from live code, despite having a strong reference to
- each other. Furthermore, a Authors are strongly encouraged to explicitly close MessagePort
objects are transferable
@@ -114829,7 +114871,7 @@ dictionary StructuredSerializeOptions {
@@ -114845,6 +114887,7 @@ dictionary StructuredSerializeOptions {
onmessage
message
onmessageerror
messageerror
+ onclose
close
MessagePort
object's StructuredSerializeOptions {
-
Broadcasting to many ports
-
-
-
- MessagePort
objects to send messages to, and iterate through the array to send a
- message. However, this has one rather unfortunate effect: it prevents the ports from being garbage
- collected, even if the other side has gone away. To avoid this problem, implement a simple
- protocol whereby the other side acknowledges it still exists. If it doesn't do so after a certain
- amount of time, assume it's gone, close the MessagePort
object, and let it be garbage
- collected.Ports and garbage collection
MessagePort
object o is garbage collected, if o is
+ entangled, then the user agent must disentangle
+ o.MessagePort
object o is entangled and message
or messageerror
+ event listener is registered, user agents must act as if o's entangled
+ MessagePort
object has a strong reference to o.MessagePort
object o is entangled, user agents must either act
- as if o's entangled MessagePort
object has a strong reference to
- o, or as if o's relevant global object has a strong reference
- to o.MessagePort
object must not be garbage collected while there
+ exists an event referenced by a task in a task
+ queue that is to be dispatched on that MessagePort
object, or while the
+ MessagePort
object's port message queue is enabled and not empty.MessagePort
object must not be garbage collected while there exists
- an event referenced by a task in a task queue that is to be dispatched on that MessagePort
- object, or while the MessagePort
object's port message queue is enabled
- and not empty.MessagePort
@@ -139388,8 +139421,8 @@ INSERT INTERFACES HERE
close
Event
- CloseWatcher
, dialog
elements
- Fired at CloseWatcher
objects or dialog
elements when they are closed via a close request or via web developer code
+ CloseWatcher
, dialog
elements, MessagePort
+ Fired at CloseWatcher
objects or dialog
elements when they are closed via a close request or via web developer code, or at MessagePort
objects when disentangled
connect