Skip to content

Commit

Permalink
[giow] (1) Make WebSocket's garbage collection behaviour a little les…
Browse files Browse the repository at this point in the history
…s detectable and more intuitive.

git-svn-id: http://svn.whatwg.org/webapps@5184 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jul 22, 2010
1 parent f7ead56 commit 40e5444
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
20 changes: 17 additions & 3 deletions complete.html
Expand Up @@ -72174,9 +72174,23 @@ <h5 id=event-definitions-1><span class=secno>10.3.3.1 </span>Event definitions</

<h5 id=garbage-collection-1><span class=secno>10.3.3.2 </span>Garbage collection</h5>

<p>A <code><a href=#websocket>WebSocket</a></code> object with an open connection must not
be garbage collected if there are any event listeners registered for
<code title=event-message><a href=#event-message>message</a></code> events.</p>
<p>A <code><a href=#websocket>WebSocket</a></code> object whose <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
was set to <code title=dom-WebSocket-CONNECTING><a href=#dom-websocket-connecting>CONNECTING</a></code>
(0) as of the last time the <a href=#event-loop>event loop</a> started
executing a <a href=#concept-task title=concept-task>task</a> must not be
garbage collected if there are any event listeners registered for
<code title=event-open>open</code> events, <code title=event-message><a href=#event-message>message</a></code> events, <code title=event-error>error</code> events, or <code title=event-close>close</code> events.</p>

<p>A <code><a href=#websocket>WebSocket</a></code> object whose <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
was set to <code title=dom-WebSocket-OPEN><a href=#dom-websocket-open>OPEN</a></code> (1) as of
the last time the <a href=#event-loop>event loop</a> started executing a <a href=#concept-task title=concept-task>task</a> must not be garbage collected if
there are any event listeners registered for <code title=event-message><a href=#event-message>message</a></code> events, <code title=event-error>error</code> events, or <code title=event-close>close</code> events.</p>

<p>A <code><a href=#websocket>WebSocket</a></code> object whose <code title=dom-WebSocket-readyState><a href=#dom-websocket-readystate>readyState</a></code> attribute's value
was set to <code title=dom-WebSocket-CLOSING><a href=#dom-websocket-closing>CLOSING</a></code> (2) as
of the last time the <a href=#event-loop>event loop</a> started executing a
<a href=#concept-task title=concept-task>task</a> must not be garbage collected
if there are any event listeners registered for <code title=event-close>close</code> events.</p>

<p>If a <code><a href=#websocket>WebSocket</a></code> object is garbage collected while its
connection is still open, the user agent must <a href=#close-the-websocket-connection>close the
Expand Down
31 changes: 28 additions & 3 deletions source
Expand Up @@ -81215,9 +81215,34 @@ socket.onopen = function () {

<h5>Garbage collection</h5>

<p>A <code>WebSocket</code> object with an open connection must not
be garbage collected if there are any event listeners registered for
<code title="event-message">message</code> events.</p>
<p>A <code>WebSocket</code> object whose <code
title="dom-WebSocket-readyState">readyState</code> attribute's value
was set to <code title="dom-WebSocket-CONNECTING">CONNECTING</code>
(0) as of the last time the <span>event loop</span> started
executing a <span title="concept-task">task</span> must not be
garbage collected if there are any event listeners registered for
<code title="event-open">open</code> events, <code
title="event-message">message</code> events, <code
title="event-error">error</code> events, or <code
title="event-close">close</code> events.</p>

<p>A <code>WebSocket</code> object whose <code
title="dom-WebSocket-readyState">readyState</code> attribute's value
was set to <code title="dom-WebSocket-OPEN">OPEN</code> (1) as of
the last time the <span>event loop</span> started executing a <span
title="concept-task">task</span> must not be garbage collected if
there are any event listeners registered for <code
title="event-message">message</code> events, <code
title="event-error">error</code> events, or <code
title="event-close">close</code> events.</p>

<p>A <code>WebSocket</code> object whose <code
title="dom-WebSocket-readyState">readyState</code> attribute's value
was set to <code title="dom-WebSocket-CLOSING">CLOSING</code> (2) as
of the last time the <span>event loop</span> started executing a
<span title="concept-task">task</span> must not be garbage collected
if there are any event listeners registered for <code
title="event-close">close</code> events.</p>

<p>If a <code>WebSocket</code> object is garbage collected while its
connection is still open, the user agent must <span>close the
Expand Down

0 comments on commit 40e5444

Please sign in to comment.