Skip to content

Commit

Permalink
[e] (0) Comment out an example that uses startConversation(), which i…
Browse files Browse the repository at this point in the history
…sn't yet in the spec (it's commented out also).

git-svn-id: http://svn.whatwg.org/webapps@5838 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Feb 7, 2011
1 parent 015cfb5 commit 600575d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 28 deletions.
61 changes: 34 additions & 27 deletions complete.html
Expand Up @@ -1023,8 +1023,7 @@ <h2 class="no-num no-toc" id=contents>Table of contents</h2>
<li><a href=#worker-used-for-background-i/o><span class=secno>9.1.2.3 </span>Worker used for background I/O</a></li>
<li><a href=#shared-workers-introduction><span class=secno>9.1.2.4 </span>Shared workers introduction</a></li>
<li><a href=#shared-state-using-a-shared-worker><span class=secno>9.1.2.5 </span>Shared state using a shared worker</a></li>
<li><a href=#delegation><span class=secno>9.1.2.6 </span>Delegation</a></li>
<li><a href=#providing-libraries><span class=secno>9.1.2.7 </span>Providing libraries</a></ol></ol></li>
<li><a href=#delegation><span class=secno>9.1.2.6 </span>Delegation</a></ol></ol></li>
<li><a href=#infrastructure-0><span class=secno>9.2 </span>Infrastructure</a>
<ol>
<li><a href=#the-global-scope><span class=secno>9.2.1 </span>The global scope</a>
Expand Down Expand Up @@ -71757,15 +71756,18 @@ <h5 id=delegation><span class=secno>9.1.2.6 </span>Delegation</h5>

<p><a href=http://www.whatwg.org/demos/workers/multicore/page.html>View this example online</a>.</p>

<!--(this uses startConversation, which is currently commented out)

<h5 id=providing-libraries><span class=secno>9.1.2.7 </span>Providing libraries</h5>
<h5>Providing libraries</h5>

<p><i>This section is non-normative.</i></p>
<!- -END dev-html- -><p><i>This section is non-normative.</i></p><!- -START dev-html- ->

<p>Suppose that a cryptography library is made available that
provides three tasks:</p>

<dl><dt>Generate a public/private key pair</dt>
<dl>

<dt>Generate a public/private key pair</dt>

<dd>Takes a port, on which it will send two messages, first the
public key and then the private key.</dd>
Expand All @@ -71786,7 +71788,9 @@ <h5 id=providing-libraries><span class=secno>9.1.2.7 </span>Providing libraries<
channel as the plaintext. The user can close the port when it is
done decrypting content.</dd>

</dl><p>The library itself is as follows:</p>
</dl>

<p>The library itself is as follows:</p>

<pre>function handleMessage(e) {
if (e.data == "genkeys")
Expand Down Expand Up @@ -71853,12 +71857,12 @@ <h5 id=providing-libraries><span class=secno>9.1.2.7 </span>Providing libraries<

<p>This library could be used as follows:</p>

<pre>&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Worker example: Crypto library&lt;/title&gt;
&lt;script&gt;
var crytoLib = new Worker('libcrypto-v1.js'); // or could use 'libcrypto-v2.js'
<pre>&lt;!DOCTYPE HTML>
&lt;html>
&lt;head>
&lt;title>Worker example: Crypto library&lt;/title>
&lt;script>
var cryptoLib = new Worker('libcrypto-v1.js'); // or could use 'libcrypto-v2.js'
function getKeys() {
var state = 0;
cryptoLib.startConversation("genkeys").onmessage = function (e) {
Expand Down Expand Up @@ -71887,21 +71891,21 @@ <h5 id=providing-libraries><span class=secno>9.1.2.7 </span>Providing libraries<
port.close();
};
}
&lt;/script&gt;
&lt;style&gt;
&lt;/script>
&lt;style>
textarea { display: block; }
&lt;/style&gt;
&lt;/head&gt;
&lt;body onload="getKeys()"&gt;
&lt;fieldset&gt;
&lt;legend&gt;Keys&lt;/legend&gt;
&lt;p&gt;&lt;label&gt;Public Key: &lt;textarea id="public"&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;label&gt;Private Key: &lt;textarea id="private"&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
&lt;/fieldset&gt;
&lt;p&gt;&lt;label&gt;Input: &lt;textarea id="input"&gt;&lt;/textarea&gt;&lt;/label&gt;&lt;/p&gt;
&lt;p&gt;&lt;button onclick="enc()"&gt;Encrypt&lt;/button&gt; &lt;button onclick="dec()"&gt;Decrypt&lt;/button&gt;&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
&lt;/style>
&lt;/head>
&lt;body onload="getKeys()">
&lt;fieldset>
&lt;legend>Keys&lt;/legend>
&lt;p>&lt;label>Public Key: &lt;textarea id="public">&lt;/textarea>&lt;/label>&lt;/p>
&lt;p>&lt;label>Private Key: &lt;textarea id="private">&lt;/textarea>&lt;/label>&lt;/p>
&lt;/fieldset>
&lt;p>&lt;label>Input: &lt;textarea id="input">&lt;/textarea>&lt;/label>&lt;/p>
&lt;p>&lt;button onclick="enc()">Encrypt&lt;/button> &lt;button onclick="dec()">Decrypt&lt;/button>&lt;/p>
&lt;/body>
&lt;/html></pre>

<p>A later version of the API, though, might want to offload all the
crypto work onto subworkers. This could be done as follows:</p>
Expand Down Expand Up @@ -71991,7 +71995,10 @@ <h5 id=providing-libraries><span class=secno>9.1.2.7 </span>Providing libraries<
delegate to subworkers without changing its API, even though it is
accepting data using message channels.</p>

<p><a href=http://www.whatwg.org/demos/workers/crypto/page.html>View this example online</a>.</p>
<p><a href="http://www.whatwg.org/demos/workers/crypto/page.html">View this example online</a>.</p>

(end startConversation block) (beware nested comments)-->



<h3 id=infrastructure-0><span class=secno>9.2 </span>Infrastructure</h3>
Expand Down
6 changes: 5 additions & 1 deletion source
Expand Up @@ -81287,10 +81287,11 @@ v2 (well, really v0):

<p><a href="http://www.whatwg.org/demos/workers/multicore/page.html">View this example online</a>.</p>

<!--(this uses startConversation, which is currently commented out)

<h5>Providing libraries</h5>

<!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->
<!- -END dev-html- -><p><i>This section is non-normative.</i></p><!- -START dev-html- ->

<p>Suppose that a cryptography library is made available that
provides three tasks:</p>
Expand Down Expand Up @@ -81357,6 +81358,9 @@ v2 (well, really v0):

<p><a href="http://www.whatwg.org/demos/workers/crypto/page.html">View this example online</a>.</p>

(end startConversation block) (beware nested comments)-->


<!--END complete--><!--END epub-->
<!--FIXUP whatwg-workers +1-->
<!--FIXUP workers +1-->
Expand Down

0 comments on commit 600575d

Please sign in to comment.