[html5] r6952 - [e] (0) Drop obsolete example that uses WebSQL. If anyone wants to write an Inde [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Jan 31 12:41:38 PST 2012


Author: ianh
Date: 2012-01-31 12:41:37 -0800 (Tue, 31 Jan 2012)
New Revision: 6952

Modified:
   complete.html
   index
   source
Log:
[e] (0) Drop obsolete example that uses WebSQL. If anyone wants to write an IndexDB replacement for this example, mail it in!
Affected topics: HTML, Web Workers

Modified: complete.html
===================================================================
--- complete.html	2012-01-31 20:26:07 UTC (rev 6951)
+++ complete.html	2012-01-31 20:41:37 UTC (rev 6952)
@@ -992,11 +992,10 @@
      <li><a href=#examples-4><span class=secno>9.1.2 </span>Examples</a>
       <ol>
        <li><a href=#a-background-number-crunching-worker><span class=secno>9.1.2.1 </span>A background number-crunching worker</a></li>
-       <li><a href=#a-worker-for-updating-a-client-side-database><span class=secno>9.1.2.2 </span>A worker for updating a client-side database</a></li>
-       <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></ol></li>
+       <li><a href=#worker-used-for-background-i/o><span class=secno>9.1.2.2 </span>Worker used for background I/O</a></li>
+       <li><a href=#shared-workers-introduction><span class=secno>9.1.2.3 </span>Shared workers introduction</a></li>
+       <li><a href=#shared-state-using-a-shared-worker><span class=secno>9.1.2.4 </span>Shared state using a shared worker</a></li>
+       <li><a href=#delegation><span class=secno>9.1.2.5 </span>Delegation</a></ol></li>
      <li><a href=#tutorials><span class=secno>9.1.3 </span>Tutorials</a>
       <ol>
        <li><a href=#creating-a-dedicated-worker><span class=secno>9.1.3.1 </span>Creating a dedicated worker</a></li>
@@ -74272,56 +74271,9 @@
 
 
 
-  <h5 id=a-worker-for-updating-a-client-side-database><span class=secno>9.1.2.2 </span>A worker for updating a client-side database</h5>
 
-  <p><i>This section is non-normative.</i></p>
+  <h5 id=worker-used-for-background-i/o><span class=secno>9.1.2.2 </span>Worker used for background I/O</h5>
 
-  <p>In this example, the main document spawns a worker whose only
-  task is to listen for notifications from the server, and, when
-  appropriate, either add or remove data from the client-side
-  database.</p>
-
-  <p>Since no communication occurs between the worker and the main
-  page, the main page can start the worker by just doing:</p>
-
-  <pre><script>
- new Worker('worker.js');
-</script></pre>
-
-  <p>The worker itself is as follows:</p>
-
-  <pre>var server = new WebSocket('ws://whatwg.org/database');
-var database = openDatabase('demobase', '1.0', 'Demo Database', 10240);
-server.onmessage = function (event) {
-  // data is in the format "command key value"
-  var data = event.data.split(' ');
-  switch (data[0]) {
-    case '+':
-     database.transaction(function(tx) {
-       tx.executeSql('INSERT INTO pairs (key, value) VALUES (?, ?)', data[1], data[2]);
-     });
-    case '-':
-     database.transaction(function(tx) {
-       tx.executeSql('DELETE FROM pairs WHERE key=? AND value=?', data[1], data[2]);
-     });
-  }
-};</pre>
-
-  <p>This connects to the server using the <code><a href=#websocket>WebSocket</a></code>
-  mechanism and opens the local database (which, we presume, has been
-  created earlier). The worker then just listens for messages from the
-  server and acts on them as appropriate, forever (or until the main
-  page is closed).</p>
-
-  <p><a href=http://www.whatwg.org/demos/workers/database-updater/page.html>View
-  this example online</a>. (This example will not actually function,
-  since the server does not actually exist and the database is not
-  created by this sample code.)</p>
-
-
-
-  <h5 id=worker-used-for-background-i/o><span class=secno>9.1.2.3 </span>Worker used for background I/O</h5>
-
   <p><i>This section is non-normative.</i></p>
 
   <p>In this example, the main document uses two workers, one for
@@ -74427,7 +74379,7 @@
   <p><a href=http://www.whatwg.org/demos/workers/stocks/page.html>View this example online</a>.</p>
 
 
-  <h5 id=shared-workers-introduction><span class=secno>9.1.2.4 </span>Shared workers introduction</h5>
+  <h5 id=shared-workers-introduction><span class=secno>9.1.2.3 </span>Shared workers introduction</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -74553,7 +74505,7 @@
   <p><a href=http://www.whatwg.org/demos/workers/shared/003/test.html>View this example online</a>.</p>
 
 
-  <h5 id=shared-state-using-a-shared-worker><span class=secno>9.1.2.5 </span>Shared state using a shared worker</h5>
+  <h5 id=shared-state-using-a-shared-worker><span class=secno>9.1.2.4 </span>Shared state using a shared worker</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -74837,7 +74789,7 @@
   <p><a href=http://www.whatwg.org/demos/workers/multiviewer/page.html>View this example online</a>.</p>
 
 
-  <h5 id=delegation><span class=secno>9.1.2.6 </span>Delegation</h5>
+  <h5 id=delegation><span class=secno>9.1.2.5 </span>Delegation</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -98228,6 +98180,7 @@
   Ian Clelland,
   Ian Davis,
   Ian Fette,
+  Ido Green,
   Ignacio Javier,
   Ivan Enderlin,
   Ivo Emanuel Gonçalves,

Modified: index
===================================================================
--- index	2012-01-31 20:26:07 UTC (rev 6951)
+++ index	2012-01-31 20:41:37 UTC (rev 6952)
@@ -992,11 +992,10 @@
      <li><a href=#examples-4><span class=secno>9.1.2 </span>Examples</a>
       <ol>
        <li><a href=#a-background-number-crunching-worker><span class=secno>9.1.2.1 </span>A background number-crunching worker</a></li>
-       <li><a href=#a-worker-for-updating-a-client-side-database><span class=secno>9.1.2.2 </span>A worker for updating a client-side database</a></li>
-       <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></ol></li>
+       <li><a href=#worker-used-for-background-i/o><span class=secno>9.1.2.2 </span>Worker used for background I/O</a></li>
+       <li><a href=#shared-workers-introduction><span class=secno>9.1.2.3 </span>Shared workers introduction</a></li>
+       <li><a href=#shared-state-using-a-shared-worker><span class=secno>9.1.2.4 </span>Shared state using a shared worker</a></li>
+       <li><a href=#delegation><span class=secno>9.1.2.5 </span>Delegation</a></ol></li>
      <li><a href=#tutorials><span class=secno>9.1.3 </span>Tutorials</a>
       <ol>
        <li><a href=#creating-a-dedicated-worker><span class=secno>9.1.3.1 </span>Creating a dedicated worker</a></li>
@@ -74272,56 +74271,9 @@
 
 
 
-  <h5 id=a-worker-for-updating-a-client-side-database><span class=secno>9.1.2.2 </span>A worker for updating a client-side database</h5>
 
-  <p><i>This section is non-normative.</i></p>
+  <h5 id=worker-used-for-background-i/o><span class=secno>9.1.2.2 </span>Worker used for background I/O</h5>
 
-  <p>In this example, the main document spawns a worker whose only
-  task is to listen for notifications from the server, and, when
-  appropriate, either add or remove data from the client-side
-  database.</p>
-
-  <p>Since no communication occurs between the worker and the main
-  page, the main page can start the worker by just doing:</p>
-
-  <pre><script>
- new Worker('worker.js');
-</script></pre>
-
-  <p>The worker itself is as follows:</p>
-
-  <pre>var server = new WebSocket('ws://whatwg.org/database');
-var database = openDatabase('demobase', '1.0', 'Demo Database', 10240);
-server.onmessage = function (event) {
-  // data is in the format "command key value"
-  var data = event.data.split(' ');
-  switch (data[0]) {
-    case '+':
-     database.transaction(function(tx) {
-       tx.executeSql('INSERT INTO pairs (key, value) VALUES (?, ?)', data[1], data[2]);
-     });
-    case '-':
-     database.transaction(function(tx) {
-       tx.executeSql('DELETE FROM pairs WHERE key=? AND value=?', data[1], data[2]);
-     });
-  }
-};</pre>
-
-  <p>This connects to the server using the <code><a href=#websocket>WebSocket</a></code>
-  mechanism and opens the local database (which, we presume, has been
-  created earlier). The worker then just listens for messages from the
-  server and acts on them as appropriate, forever (or until the main
-  page is closed).</p>
-
-  <p><a href=http://www.whatwg.org/demos/workers/database-updater/page.html>View
-  this example online</a>. (This example will not actually function,
-  since the server does not actually exist and the database is not
-  created by this sample code.)</p>
-
-
-
-  <h5 id=worker-used-for-background-i/o><span class=secno>9.1.2.3 </span>Worker used for background I/O</h5>
-
   <p><i>This section is non-normative.</i></p>
 
   <p>In this example, the main document uses two workers, one for
@@ -74427,7 +74379,7 @@
   <p><a href=http://www.whatwg.org/demos/workers/stocks/page.html>View this example online</a>.</p>
 
 
-  <h5 id=shared-workers-introduction><span class=secno>9.1.2.4 </span>Shared workers introduction</h5>
+  <h5 id=shared-workers-introduction><span class=secno>9.1.2.3 </span>Shared workers introduction</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -74553,7 +74505,7 @@
   <p><a href=http://www.whatwg.org/demos/workers/shared/003/test.html>View this example online</a>.</p>
 
 
-  <h5 id=shared-state-using-a-shared-worker><span class=secno>9.1.2.5 </span>Shared state using a shared worker</h5>
+  <h5 id=shared-state-using-a-shared-worker><span class=secno>9.1.2.4 </span>Shared state using a shared worker</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -74837,7 +74789,7 @@
   <p><a href=http://www.whatwg.org/demos/workers/multiviewer/page.html>View this example online</a>.</p>
 
 
-  <h5 id=delegation><span class=secno>9.1.2.6 </span>Delegation</h5>
+  <h5 id=delegation><span class=secno>9.1.2.5 </span>Delegation</h5>
 
   <p><i>This section is non-normative.</i></p>
 
@@ -98228,6 +98180,7 @@
   Ian Clelland,
   Ian Davis,
   Ian Fette,
+  Ido Green,
   Ignacio Javier,
   Ivan Enderlin,
   Ivo Emanuel Gonçalves,

Modified: source
===================================================================
--- source	2012-01-31 20:26:07 UTC (rev 6951)
+++ source	2012-01-31 20:41:37 UTC (rev 6952)
@@ -86814,40 +86814,7 @@
 
 
 
-  <h5>A worker for updating a client-side database</h5>
 
-  <!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->
-
-  <p>In this example, the main document spawns a worker whose only
-  task is to listen for notifications from the server, and, when
-  appropriate, either add or remove data from the client-side
-  database.</p>
-
-  <p>Since no communication occurs between the worker and the main
-  page, the main page can start the worker by just doing:</p>
-
-  <pre><script>
- new Worker('worker.js');
-</script></pre>
-
-  <p>The worker itself is as follows:</p>
-
-  <pre>EXAMPLE workers/database-updater/worker.js</pre>
-
-  <p>This connects to the server using the <code>WebSocket</code>
-  mechanism and opens the local database (which, we presume, has been
-  created earlier). The worker then just listens for messages from the
-  server and acts on them as appropriate, forever (or until the main
-  page is closed).</p>
-
-  <p><a
-  href="http://www.whatwg.org/demos/workers/database-updater/page.html">View
-  this example online</a>. (This example will not actually function,
-  since the server does not actually exist and the database is not
-  created by this sample code.)</p>
-
-
-
   <h5>Worker used for background I/O</h5>
 
   <!--END dev-html--><p><i>This section is non-normative.</i></p><!--START dev-html-->
@@ -115085,6 +115052,7 @@
   Ian Clelland,
   Ian Davis,
   Ian Fette,
+  Ido Green,
   Ignacio Javier,
   Ivan Enderlin,
   Ivo Emanuel Gonçalves,




More information about the Commit-Watchers mailing list