[html5] r8660 - [giow] (1) Make BroadcastChannel objects work in workers Fixing https://www.w3.o [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Jun 6 14:27:39 PDT 2014


Author: ianh
Date: 2014-06-06 14:27:35 -0700 (Fri, 06 Jun 2014)
New Revision: 8660

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Make BroadcastChannel objects work in workers
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=24414
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2014-06-06 20:11:49 UTC (rev 8659)
+++ complete.html	2014-06-06 21:27:35 UTC (rev 8660)
@@ -83490,7 +83490,7 @@
   <p>For simple cases, though, where a shared worker would be an unreasonable overhead, authors can
   use the simple channel-based broadcast mechanism described in this section.</p>
 
-  <pre class=idl>[<a href=#dom-broadcastchannel title=dom-BroadcastChannel>Constructor</a>(DOMString channel)]
+  <pre class=idl>[<a href=#dom-broadcastchannel title=dom-BroadcastChannel>Constructor</a>(DOMString channel), Exposed=Window,Worker]
 interface <dfn id=broadcastchannel>BroadcastChannel</dfn> : <a href=#eventtarget>EventTarget</a> {
   readonly attribute DOMString <a href=#dom-broadcastchannel-name title=dom-BroadcastChannel-name>name</a>;
   void <a href=#dom-broadcastchannel-postmessage title=dom-BroadcastChannel-postMessage>postMessage</a>(any message);
@@ -83552,9 +83552,19 @@
     <p>Let <var title="">destinations</var> be a list of <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects that
     match the following criteria:</p>
 
-    <ul><li><p>Their <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a> specifies a
-     <a href=#responsible-document>responsible document</a> that is <a href=#fully-active>fully active</a>.</li>
+    <ul><li>
 
+      <p>Their <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a> specifies either:</p>
+
+      <ul><li><p>a <a href=#global-object>global object</a> that is a <code><a href=#window>Window</a></code> object and a
+       <a href=#responsible-document>responsible document</a> that is <a href=#fully-active>fully active</a>, or</li>
+
+       <li><p>a <a href=#global-object>global object</a> that is a <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object whose
+       <code title=dom-WorkerGlobalScope-closing><a href=#dom-workerglobalscope-closing>closing</a></code> flag is false and whose
+       <a href=#worker>worker</a> is a <a href=#suspendable-worker>suspendable worker</a>.</li>
+
+      </ul></li>
+
      <li><p>Their <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a> specifies an
      <a href=#origin>origin</a> that is the <a href=#same-origin>same origin</a> as the <a href=#origin>origin</a> specified
      by <var title="">source settings</var>.</li>
@@ -83593,7 +83603,7 @@
      <code><a href=#broadcastchannel>BroadcastChannel</a></code> object.</li>
 
     </ol><p>The <a href=#concept-task title=concept-task>tasks</a> must be associated with the <a href=#responsible-document>responsible
-    document</a> specified by the <code><a href=#broadcastchannel>BroadcastChannel</a></code> object's
+    document</a> specified by the target <code><a href=#broadcastchannel>BroadcastChannel</a></code> object's
     <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a>, and must use the <a href=#dom-manipulation-task-source>DOM
     manipulation task source</a>.</p>
 
@@ -83613,11 +83623,6 @@
    <tbody><tr><td><dfn id=handler-broadcastchannel-onmessage title=handler-BroadcastChannel-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code>
   </table></div>
 
-  <p class=note>Authors are strongly encouraged to explicitly close <code><a href=#messageport>MessagePort</a></code>
-  objects to disentangle them, so that their resources can be recollected. Creating many
-  <code><a href=#messageport>MessagePort</a></code> objects and discarding them without closing them can lead to high
-  transient memory usage since garbage collection is not necessarily performed promptly.</p>
-
   <div class=example>
 
    <p>Suppose a page wants to know when the user logs out, even when the user does so from another

Modified: index
===================================================================
--- index	2014-06-06 20:11:49 UTC (rev 8659)
+++ index	2014-06-06 21:27:35 UTC (rev 8660)
@@ -83490,7 +83490,7 @@
   <p>For simple cases, though, where a shared worker would be an unreasonable overhead, authors can
   use the simple channel-based broadcast mechanism described in this section.</p>
 
-  <pre class=idl>[<a href=#dom-broadcastchannel title=dom-BroadcastChannel>Constructor</a>(DOMString channel)]
+  <pre class=idl>[<a href=#dom-broadcastchannel title=dom-BroadcastChannel>Constructor</a>(DOMString channel), Exposed=Window,Worker]
 interface <dfn id=broadcastchannel>BroadcastChannel</dfn> : <a href=#eventtarget>EventTarget</a> {
   readonly attribute DOMString <a href=#dom-broadcastchannel-name title=dom-BroadcastChannel-name>name</a>;
   void <a href=#dom-broadcastchannel-postmessage title=dom-BroadcastChannel-postMessage>postMessage</a>(any message);
@@ -83552,9 +83552,19 @@
     <p>Let <var title="">destinations</var> be a list of <code><a href=#broadcastchannel>BroadcastChannel</a></code> objects that
     match the following criteria:</p>
 
-    <ul><li><p>Their <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a> specifies a
-     <a href=#responsible-document>responsible document</a> that is <a href=#fully-active>fully active</a>.</li>
+    <ul><li>
 
+      <p>Their <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a> specifies either:</p>
+
+      <ul><li><p>a <a href=#global-object>global object</a> that is a <code><a href=#window>Window</a></code> object and a
+       <a href=#responsible-document>responsible document</a> that is <a href=#fully-active>fully active</a>, or</li>
+
+       <li><p>a <a href=#global-object>global object</a> that is a <code><a href=#workerglobalscope>WorkerGlobalScope</a></code> object whose
+       <code title=dom-WorkerGlobalScope-closing><a href=#dom-workerglobalscope-closing>closing</a></code> flag is false and whose
+       <a href=#worker>worker</a> is a <a href=#suspendable-worker>suspendable worker</a>.</li>
+
+      </ul></li>
+
      <li><p>Their <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a> specifies an
      <a href=#origin>origin</a> that is the <a href=#same-origin>same origin</a> as the <a href=#origin>origin</a> specified
      by <var title="">source settings</var>.</li>
@@ -83593,7 +83603,7 @@
      <code><a href=#broadcastchannel>BroadcastChannel</a></code> object.</li>
 
     </ol><p>The <a href=#concept-task title=concept-task>tasks</a> must be associated with the <a href=#responsible-document>responsible
-    document</a> specified by the <code><a href=#broadcastchannel>BroadcastChannel</a></code> object's
+    document</a> specified by the target <code><a href=#broadcastchannel>BroadcastChannel</a></code> object's
     <a href=#broadcastchannel-settings-object><code>BroadcastChannel</code> settings object</a>, and must use the <a href=#dom-manipulation-task-source>DOM
     manipulation task source</a>.</p>
 
@@ -83613,11 +83623,6 @@
    <tbody><tr><td><dfn id=handler-broadcastchannel-onmessage title=handler-BroadcastChannel-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code>
   </table></div>
 
-  <p class=note>Authors are strongly encouraged to explicitly close <code><a href=#messageport>MessagePort</a></code>
-  objects to disentangle them, so that their resources can be recollected. Creating many
-  <code><a href=#messageport>MessagePort</a></code> objects and discarding them without closing them can lead to high
-  transient memory usage since garbage collection is not necessarily performed promptly.</p>
-
   <div class=example>
 
    <p>Suppose a page wants to know when the user logs out, even when the user does so from another

Modified: source
===================================================================
--- source	2014-06-06 20:11:49 UTC (rev 8659)
+++ source	2014-06-06 21:27:35 UTC (rev 8660)
@@ -92548,7 +92548,7 @@
   <p>For simple cases, though, where a shared worker would be an unreasonable overhead, authors can
   use the simple channel-based broadcast mechanism described in this section.</p>
 
-  <pre class="idl">[<span data-x="dom-BroadcastChannel">Constructor</span>(DOMString channel)]
+  <pre class="idl">[<span data-x="dom-BroadcastChannel">Constructor</span>(DOMString channel), Exposed=Window,Worker]
 interface <dfn>BroadcastChannel</dfn> : <span>EventTarget</span> {
   readonly attribute DOMString <span data-x="dom-BroadcastChannel-name">name</span>;
   void <span data-x="dom-BroadcastChannel-postMessage">postMessage</span>(any message);
@@ -92619,9 +92619,23 @@
 
     <ul>
 
-     <li><p>Their <span><code>BroadcastChannel</code> settings object</span> specifies a
-     <span>responsible document</span> that is <span>fully active</span>.</p></li>
+     <li>
 
+      <p>Their <span><code>BroadcastChannel</code> settings object</span> specifies either:</p>
+
+      <ul>
+
+       <li><p>a <span>global object</span> that is a <code>Window</code> object and a
+       <span>responsible document</span> that is <span>fully active</span>, or</p></li>
+
+       <li><p>a <span>global object</span> that is a <code>WorkerGlobalScope</code> object whose
+       <code data-x="dom-WorkerGlobalScope-closing">closing</code> flag is false and whose
+       <span>worker</span> is a <span>suspendable worker</span>.</p></li>
+
+      </ul>
+
+     </li>
+
      <li><p>Their <span><code>BroadcastChannel</code> settings object</span> specifies an
      <span>origin</span> that is the <span>same origin</span> as the <span>origin</span> specified
      by <var data-x="">source settings</var>.</p></li>
@@ -92668,7 +92682,7 @@
     </ol>
 
     <p>The <span data-x="concept-task">tasks</span> must be associated with the <span>responsible
-    document</span> specified by the <code>BroadcastChannel</code> object's
+    document</span> specified by the target <code>BroadcastChannel</code> object's
     <span><code>BroadcastChannel</code> settings object</span>, and must use the <span>DOM
     manipulation task source</span>.</p>
 
@@ -92698,11 +92712,6 @@
 
   </div>
 
-  <p class="note">Authors are strongly encouraged to explicitly close <code>MessagePort</code>
-  objects to disentangle them, so that their resources can be recollected. Creating many
-  <code>MessagePort</code> objects and discarding them without closing them can lead to high
-  transient memory usage since garbage collection is not necessarily performed promptly.</p>
-
   <div class="example">
 
    <p>Suppose a page wants to know when the user logs out, even when the user does so from another



More information about the Commit-Watchers mailing list