Skip to content

Commit

Permalink
[giow] (0) Remove support for receiving an error message when a port'…
Browse files Browse the repository at this point in the history
…s other side is destroyed by the OS, due to lack of implementation interest.

Affected topics: DOM APIs

git-svn-id: http://svn.whatwg.org/webapps@8452 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 3, 2014
1 parent 8df2d1c commit abe9b4a
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 68 deletions.
76 changes: 46 additions & 30 deletions complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -81343,8 +81343,8 @@ <h4 id=message-ports><span class=secno>9.5.3 </span>Message ports</h4>

// event handlers
attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-messageport-onmessage title=handler-MessagePort-onmessage>onmessage</a>;
attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-messageport-onerror title=handler-MessagePort-onerror>onerror</a>;
};
<!--ILLFATED attribute <span>EventHandler</span> <span title="handler-MessagePort-onerror">onerror</span>;
-->};
// <a href=#messageport>MessagePort</a> implements <a href=#transferable>Transferable</a>;</pre>

<dl class=domintro><dt><var title="">port</var> . <code title=dom-MessagePort-postMessage><a href=#dom-messageport-postmessage>postMessage</a></code>(<var title="">message</var> [, <var title="">transfer</var>] )</dt>
Expand Down Expand Up @@ -81470,14 +81470,16 @@ <h4 id=message-ports><span class=secno>9.5.3 </span>Message ports</h4>
specifies a <a href=#responsible-event-loop>responsible event loop</a> that is a <a href=#browsing-context>browsing context</a> <a href=#event-loop>event loop</a>, associating the moved <a href=#concept-task title=concept-task>tasks</a> with the <a href=#responsible-document>responsible document</a> specified by <var title="">new port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>.</li>

<!--CLEANUP-->
<li><p>If <var title="">original port</var> is <a href=#related-to-an-ill-fated-port>related to an ill-fated port</a>, then
create a <a href=#concept-task title=concept-task>task</a> that <a href=#fire-a-simple-event title="fire a simple event">fires a
simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <var title="">new
port</var>, and add the <a href=#concept-task title=concept-task>task</a> to the <a href=#port-message-queue>port message
queue</a> of <var title="">new port</var>. If the <var title="">new port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>
specifies a <a href=#responsible-event-loop>responsible event loop</a> that is a <a href=#browsing-context>browsing context</a> <a href=#event-loop>event loop</a>, the <a href=#concept-task title=concept-task>task</a> must
be associated with the <a href=#responsible-document>responsible document</a> specified by <var title="">new
port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>.</li>
<!--ILLFATED
<li><p>If <var title="">original port</var> is <span>related to an ill-fated port</span>, then
create a <span title="concept-task">task</span> that <span title="fire a simple event">fires a
simple event</span> named <code title="event-error">error</code> at the <var title="">new
port</var>, and add the <span title="concept-task">task</span> to the <span>port message
queue</span> of <var title="">new port</var>. If the <var title="">new port</var>'s <span title="concept-port-owner">owner</span>
specifies a <span>responsible event loop</span> that is a <span>browsing context</span> <span>event loop</span>, the <span title="concept-task">task</span> must
be associated with the <span>responsible document</span> specified by <var title="">new
port</var>'s <span title="concept-port-owner">owner</span>.</p></li>
-->

<li>

Expand Down Expand Up @@ -81697,38 +81699,52 @@ <h4 id=message-ports><span class=secno>9.5.3 </span>Message ports</h4>
disentangle the two ports. If the method is called on a port that is not entangled, then the
method must do nothing.</p>

<hr><p>In some circumstances, an entangled <code><a href=#messageport>MessagePort</a></code> <var title="">source port</var>
that is not <a href=#ports-and-garbage-collection>eligible for garbage collection</a> will
<!--ILLFATED (search for '- -')
<hr>

<p>In some circumstances, an entangled <code>MessagePort</code> <var title="">source port</var>
that is not <a href="#ports-and-garbage-collection">eligible for garbage collection</a> will
nonetheless find itself prematurely destroyed, for example if the user manually terminates the
user agent's host process. Under such circumstances, user agents should attempt to following these
steps:</p>

<!-- don't fire this for navigation, it would break bfcache -->
<!-- for consistency, we don't fire this for worker termination -->
<!-- we don't fire it on .close() because that would let you probe GC behaviour also -->
<!- - don't fire this for navigation, it would break bfcache - ->
<!- - for consistency, we don't fire this for worker termination - ->
<!- - we don't fire it on .close() because that would let you probe GC behaviour also - ->

<ol>

<ol><li><p>Let <var title="">target port</var> be the port with which the ill-fated <var title="">source port</var> is entangled.</li>
<li><p>Let <var title="">target port</var> be the port with which the ill-fated <var
title="">source port</var> is entangled.</p></li>

<li><p>If there is no <var title="">target port</var> (i.e. if <var title="">source port</var>
is not entangled), or if <var title="">target port</var> is suffering the same fate as <var title="">source port</var> (e.g. if both ports are in the same host process), then abort these
steps.</li>
is not entangled), or if <var title="">target port</var> is suffering the same fate as <var
title="">source port</var> (e.g. if both ports are in the same host process), then abort these
steps.</p></li>

<li><p>Mark <var title="">target port</var> as being a <dfn id=related-to-an-ill-fated-port>related to an ill-fated
port</dfn>.</li>
<li><p>Mark <var title="">target port</var> as being a <dfn>related to an ill-fated
port</dfn>.</p></li>

<!--CLEANUP-->
<li><p>Create a <a href=#concept-task title=concept-task>task</a> that <a href=#fire-a-simple-event title="fire a simple
event">fires a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at <var title="">target port</var>, and add the <a href=#concept-task title=concept-task>task</a> to the
<a href=#port-message-queue>port message queue</a> of <var title="">target port</var>. If the <var title="">new port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>
specifies a <a href=#responsible-event-loop>responsible event loop</a> that is a <a href=#browsing-context>browsing context</a> <a href=#event-loop>event loop</a>, the <a href=#concept-task title=concept-task>task</a> must be associated with the <a href=#responsible-document>responsible document</a>
specified by <var title="">source port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>.</li>
CLEANUP
<li><p>Create a <span title="concept-task">task</span> that <span title="fire a simple
event">fires a simple event</span> named <code title="event-error">error</code> at <var
title="">target port</var>, and add the <span title="concept-task">task</span> to the
<span>port message queue</span> of <var title="">target port</var>. If the <var title="">new port</var>'s <span title="concept-port-owner">owner</span>
specifies a <span>responsible event loop</span> that is a <span>browsing context</span> <span>event loop</span>, the <span
title="concept-task">task</span> must be associated with the <span>responsible document</span>
specified by <var title="">source port</var>'s <span
title="concept-port-owner">owner</span>.</p></li>

<li><p>Disentangle the two ports.</li>
<li><p>Disentangle the two ports.</p></li>

</ol><p class=note>This does not happen if the port is garbage collected or closed using the <code title=dom-messageport-close><a href=#dom-messageport-close>close()</a></code> method. It is intended only as a way for Web
</ol>

<p class="note">This does not happen if the port is garbage collected or closed using the <code
title="dom-messageport-close">close()</code> method. It is intended only as a way for Web
applications that operate across multiple browser processes (e.g. using workers or communicating
across multiple tabs) to gracefully handle a catastrophic failure in one process. A strictly
conforming user agent would never fail unexpectedly, and thus would never send this event!</p>
-->

<hr><p>The following are the <a href=#event-handlers>event handlers</a> (and their corresponding <a href=#event-handler-event-type title="event
handler event type">event handler event types</a>) that must be supported, as <a href=#event-handler-idl-attributes>event
Expand All @@ -81737,8 +81753,8 @@ <h4 id=message-ports><span class=secno>9.5.3 </span>Message ports</h4>

<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-messageport-onmessage title=handler-MessagePort-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code>
<tr><td><dfn id=handler-messageport-onerror title=handler-MessagePort-onerror><code>onerror</code></dfn> <td> <code title=event-error><a href=#event-error>error</a></code>
</table><p>The first time a <code><a href=#messageport>MessagePort</a></code> object's <code title=handler-MessagePort-onmessage><a href=#handler-messageport-onmessage>onmessage</a></code> IDL attribute is set, the port's <a href=#port-message-queue>port
<!--ILLFATED <tr><td><dfn title="handler-MessagePort-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>
--> </table><p>The first time a <code><a href=#messageport>MessagePort</a></code> object's <code title=handler-MessagePort-onmessage><a href=#handler-messageport-onmessage>onmessage</a></code> IDL attribute is set, the port's <a href=#port-message-queue>port
message queue</a> must be enabled, as if the <code title=dom-MessagePort-start><a href=#dom-messageport-start>start()</a></code>
method had been called.</p>

Expand Down
76 changes: 46 additions & 30 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -81343,8 +81343,8 @@ interface <dfn id=messageport>MessagePort</dfn> : <a href=#eventtarget>EventTarg

// event handlers
attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-messageport-onmessage title=handler-MessagePort-onmessage>onmessage</a>;
attribute <a href=#eventhandler>EventHandler</a> <a href=#handler-messageport-onerror title=handler-MessagePort-onerror>onerror</a>;
};
<!--ILLFATED attribute <span>EventHandler</span> <span title="handler-MessagePort-onerror">onerror</span>;
-->};
// <a href=#messageport>MessagePort</a> implements <a href=#transferable>Transferable</a>;</pre>

<dl class=domintro><dt><var title="">port</var> . <code title=dom-MessagePort-postMessage><a href=#dom-messageport-postmessage>postMessage</a></code>(<var title="">message</var> [, <var title="">transfer</var>] )</dt>
Expand Down Expand Up @@ -81470,14 +81470,16 @@ interface <dfn id=messageport>MessagePort</dfn> : <a href=#eventtarget>EventTarg
specifies a <a href=#responsible-event-loop>responsible event loop</a> that is a <a href=#browsing-context>browsing context</a> <a href=#event-loop>event loop</a>, associating the moved <a href=#concept-task title=concept-task>tasks</a> with the <a href=#responsible-document>responsible document</a> specified by <var title="">new port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>.</li>

<!--CLEANUP-->
<li><p>If <var title="">original port</var> is <a href=#related-to-an-ill-fated-port>related to an ill-fated port</a>, then
create a <a href=#concept-task title=concept-task>task</a> that <a href=#fire-a-simple-event title="fire a simple event">fires a
simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at the <var title="">new
port</var>, and add the <a href=#concept-task title=concept-task>task</a> to the <a href=#port-message-queue>port message
queue</a> of <var title="">new port</var>. If the <var title="">new port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>
specifies a <a href=#responsible-event-loop>responsible event loop</a> that is a <a href=#browsing-context>browsing context</a> <a href=#event-loop>event loop</a>, the <a href=#concept-task title=concept-task>task</a> must
be associated with the <a href=#responsible-document>responsible document</a> specified by <var title="">new
port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>.</li>
<!--ILLFATED
<li><p>If <var title="">original port</var> is <span>related to an ill-fated port</span>, then
create a <span title="concept-task">task</span> that <span title="fire a simple event">fires a
simple event</span> named <code title="event-error">error</code> at the <var title="">new
port</var>, and add the <span title="concept-task">task</span> to the <span>port message
queue</span> of <var title="">new port</var>. If the <var title="">new port</var>'s <span title="concept-port-owner">owner</span>
specifies a <span>responsible event loop</span> that is a <span>browsing context</span> <span>event loop</span>, the <span title="concept-task">task</span> must
be associated with the <span>responsible document</span> specified by <var title="">new
port</var>'s <span title="concept-port-owner">owner</span>.</p></li>
-->

<li>

Expand Down Expand Up @@ -81697,38 +81699,52 @@ interface <dfn id=messageport>MessagePort</dfn> : <a href=#eventtarget>EventTarg
disentangle the two ports. If the method is called on a port that is not entangled, then the
method must do nothing.</p>

<hr><p>In some circumstances, an entangled <code><a href=#messageport>MessagePort</a></code> <var title="">source port</var>
that is not <a href=#ports-and-garbage-collection>eligible for garbage collection</a> will
<!--ILLFATED (search for '- -')
<hr>

<p>In some circumstances, an entangled <code>MessagePort</code> <var title="">source port</var>
that is not <a href="#ports-and-garbage-collection">eligible for garbage collection</a> will
nonetheless find itself prematurely destroyed, for example if the user manually terminates the
user agent's host process. Under such circumstances, user agents should attempt to following these
steps:</p>

<!-- don't fire this for navigation, it would break bfcache -->
<!-- for consistency, we don't fire this for worker termination -->
<!-- we don't fire it on .close() because that would let you probe GC behaviour also -->
<!- - don't fire this for navigation, it would break bfcache - ->
<!- - for consistency, we don't fire this for worker termination - ->
<!- - we don't fire it on .close() because that would let you probe GC behaviour also - ->

<ol>

<ol><li><p>Let <var title="">target port</var> be the port with which the ill-fated <var title="">source port</var> is entangled.</li>
<li><p>Let <var title="">target port</var> be the port with which the ill-fated <var
title="">source port</var> is entangled.</p></li>

<li><p>If there is no <var title="">target port</var> (i.e. if <var title="">source port</var>
is not entangled), or if <var title="">target port</var> is suffering the same fate as <var title="">source port</var> (e.g. if both ports are in the same host process), then abort these
steps.</li>
is not entangled), or if <var title="">target port</var> is suffering the same fate as <var
title="">source port</var> (e.g. if both ports are in the same host process), then abort these
steps.</p></li>

<li><p>Mark <var title="">target port</var> as being a <dfn id=related-to-an-ill-fated-port>related to an ill-fated
port</dfn>.</li>
<li><p>Mark <var title="">target port</var> as being a <dfn>related to an ill-fated
port</dfn>.</p></li>

<!--CLEANUP-->
<li><p>Create a <a href=#concept-task title=concept-task>task</a> that <a href=#fire-a-simple-event title="fire a simple
event">fires a simple event</a> named <code title=event-error><a href=#event-error>error</a></code> at <var title="">target port</var>, and add the <a href=#concept-task title=concept-task>task</a> to the
<a href=#port-message-queue>port message queue</a> of <var title="">target port</var>. If the <var title="">new port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>
specifies a <a href=#responsible-event-loop>responsible event loop</a> that is a <a href=#browsing-context>browsing context</a> <a href=#event-loop>event loop</a>, the <a href=#concept-task title=concept-task>task</a> must be associated with the <a href=#responsible-document>responsible document</a>
specified by <var title="">source port</var>'s <a href=#concept-port-owner title=concept-port-owner>owner</a>.</li>
CLEANUP
<li><p>Create a <span title="concept-task">task</span> that <span title="fire a simple
event">fires a simple event</span> named <code title="event-error">error</code> at <var
title="">target port</var>, and add the <span title="concept-task">task</span> to the
<span>port message queue</span> of <var title="">target port</var>. If the <var title="">new port</var>'s <span title="concept-port-owner">owner</span>
specifies a <span>responsible event loop</span> that is a <span>browsing context</span> <span>event loop</span>, the <span
title="concept-task">task</span> must be associated with the <span>responsible document</span>
specified by <var title="">source port</var>'s <span
title="concept-port-owner">owner</span>.</p></li>

<li><p>Disentangle the two ports.</li>
<li><p>Disentangle the two ports.</p></li>

</ol><p class=note>This does not happen if the port is garbage collected or closed using the <code title=dom-messageport-close><a href=#dom-messageport-close>close()</a></code> method. It is intended only as a way for Web
</ol>

<p class="note">This does not happen if the port is garbage collected or closed using the <code
title="dom-messageport-close">close()</code> method. It is intended only as a way for Web
applications that operate across multiple browser processes (e.g. using workers or communicating
across multiple tabs) to gracefully handle a catastrophic failure in one process. A strictly
conforming user agent would never fail unexpectedly, and thus would never send this event!</p>
-->

<hr><p>The following are the <a href=#event-handlers>event handlers</a> (and their corresponding <a href=#event-handler-event-type title="event
handler event type">event handler event types</a>) that must be supported, as <a href=#event-handler-idl-attributes>event
Expand All @@ -81737,8 +81753,8 @@ interface <dfn id=messageport>MessagePort</dfn> : <a href=#eventtarget>EventTarg

<table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
<tbody><tr><td><dfn id=handler-messageport-onmessage title=handler-MessagePort-onmessage><code>onmessage</code></dfn> <td> <code title=event-message><a href=#event-message>message</a></code>
<tr><td><dfn id=handler-messageport-onerror title=handler-MessagePort-onerror><code>onerror</code></dfn> <td> <code title=event-error><a href=#event-error>error</a></code>
</table><p>The first time a <code><a href=#messageport>MessagePort</a></code> object's <code title=handler-MessagePort-onmessage><a href=#handler-messageport-onmessage>onmessage</a></code> IDL attribute is set, the port's <a href=#port-message-queue>port
<!--ILLFATED <tr><td><dfn title="handler-MessagePort-onerror"><code>onerror</code></dfn> <td> <code title="event-error">error</code>
--> </table><p>The first time a <code><a href=#messageport>MessagePort</a></code> object's <code title=handler-MessagePort-onmessage><a href=#handler-messageport-onmessage>onmessage</a></code> IDL attribute is set, the port's <a href=#port-message-queue>port
message queue</a> must be enabled, as if the <code title=dom-MessagePort-start><a href=#dom-messageport-start>start()</a></code>
method had been called.</p>

Expand Down
Loading

0 comments on commit abe9b4a

Please sign in to comment.