<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191826] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191826">191826</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-10-30 16:20:02 -0700 (Fri, 30 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modern IDB: IDBObjectStore.clear() support.
https://bugs.webkit.org/show_bug.cgi?id=150733

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/idbobjectstore-clear-1.html
       storage/indexeddb/modern/idbobjectstore-clear-2.html

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::didClearObjectStore):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::clear):

* Modules/indexeddb/client/IDBRequestImpl.cpp:
(WebCore::IDBClient::IDBRequest::setResultToUndefined):
* Modules/indexeddb/client/IDBRequestImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::requestClearObjectStore):
(WebCore::IDBClient::IDBTransaction::clearObjectStoreOnServer):
(WebCore::IDBClient::IDBTransaction::didClearObjectStoreOnServer):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::clearObjectStore):
* Modules/indexeddb/server/IDBServer.h:

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
(WebCore::IDBServer::MemoryBackingStoreTransaction::recordValueChanged):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
(WebCore::IDBServer::MemoryBackingStoreTransaction::isAborting):

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::clear):
(WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
* Modules/indexeddb/server/MemoryObjectStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performClearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformClearObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::clearObjectStoreSuccess):
* Modules/indexeddb/shared/IDBResultData.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didClearObjectStore):
(WebCore::InProcessIDBServer::clearObjectStore):
* Modules/indexeddb/shared/InProcessIDBServer.h:

LayoutTests:

* storage/indexeddb/modern/idbobjectstore-clear-1-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-clear-1.html: Added.
* storage/indexeddb/modern/idbobjectstore-clear-2-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-clear-2.html: Added.
* storage/indexeddb/modern/idbobjectstore-put-and-clear-failures-expected.txt: Added.
* storage/indexeddb/modern/idbobjectstore-put-and-clear-failures.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh">trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh">trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverIDBServerh">trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh">trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh">trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah">trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh">trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear1expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear1html">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear2expectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear2html">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2.html</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoreputandclearfailuresexpectedtxt">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures-expected.txt</a></li>
<li><a href="#trunkLayoutTestsstorageindexeddbmodernidbobjectstoreputandclearfailureshtml">trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/LayoutTests/ChangeLog        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-30  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: IDBObjectStore.clear() support.
+        https://bugs.webkit.org/show_bug.cgi?id=150733
+
+        Reviewed by Alex Christensen.
+
+        * storage/indexeddb/modern/idbobjectstore-clear-1-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-clear-1.html: Added.
+        * storage/indexeddb/modern/idbobjectstore-clear-2-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-clear-2.html: Added.
+        * storage/indexeddb/modern/idbobjectstore-put-and-clear-failures-expected.txt: Added.
+        * storage/indexeddb/modern/idbobjectstore-put-and-clear-failures.html: Added.
+
</ins><span class="cx"> 2015-10-30  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking imported/w3c/web-platform-tests/XMLHttpRequest/send-timeout-events.htm as flaky on win
</span></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1-expected.txt (0 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1-expected.txt        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: Success opening database connection - Starting readwrite transaction
+ALERT: Value gotten was bar1
+ALERT: Value gotten was bar2
+ALERT: Value gotten was bar3
+ALERT: Value gotten was bar4
+ALERT: Value gotten was bar5
+ALERT: Value gotten was bar6
+ALERT: Value gotten was bar7
+ALERT: Value gotten was bar8
+ALERT: Value gotten was bar9
+ALERT: Object store cleared
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Readwrite transaction complete
+ALERT: Done
+This test creates an object store then populates it.
+It then clears it and makes sure it has nothing left in it.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1.html (0 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-1.html        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+This test creates an object store then populates it.&lt;br&gt;
+It then clears it and makes sure it has nothing left in it.&lt;br&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    alert(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open(&quot;IDBObjectStoreClearDatabase&quot;, 1);
+
+createRequest.onupgradeneeded = function(event) {
+    alert(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    var database = event.target.result;
+    var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;, { autoIncrement: true });
+    var request = objectStore.put(&quot;bar1&quot;);
+    var request = objectStore.put(&quot;bar2&quot;);
+    var request = objectStore.put(&quot;bar3&quot;);
+    var request = objectStore.put(&quot;bar4&quot;);
+    var request = objectStore.put(&quot;bar5&quot;);
+    var request = objectStore.put(&quot;bar6&quot;);
+    var request = objectStore.put(&quot;bar7&quot;);
+    var request = objectStore.put(&quot;bar8&quot;);
+    var request = objectStore.put(&quot;bar9&quot;);
+
+    versionTransaction.onabort = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+        database.close();
+    }
+
+    versionTransaction.onerror = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function getChecker(event) {
+    alert(&quot;Value gotten was &quot; + event.target.result);
+}
+
+function continueTest1()
+{
+    var openRequest = window.indexedDB.open(&quot;IDBObjectStoreClearDatabase&quot;, 1);
+
+    openRequest.onerror = function(event) {
+        alert(&quot;Request unexpected error - &quot; + event);
+        done();
+    }
+    openRequest.onblocked = function(event) {
+        alert(&quot;Request unexpected blocked - &quot; + event);
+        done();
+    }
+    openRequest.onupgradeneeded = function(event) {
+        alert(&quot;Request unexpected upgradeneeded - &quot; + event);
+        done();
+    }
+
+    openRequest.onsuccess = function(event) {
+        alert(&quot;Success opening database connection - Starting readwrite transaction&quot;);
+        var database = event.target.result;
+        var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readwrite&quot;);
+        var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+    
+        var request;
+        for (var i = 1; i &lt;= 9; ++i) {
+            request = objectStore.get(i);
+            request.onsuccess = getChecker;
+        }
+        
+        request = objectStore.clear();
+        request.onsuccess = function() {
+            alert(&quot;Object store cleared&quot;);
+            var newRequests;
+            for (var i = 1; i &lt;= 9; ++i) {
+                newRequests = objectStore.get(i);
+                newRequests.onsuccess = getChecker;
+            }    
+        }
+
+        transaction.onabort = function(event) {
+            alert(&quot;Readwrite transaction unexpected abort&quot;);
+            done();
+        }
+
+        transaction.oncomplete = function(event) {
+            alert(&quot;Readwrite transaction complete&quot;);
+            done();
+        }
+
+        transaction.onerror = function(event) {
+            alert(&quot;Readwrite transaction unexpected error - &quot; + event);
+            done();
+        }
+    }
+}
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear2expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2-expected.txt (0 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2-expected.txt        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: Success opening database connection - Starting readwrite transaction
+ALERT: Value gotten was bar1
+ALERT: Value gotten was bar2
+ALERT: Value gotten was bar3
+ALERT: Value gotten was bar4
+ALERT: Value gotten was bar5
+ALERT: Value gotten was bar6
+ALERT: Value gotten was bar7
+ALERT: Value gotten was bar8
+ALERT: Value gotten was bar9
+ALERT: Object store cleared, making sure its all gone.
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Value gotten was undefined
+ALERT: Readwrite transaction abort
+ALERT: Success opening database connection - Starting final transaction
+ALERT: Value gotten was bar1
+ALERT: Value gotten was bar2
+ALERT: Value gotten was bar3
+ALERT: Value gotten was bar4
+ALERT: Value gotten was bar5
+ALERT: Value gotten was bar6
+ALERT: Value gotten was bar7
+ALERT: Value gotten was bar8
+ALERT: Value gotten was bar9
+ALERT: Readwrite transaction complete
+ALERT: Done
+This test creates an object store then populates it, then commits that transaction.
+It then clears it, but aborts that transaction.
+Finally it checks to make sure everything from step 1 is still in there.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoreclear2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2.html (0 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-clear-2.html        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -0,0 +1,167 @@
</span><ins>+This test creates an object store then populates it, then commits that transaction.&lt;br&gt;
+It then clears it, but aborts that transaction.&lt;br&gt;
+Finally it checks to make sure everything from step 1 is still in there.&lt;br&gt;
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    alert(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open(&quot;IDBObjectStoreClear2Database&quot;, 1);
+
+createRequest.onupgradeneeded = function(event) {
+    alert(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    var database = event.target.result;
+    var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;, { autoIncrement: true });
+    var request = objectStore.put(&quot;bar1&quot;);
+    var request = objectStore.put(&quot;bar2&quot;);
+    var request = objectStore.put(&quot;bar3&quot;);
+    var request = objectStore.put(&quot;bar4&quot;);
+    var request = objectStore.put(&quot;bar5&quot;);
+    var request = objectStore.put(&quot;bar6&quot;);
+    var request = objectStore.put(&quot;bar7&quot;);
+    var request = objectStore.put(&quot;bar8&quot;);
+    var request = objectStore.put(&quot;bar9&quot;);
+
+    versionTransaction.onabort = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+        database.close();
+    }
+
+    versionTransaction.onerror = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function getChecker(event) {
+    alert(&quot;Value gotten was &quot; + event.target.result);
+}
+
+function continueTest1()
+{
+    var openRequest = window.indexedDB.open(&quot;IDBObjectStoreClear2Database&quot;, 1);
+
+    openRequest.onerror = function(event) {
+        alert(&quot;Request unexpected error - &quot; + event);
+        done();
+    }
+    openRequest.onblocked = function(event) {
+        alert(&quot;Request unexpected blocked - &quot; + event);
+        done();
+    }
+    openRequest.onupgradeneeded = function(event) {
+        alert(&quot;Request unexpected upgradeneeded - &quot; + event);
+        done();
+    }
+
+    openRequest.onsuccess = function(event) {
+        alert(&quot;Success opening database connection - Starting readwrite transaction&quot;);
+        var database = event.target.result;
+        var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readwrite&quot;);
+        var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+    
+        var request;
+        for (var i = 1; i &lt;= 9; ++i) {
+            request = objectStore.get(i);
+            request.onsuccess = getChecker;
+        }
+        
+        request = objectStore.clear();
+        request.onsuccess = function() {
+            alert(&quot;Object store cleared, making sure its all gone.&quot;);
+            var newRequests;
+            for (var i = 1; i &lt;= 9; ++i) {
+                newRequests = objectStore.get(i);
+                newRequests.onsuccess = getChecker;
+            }
+            
+            // We'll be on the last request here, can just override it.
+            newRequests.onsuccess = function(event) {
+                getChecker(event);
+                transaction.abort();
+            }
+        }
+        
+        // Just for fun clear it twice, won't change anything
+        objectStore.clear();
+
+        transaction.onabort = function(event) {
+            alert(&quot;Readwrite transaction abort&quot;);
+            continueTest2();
+        }
+
+        transaction.oncomplete = function(event) {
+            alert(&quot;Readwrite transaction unexpected complete&quot;);
+            done();
+        }
+
+        transaction.onerror = function(event) {
+            alert(&quot;Readwrite transaction unexpected error - &quot; + event);
+            done();
+        }
+    }
+}
+
+function continueTest2()
+{
+    var openRequest = window.indexedDB.open(&quot;IDBObjectStoreClear2Database&quot;, 1);
+
+    openRequest.onerror = function(event) {
+        alert(&quot;Request unexpected error - &quot; + event);
+        done();
+    }
+    openRequest.onblocked = function(event) {
+        alert(&quot;Request unexpected blocked - &quot; + event);
+        done();
+    }
+    openRequest.onupgradeneeded = function(event) {
+        alert(&quot;Request unexpected upgradeneeded - &quot; + event);
+        done();
+    }
+
+    openRequest.onsuccess = function(event) {
+        alert(&quot;Success opening database connection - Starting final transaction&quot;);
+        var database = event.target.result;
+        var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readwrite&quot;);
+        var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+    
+        var request;
+        for (var i = 1; i &lt;= 9; ++i) {
+            request = objectStore.get(i);
+            request.onsuccess = getChecker;
+        }
+
+        transaction.onabort = function(event) {
+            alert(&quot;Readwrite transaction unexpected abort&quot;);
+            done();
+        }
+
+        transaction.oncomplete = function(event) {
+            alert(&quot;Readwrite transaction complete&quot;);
+            done();
+        }
+
+        transaction.onerror = function(event) {
+            alert(&quot;Readwrite transaction unexpected error - &quot; + event);
+            done();
+        }
+    }
+}
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoreputandclearfailuresexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures-expected.txt (0 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures-expected.txt                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures-expected.txt        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+ALERT: Initial upgrade needed: Old version - 0 New version - 1
+ALERT: Failed to put record into object store with an invalid key
+ALERT: Failed to put record into object store that has been deleted
+ALERT: Failed to clear object store that has been deleted
+ALERT: Initial upgrade versionchange transaction complete
+ALERT: Failed to clear object store in read-only transaction
+ALERT: Failed to put record into object store with inactive transaction
+ALERT: Failed to clear object store with inactive transaction
+ALERT: readwrite transaction complete
+ALERT: Done
+This tests some obvious failures that can happen while calling IDBObjectStore.put() and IDBObjectStore.clear().
</ins></span></pre></div>
<a id="trunkLayoutTestsstorageindexeddbmodernidbobjectstoreputandclearfailureshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures.html (0 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures.html                                (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbobjectstore-put-and-clear-failures.html        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+This tests some obvious failures that can happen while calling IDBObjectStore.put() and IDBObjectStore.clear().
+&lt;script&gt;
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+function done()
+{
+    alert(&quot;Done&quot;);
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+var createRequest = window.indexedDB.open(&quot;IDBObjectStorePutAndClearFailuresDatabase&quot;, 1);
+var database;
+
+createRequest.onupgradeneeded = function(event) {
+    alert(&quot;Initial upgrade needed: Old version - &quot; + event.oldVersion + &quot; New version - &quot; + event.newVersion);
+
+    var versionTransaction = createRequest.transaction;
+    database = event.target.result;
+    var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+    var request = objectStore.put(&quot;bar&quot;, &quot;foo&quot;);
+
+    request.onsuccess = function() {
+        try {
+            objectStore.put(&quot;bar&quot;, NaN);
+        } catch(e) {
+            alert(&quot;Failed to put record into object store with an invalid key&quot;);
+        }
+        
+        database.deleteObjectStore(&quot;TestObjectStore&quot;);
+        
+        try {
+            objectStore.put(&quot;bar&quot;, &quot;foo&quot;);
+        } catch(e) {
+            alert(&quot;Failed to put record into object store that has been deleted&quot;);
+        } 
+
+        try {
+            objectStore.clear();
+        } catch(e) {
+            alert(&quot;Failed to clear object store that has been deleted&quot;);
+        } 
+
+        // Recreate the objectstore because we'll need it in phase 2.
+        var objectStore = database.createObjectStore(&quot;TestObjectStore&quot;);
+        objectStore.put(&quot;bar&quot;, &quot;foo&quot;);    
+    }
+    
+    versionTransaction.onabort = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected aborted&quot;);
+        done();
+    }
+
+    versionTransaction.oncomplete = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction complete&quot;);
+        continueTest1();
+    }
+
+    versionTransaction.onerror = function(event) {
+        alert(&quot;Initial upgrade versionchange transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+function continueTest1()
+{
+    var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readonly&quot;);
+    var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+    
+    try {
+        objectStore.clear();
+    } catch(e) {
+        alert(&quot;Failed to clear object store in read-only transaction&quot;);
+    }
+    
+    var transaction = database.transaction(&quot;TestObjectStore&quot;, &quot;readwrite&quot;);
+    var objectStore = transaction.objectStore(&quot;TestObjectStore&quot;);
+
+    // Queue up a whole bunch of gets to keep the transaction alive for awhile
+    for (var i = 0; i &lt; 10; ++i)
+        objectStore.get(&quot;foo&quot;);
+
+    var testWhileInactive = function() {
+        try {
+            objectStore.put(&quot;bar&quot;, &quot;foo&quot;);
+        } catch(e) {
+            alert(&quot;Failed to put record into object store with inactive transaction&quot;);
+        }
+        
+        try {
+            objectStore.clear();
+        } catch(e) {
+            alert(&quot;Failed to clear object store with inactive transaction&quot;);
+        } 
+    }
+    
+    setTimeout(testWhileInactive, 0);
+    
+    transaction.onabort = function(event) {
+        alert(&quot;readwrite transaction unexpected abort&quot; + event);
+        done();
+    }
+
+    transaction.oncomplete = function(event) {
+        alert(&quot;readwrite transaction complete&quot;);
+        done();
+    }
+
+    transaction.onerror = function(event) {
+        alert(&quot;readwrite transaction unexpected error&quot; + event);
+        done();
+    }
+}
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/ChangeLog        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -1,3 +1,82 @@
</span><ins>+2015-10-30  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Modern IDB: IDBObjectStore.clear() support.
+        https://bugs.webkit.org/show_bug.cgi?id=150733
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/idbobjectstore-clear-1.html
+               storage/indexeddb/modern/idbobjectstore-clear-2.html
+
+        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+        (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
+        (WebCore::IDBClient::IDBConnectionToServer::didClearObjectStore):
+        * Modules/indexeddb/client/IDBConnectionToServer.h:
+        * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+        
+        * Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
+        (WebCore::IDBClient::IDBObjectStore::clear):
+        
+        * Modules/indexeddb/client/IDBRequestImpl.cpp:
+        (WebCore::IDBClient::IDBRequest::setResultToUndefined):
+        * Modules/indexeddb/client/IDBRequestImpl.h:
+        
+        * Modules/indexeddb/client/IDBTransactionImpl.cpp:
+        (WebCore::IDBClient::IDBTransaction::requestClearObjectStore):
+        (WebCore::IDBClient::IDBTransaction::clearObjectStoreOnServer):
+        (WebCore::IDBClient::IDBTransaction::didClearObjectStoreOnServer):
+        * Modules/indexeddb/client/IDBTransactionImpl.h:
+
+        * Modules/indexeddb/server/IDBBackingStore.h:
+
+        * Modules/indexeddb/server/IDBConnectionToClient.cpp:
+        (WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
+        * Modules/indexeddb/server/IDBConnectionToClient.h:
+        * Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
+
+        * Modules/indexeddb/server/IDBServer.cpp:
+        (WebCore::IDBServer::IDBServer::clearObjectStore):
+        * Modules/indexeddb/server/IDBServer.h:
+
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::recordValueChanged):
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
+        * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
+        (WebCore::IDBServer::MemoryBackingStoreTransaction::isAborting):
+
+        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
+        (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
+        * Modules/indexeddb/server/MemoryIDBBackingStore.h:
+
+        * Modules/indexeddb/server/MemoryObjectStore.cpp:
+        (WebCore::IDBServer::MemoryObjectStore::clear):
+        (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
+        * Modules/indexeddb/server/MemoryObjectStore.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
+        (WebCore::IDBServer::UniqueIDBDatabase::performClearObjectStore):
+        (WebCore::IDBServer::UniqueIDBDatabase::didPerformClearObjectStore):
+        * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
+        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
+
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
+        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+        * Modules/indexeddb/shared/IDBResultData.cpp:
+        (WebCore::IDBResultData::clearObjectStoreSuccess):
+        * Modules/indexeddb/shared/IDBResultData.h:
+
+        * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+        (WebCore::InProcessIDBServer::didClearObjectStore):
+        (WebCore::InProcessIDBServer::clearObjectStore):
+        * Modules/indexeddb/shared/InProcessIDBServer.h:
+
</ins><span class="cx"> 2015-10-30  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CSSParserVariable leaks seen on leaks bots
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -124,6 +124,21 @@
</span><span class="cx">     completeOperation(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToServer::clearObjectStore(TransactionOperation&amp; operation, uint64_t objectStoreIdentifier)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::clearObjectStore&quot;);
+
+    saveOperation(operation);
+
+    m_delegate-&gt;clearObjectStore(IDBRequestData(operation), objectStoreIdentifier);
+}
+
+void IDBConnectionToServer::didClearObjectStore(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBConnectionToServer::didClearObjectStore&quot;);
+    completeOperation(resultData);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::putOrAdd(TransactionOperation&amp; operation, RefPtr&lt;IDBKey&gt;&amp; key, RefPtr&lt;SerializedScriptValue&gt;&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBConnectionToServer::putOrAdd&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -67,6 +67,9 @@
</span><span class="cx">     void deleteObjectStore(TransactionOperation&amp;, const String&amp; objectStoreName);
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void clearObjectStore(TransactionOperation&amp;, uint64_t objectStoreIdentifier);
+    void didClearObjectStore(const IDBResultData&amp;);
+
</ins><span class="cx">     void putOrAdd(TransactionOperation&amp;, RefPtr&lt;IDBKey&gt;&amp;, RefPtr&lt;SerializedScriptValue&gt;&amp;, const IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void didPutOrAdd(const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -56,6 +56,7 @@
</span><span class="cx">     virtual void commitTransaction(IDBResourceIdentifier&amp;) = 0;
</span><span class="cx">     virtual void createObjectStore(const IDBRequestData&amp;, const IDBObjectStoreInfo&amp;) = 0;
</span><span class="cx">     virtual void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName) = 0;
</span><ins>+    virtual void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) = 0;
</ins><span class="cx">     virtual void putOrAdd(const IDBRequestData&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) = 0;
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, IDBKey*) = 0;
</span><span class="cx">     virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp;) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBObjectStoreImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -260,9 +260,27 @@
</span><span class="cx">     RELEASE_ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::clear(ScriptExecutionContext*, ExceptionCode&amp;)
</del><ins>+RefPtr&lt;WebCore::IDBRequest&gt; IDBObjectStore::clear(ScriptExecutionContext* context, ExceptionCode&amp; ec)
</ins><span class="cx"> {
</span><del>-    RELEASE_ASSERT_NOT_REACHED();
</del><ins>+    LOG(IndexedDB, &quot;IDBObjectStore::clear&quot;);
+
+    if (m_transaction-&gt;isReadOnly()) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::ReadOnlyError);
+        return nullptr;
+    }
+
+    if (!m_transaction-&gt;isActive()) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::TransactionInactiveError);
+        return nullptr;
+    }
+
+    if (m_deleted) {
+        ec = static_cast&lt;ExceptionCode&gt;(IDBExceptionCode::InvalidStateError);
+        return nullptr;
+    }
+
+    Ref&lt;IDBRequest&gt; request = m_transaction-&gt;requestClearObjectStore(*context, *this);
+    return adoptRef(request.leakRef());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::IDBIndex&gt; IDBObjectStore::createIndex(ScriptExecutionContext*, const String&amp;, const IDBKeyPath&amp;, bool, bool, ExceptionCode&amp;)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;DOMRequestState.h&quot;
</ins><span class="cx"> #include &quot;EventQueue.h&quot;
</span><span class="cx"> #include &quot;IDBBindingUtilities.h&quot;
</span><span class="cx"> #include &quot;IDBEventDispatcher.h&quot;
</span><span class="lines">@@ -191,6 +192,17 @@
</span><span class="cx">     m_result = IDBAny::create(WTF::move(value));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBRequest::setResultToUndefined()
+{
+    auto context = scriptExecutionContext();
+    if (!context)
+        return;
+
+    DOMRequestState state(context);
+    if (auto* execState = state.exec())
+        m_result = IDBAny::create(Deprecated::ScriptValue(execState-&gt;vm(), JSC::jsUndefined()));
+}
+
</ins><span class="cx"> void IDBRequest::requestCompleted(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     m_idbError = resultData.error();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> 
</span><span class="cx">     void setResult(const IDBKeyData*);
</span><span class="cx">     void setResultToStructuredClone(const ThreadSafeDataBuffer&amp;);
</span><ins>+    void setResultToUndefined();
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     IDBRequest(IDBConnectionToServer&amp;, ScriptExecutionContext*);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -414,6 +414,35 @@
</span><span class="cx">     request.requestCompleted(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref&lt;IDBRequest&gt; IDBTransaction::requestClearObjectStore(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::requestClearObjectStore&quot;);
+    ASSERT(isActive());
+
+    Ref&lt;IDBRequest&gt; request = IDBRequest::create(context, objectStore, *this);
+
+    uint64_t objectStoreIdentifier = objectStore.info().identifier();
+    auto operation = createTransactionOperation(*this, request.get(), &amp;IDBTransaction::didClearObjectStoreOnServer, &amp;IDBTransaction::clearObjectStoreOnServer, objectStoreIdentifier);
+    scheduleOperation(WTF::move(operation));
+
+    return WTF::move(request);
+}
+
+void IDBTransaction::clearObjectStoreOnServer(TransactionOperation&amp; operation, const uint64_t&amp; objectStoreIdentifier)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::clearObjectStoreOnServer&quot;);
+
+    serverConnection().clearObjectStore(operation, objectStoreIdentifier);
+}
+
+void IDBTransaction::didClearObjectStoreOnServer(IDBRequest&amp; request, const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;IDBTransaction::didClearObjectStoreOnServer&quot;);
+
+    request.setResultToUndefined();
+    request.requestCompleted(resultData);
+}
+
</ins><span class="cx"> Ref&lt;IDBRequest&gt; IDBTransaction::requestPutOrAdd(ScriptExecutionContext&amp; context, IDBObjectStore&amp; objectStore, IDBKey* key, SerializedScriptValue&amp; value, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBTransaction::requestPutOrAdd&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBTransactionImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBTransactionImpl.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -89,6 +89,7 @@
</span><span class="cx"> 
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestPutOrAdd(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBKey*, SerializedScriptValue&amp;, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     Ref&lt;IDBRequest&gt; requestGetRecord(ScriptExecutionContext&amp;, IDBObjectStore&amp;, IDBKey&amp;);
</span><ins>+    Ref&lt;IDBRequest&gt; requestClearObjectStore(ScriptExecutionContext&amp;, IDBObjectStore&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void deleteObjectStore(const String&amp; objectStoreName);
</span><span class="cx"> 
</span><span class="lines">@@ -121,6 +122,9 @@
</span><span class="cx">     void createObjectStoreOnServer(TransactionOperation&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void didCreateObjectStoreOnServer(const IDBResultData&amp;);
</span><span class="cx"> 
</span><ins>+    void clearObjectStoreOnServer(TransactionOperation&amp;, const uint64_t&amp; objectStoreIdentifier);
+    void didClearObjectStoreOnServer(IDBRequest&amp;, const IDBResultData&amp;);
+
</ins><span class="cx">     void putOrAddOnServer(TransactionOperation&amp;, RefPtr&lt;IDBKey&gt;, RefPtr&lt;SerializedScriptValue&gt;, const IndexedDB::ObjectStoreOverwriteMode&amp;);
</span><span class="cx">     void didPutOrAddOnServer(IDBRequest&amp;, const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBBackingStore.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual IDBError createObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;) = 0;
</span><span class="cx">     virtual IDBError deleteObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, const String&amp; objectStoreName) = 0;
</span><ins>+    virtual IDBError clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier) = 0;
</ins><span class="cx">     virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, bool&amp; keyExists) = 0;
</span><span class="cx">     virtual IDBError deleteRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;) = 0;
</span><span class="cx">     virtual IDBError putRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; value) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -73,6 +73,11 @@
</span><span class="cx">     m_delegate-&gt;didDeleteObjectStore(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBConnectionToClient::didClearObjectStore(const IDBResultData&amp; result)
+{
+    m_delegate-&gt;didClearObjectStore(result);
+}
+
</ins><span class="cx"> void IDBConnectionToClient::didPutOrAdd(const IDBResultData&amp; result)
</span><span class="cx"> {
</span><span class="cx">     m_delegate-&gt;didPutOrAdd(result);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClient.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     void didCommitTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;);
</span><span class="cx">     void didCreateObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><ins>+    void didClearObjectStore(const IDBResultData&amp;);
</ins><span class="cx">     void didPutOrAdd(const IDBResultData&amp;);
</span><span class="cx">     void didGetRecord(const IDBResultData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBConnectionToClientDelegateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBConnectionToClientDelegate.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx">     virtual void didCommitTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;) = 0;
</span><span class="cx">     virtual void didCreateObjectStore(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didDeleteObjectStore(const IDBResultData&amp;) = 0;
</span><ins>+    virtual void didClearObjectStore(const IDBResultData&amp;) = 0;
</ins><span class="cx">     virtual void didPutOrAdd(const IDBResultData&amp;) = 0;
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -180,6 +180,17 @@
</span><span class="cx">     transaction-&gt;deleteObjectStore(requestData, objectStoreName);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBServer::clearObjectStore(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier)
+{
+    LOG(IndexedDB, &quot;IDBServer::clearObjectStore&quot;);
+
+    auto transaction = m_transactions.get(requestData.transactionIdentifier());
+    if (!transaction)
+        return;
+
+    transaction-&gt;clearObjectStore(requestData, objectStoreIdentifier);
+}
+
</ins><span class="cx"> void IDBServer::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;IDBServer::putOrAdd&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -61,6 +61,7 @@
</span><span class="cx">     void commitTransaction(const IDBResourceIdentifier&amp;);
</span><span class="cx">     void createObjectStore(const IDBRequestData&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName);
</span><ins>+    void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyData&amp;);
</span><span class="cx">     void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -90,6 +90,27 @@
</span><span class="cx">         addResult.iterator-&gt;value = WTF::move(objectStore);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryBackingStoreTransaction::objectStoreCleared(MemoryObjectStore&amp; objectStore, std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp; keyValueMap)
+{
+    ASSERT(m_objectStores.contains(&amp;objectStore));
+
+    auto addResult = m_clearedKeyValueMaps.add(&amp;objectStore, nullptr);
+
+    // If this object store has already been cleared during this transaction, we don't need to remember this clearing.
+    if (!addResult.isNewEntry)
+        return;
+
+    // If values had previously been changed during this transaction, fold those changes back into the
+    // cleared key-value map now, so we have exactly the map that will need to be restored if the transaction is aborted.
+    auto originalValues = m_originalValues.take(&amp;objectStore);
+    if (originalValues) {
+        for (auto iterator : *originalValues)
+            keyValueMap-&gt;set(iterator.key, iterator.value);
+    }
+
+    addResult.iterator-&gt;value = WTF::move(keyValueMap);
+}
+
</ins><span class="cx"> void MemoryBackingStoreTransaction::recordValueChanged(MemoryObjectStore&amp; objectStore, const IDBKeyData&amp; key)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_objectStores.contains(&amp;objectStore));
</span><span class="lines">@@ -97,6 +118,11 @@
</span><span class="cx">     if (m_isAborting)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><ins>+    // If this object store had been cleared during the transaction, no point in recording this
+    // individual key/value change as its entire key/value map will be restored upon abort.
+    if (m_clearedKeyValueMaps.contains(&amp;objectStore))
+        return;
+
</ins><span class="cx">     auto originalAddResult = m_originalValues.add(&amp;objectStore, nullptr);
</span><span class="cx">     if (originalAddResult.isNewEntry)
</span><span class="cx">         originalAddResult.iterator-&gt;value = std::make_unique&lt;KeyValueMap&gt;();
</span><span class="lines">@@ -138,7 +164,13 @@
</span><span class="cx">         ASSERT(m_originalKeyGenerators.contains(objectStore));
</span><span class="cx">         objectStore-&gt;setKeyGeneratorValue(m_originalKeyGenerators.get(objectStore));
</span><span class="cx"> 
</span><del>-        auto keyValueMap = m_originalValues.get(objectStore);
</del><ins>+        auto clearedKeyValueMap = m_clearedKeyValueMaps.take(objectStore);
+        if (clearedKeyValueMap) {
+            objectStore-&gt;replaceKeyValueStore(WTF::move(clearedKeyValueMap));
+            continue;
+        }
+
+        auto keyValueMap = m_originalValues.take(objectStore);
</ins><span class="cx">         if (!keyValueMap)
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><span class="lines">@@ -146,8 +178,6 @@
</span><span class="cx">             objectStore-&gt;deleteRecord(entry.key);
</span><span class="cx">             objectStore-&gt;setKeyValue(entry.key, entry.value);
</span><span class="cx">         }
</span><del>-
-        m_originalValues.remove(objectStore);
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     finish();
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryBackingStoreTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isVersionChange() const { return m_info.mode() == IndexedDB::TransactionMode::VersionChange; }
</span><span class="cx">     bool isWriting() const { return m_info.mode() != IndexedDB::TransactionMode::ReadOnly; }
</span><ins>+    bool isAborting() const { return m_isAborting; }
</ins><span class="cx"> 
</span><span class="cx">     const IDBDatabaseInfo&amp; originalDatabaseInfo() const;
</span><span class="cx"> 
</span><span class="lines">@@ -59,6 +60,7 @@
</span><span class="cx">     void addExistingObjectStore(MemoryObjectStore&amp;);
</span><span class="cx">     void recordValueChanged(MemoryObjectStore&amp;, const IDBKeyData&amp;);
</span><span class="cx">     void objectStoreDeleted(std::unique_ptr&lt;MemoryObjectStore&gt;);
</span><ins>+    void objectStoreCleared(MemoryObjectStore&amp;, std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void abort();
</span><span class="cx">     void commit();
</span><span class="lines">@@ -82,7 +84,7 @@
</span><span class="cx">     HashMap&lt;MemoryObjectStore*, uint64_t&gt; m_originalKeyGenerators;
</span><span class="cx">     HashMap&lt;String, std::unique_ptr&lt;MemoryObjectStore&gt;&gt; m_deletedObjectStores;
</span><span class="cx">     HashMap&lt;MemoryObjectStore*, std::unique_ptr&lt;KeyValueMap&gt;&gt; m_originalValues;
</span><del>-
</del><ins>+    HashMap&lt;MemoryObjectStore*, std::unique_ptr&lt;KeyValueMap&gt;&gt; m_clearedKeyValueMaps;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace IDBServer
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -161,6 +161,27 @@
</span><span class="cx">     return IDBError();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBError MemoryIDBBackingStore::clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier)
+{
+    LOG(IndexedDB, &quot;MemoryIDBBackingStore::clearObjectStore&quot;);
+    ASSERT(objectStoreIdentifier);
+
+    ASSERT_UNUSED(transactionIdentifier, m_transactions.contains(transactionIdentifier));
+
+#ifndef NDEBUG
+    auto transaction = m_transactions.get(transactionIdentifier);
+    ASSERT(transaction-&gt;isWriting());
+#endif
+
+    auto objectStore = m_objectStoresByIdentifier.get(objectStoreIdentifier);
+    if (!objectStore)
+        return IDBError(IDBExceptionCode::ConstraintError);
+
+    objectStore-&gt;clear();
+
+    return IDBError();
+}
+
</ins><span class="cx"> void MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort(MemoryObjectStore&amp; objectStore)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryIDBBackingStore::removeObjectStoreForVersionChangeAbort&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryIDBBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryIDBBackingStore.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     virtual IDBError commitTransaction(const IDBResourceIdentifier&amp; transactionIdentifier) override final;
</span><span class="cx">     virtual IDBError createObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;) override final;
</span><span class="cx">     virtual IDBError deleteObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, const String&amp; objectStoreName) override final;
</span><ins>+    virtual IDBError clearObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier) override final;
</ins><span class="cx">     virtual IDBError keyExistsInObjectStore(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, bool&amp; keyExists) override final;
</span><span class="cx">     virtual IDBError deleteRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;) override final;
</span><span class="cx">     virtual IDBError putRecord(const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; value) override final;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -73,6 +73,22 @@
</span><span class="cx">     return m_keyValueStore-&gt;contains(key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryObjectStore::clear()
+{
+    LOG(IndexedDB, &quot;MemoryObjectStore::clear&quot;);
+    ASSERT(m_writeTransaction);
+
+    m_writeTransaction-&gt;objectStoreCleared(*this, WTF::move(m_keyValueStore));
+}
+
+void MemoryObjectStore::replaceKeyValueStore(std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp; store)
+{
+    ASSERT(m_writeTransaction);
+    ASSERT(m_writeTransaction-&gt;isAborting());
+
+    m_keyValueStore = WTF::move(store);
+}
+
</ins><span class="cx"> void MemoryObjectStore::deleteRecord(const IDBKeyData&amp; key)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;MemoryObjectStore::deleteRecord&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverMemoryObjectStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/MemoryObjectStore.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -63,6 +63,9 @@
</span><span class="cx">     uint64_t currentKeyGeneratorValue() const { return m_keyGeneratorValue; }
</span><span class="cx">     void setKeyGeneratorValue(uint64_t value) { m_keyGeneratorValue = value; }
</span><span class="cx"> 
</span><ins>+    void clear();
+    void replaceKeyValueStore(std::unique_ptr&lt;KeyValueMap&gt;&amp;&amp;);
+
</ins><span class="cx">     ThreadSafeDataBuffer valueForKey(const IDBKeyData&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     const IDBObjectStoreInfo&amp; info() const { return m_info; }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -296,6 +296,35 @@
</span><span class="cx">     performErrorCallback(callbackIdentifier, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabase::clearObjectStore(UniqueIDBDatabaseTransaction&amp; transaction, uint64_t objectStoreIdentifier, ErrorCallback callback)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::clearObjectStore&quot;);
+
+    uint64_t callbackID = storeCallback(callback);
+    m_server.postDatabaseTask(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::performClearObjectStore, callbackID, transaction.info().identifier(), objectStoreIdentifier));
+}
+
+void UniqueIDBDatabase::performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier)
+{
+    ASSERT(!isMainThread());
+    LOG(IndexedDB, &quot;(db) UniqueIDBDatabase::performClearObjectStore&quot;);
+
+    ASSERT(m_backingStore);
+    m_backingStore-&gt;clearObjectStore(transactionIdentifier, objectStoreIdentifier);
+
+    IDBError error;
+    m_server.postDatabaseTaskReply(createCrossThreadTask(*this, &amp;UniqueIDBDatabase::didPerformClearObjectStore, callbackIdentifier, error));
+}
+
+void UniqueIDBDatabase::didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&amp; error)
+{
+    ASSERT(isMainThread());
+    LOG(IndexedDB, &quot;(main) UniqueIDBDatabase::didPerformClearObjectStore&quot;);
+
+    performErrorCallback(callbackIdentifier, error);
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode, KeyDataCallback callback)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -71,6 +71,7 @@
</span><span class="cx"> 
</span><span class="cx">     void createObjectStore(UniqueIDBDatabaseTransaction&amp;, const IDBObjectStoreInfo&amp;, ErrorCallback);
</span><span class="cx">     void deleteObjectStore(UniqueIDBDatabaseTransaction&amp;, const String&amp; objectStoreName, ErrorCallback);
</span><ins>+    void clearObjectStore(UniqueIDBDatabaseTransaction&amp;, uint64_t objectStoreIdentifier, ErrorCallback);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode, KeyDataCallback);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyData&amp;, ValueDataCallback);
</span><span class="cx">     void commitTransaction(UniqueIDBDatabaseTransaction&amp;, ErrorCallback);
</span><span class="lines">@@ -100,6 +101,7 @@
</span><span class="cx">     void beginTransactionInBackingStore(const IDBTransactionInfo&amp;);
</span><span class="cx">     void performCreateObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void performDeleteObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, const String&amp; objectStoreName);
</span><ins>+    void performClearObjectStore(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier);
</ins><span class="cx">     void performPutOrAdd(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void performGetRecord(uint64_t callbackIdentifier, const IDBResourceIdentifier&amp; transactionIdentifier, uint64_t objectStoreIdentifier, const IDBKeyData&amp;);
</span><span class="cx">     void performActivateTransactionInBackingStore(uint64_t callbackIdentifier, const IDBTransactionInfo&amp;);
</span><span class="lines">@@ -108,6 +110,7 @@
</span><span class="cx">     void didOpenBackingStore(const IDBDatabaseInfo&amp;);
</span><span class="cx">     void didPerformCreateObjectStore(uint64_t callbackIdentifier, const IDBError&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void didPerformDeleteObjectStore(uint64_t callbackIdentifier, const IDBError&amp;, const String&amp; objectStoreName);
</span><ins>+    void didPerformClearObjectStore(uint64_t callbackIdentifier, const IDBError&amp;);
</ins><span class="cx">     void didPerformPutOrAdd(uint64_t callbackIdentifier, const IDBError&amp;, const IDBKeyData&amp;);
</span><span class="cx">     void didPerformGetRecord(uint64_t callbackIdentifier, const IDBError&amp;, const ThreadSafeDataBuffer&amp;);
</span><span class="cx">     void didPerformCommitTransaction(uint64_t callbackIdentifier, const IDBError&amp;, const IDBResourceIdentifier&amp; transactionIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -146,6 +146,13 @@
</span><span class="cx">     m_connectionToClient.didDeleteObjectStore(resultData);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseConnection::didClearObjectStore(const IDBResultData&amp; resultData)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseConnection::didClearObjectStore&quot;);
+
+    m_connectionToClient.didClearObjectStore(resultData);
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseConnectionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseConnection.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">     void didCommitTransaction(UniqueIDBDatabaseTransaction&amp;, const IDBError&amp;);
</span><span class="cx">     void didCreateObjectStore(const IDBResultData&amp;);
</span><span class="cx">     void didDeleteObjectStore(const IDBResultData&amp;);
</span><ins>+    void didClearObjectStore(const IDBResultData&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     UniqueIDBDatabaseConnection(UniqueIDBDatabase&amp;, IDBConnectionToClient&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -130,7 +130,22 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void UniqueIDBDatabaseTransaction::clearObjectStore(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier)
+{
+    LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::clearObjectStore&quot;);
</ins><span class="cx"> 
</span><ins>+    ASSERT(m_transactionInfo.identifier() == requestData.transactionIdentifier());
+
+    RefPtr&lt;UniqueIDBDatabaseTransaction&gt; self(this);
+    m_databaseConnection-&gt;database().clearObjectStore(*this, objectStoreIdentifier, [this, self, requestData](const IDBError&amp; error) {
+        LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::clearObjectStore (callback)&quot;);
+        if (error.isNull())
+            m_databaseConnection-&gt;didClearObjectStore(IDBResultData::clearObjectStoreSuccess(requestData.requestIdentifier()));
+        else
+            m_databaseConnection-&gt;didClearObjectStore(IDBResultData::error(requestData.requestIdentifier(), error));
+    });
+}
+
</ins><span class="cx"> void UniqueIDBDatabaseTransaction::putOrAdd(const IDBRequestData&amp; requestData, const IDBKeyData&amp; keyData, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     LOG(IndexedDB, &quot;UniqueIDBDatabaseTransaction::putOrAdd&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -64,6 +64,7 @@
</span><span class="cx"> 
</span><span class="cx">     void createObjectStore(const IDBRequestData&amp;, const IDBObjectStoreInfo&amp;);
</span><span class="cx">     void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName);
</span><ins>+    void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier);
</ins><span class="cx">     void putOrAdd(const IDBRequestData&amp;, const IDBKeyData&amp;, const ThreadSafeDataBuffer&amp; valueData, IndexedDB::ObjectStoreOverwriteMode);
</span><span class="cx">     void getRecord(const IDBRequestData&amp;, const IDBKeyData&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -98,6 +98,11 @@
</span><span class="cx">     return { IDBResultType::DeleteObjectStoreSuccess, requestIdentifier };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+IDBResultData IDBResultData::clearObjectStoreSuccess(const IDBResourceIdentifier&amp; requestIdentifier)
+{
+    return { IDBResultType::ClearObjectStoreSuccess, requestIdentifier };
+}
+
</ins><span class="cx"> IDBResultData IDBResultData::putOrAddSuccess(const IDBResourceIdentifier&amp; requestIdentifier, const IDBKeyData&amp; resultKey)
</span><span class="cx"> {
</span><span class="cx">     IDBResultData result(IDBResultType::PutOrAddSuccess, requestIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBResultDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBResultData.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx">     OpenDatabaseUpgradeNeeded,
</span><span class="cx">     CreateObjectStoreSuccess,
</span><span class="cx">     DeleteObjectStoreSuccess,
</span><ins>+    ClearObjectStoreSuccess,
</ins><span class="cx">     PutOrAddSuccess,
</span><span class="cx">     GetRecordSuccess,
</span><span class="cx"> };
</span><span class="lines">@@ -62,6 +63,7 @@
</span><span class="cx">     static IDBResultData openDatabaseUpgradeNeeded(const IDBResourceIdentifier&amp;, IDBServer::UniqueIDBDatabaseTransaction&amp;);
</span><span class="cx">     static IDBResultData createObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><span class="cx">     static IDBResultData deleteObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</span><ins>+    static IDBResultData clearObjectStoreSuccess(const IDBResourceIdentifier&amp;);
</ins><span class="cx">     static IDBResultData putOrAddSuccess(const IDBResourceIdentifier&amp;, const IDBKeyData&amp;);
</span><span class="cx">     static IDBResultData getRecordSuccess(const IDBResourceIdentifier&amp;, const ThreadSafeDataBuffer&amp; valueData);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -135,6 +135,14 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::didClearObjectStore(const IDBResultData&amp; resultData)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, resultData] {
+        m_connectionToServer-&gt;didClearObjectStore(resultData);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::didPutOrAdd(const IDBResultData&amp; resultData)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; self(this);
</span><span class="lines">@@ -183,6 +191,14 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InProcessIDBServer::clearObjectStore(const IDBRequestData&amp; requestData, uint64_t objectStoreIdentifier)
+{
+    RefPtr&lt;InProcessIDBServer&gt; self(this);
+    RunLoop::current().dispatch([this, self, requestData, objectStoreIdentifier] {
+        m_server-&gt;clearObjectStore(requestData, objectStoreIdentifier);
+    });
+}
+
</ins><span class="cx"> void InProcessIDBServer::putOrAdd(const IDBRequestData&amp; requestData, IDBKey* key, SerializedScriptValue&amp; value, const IndexedDB::ObjectStoreOverwriteMode overwriteMode)
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;InProcessIDBServer&gt; self(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (191825 => 191826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-10-30 23:18:27 UTC (rev 191825)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-10-30 23:20:02 UTC (rev 191826)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx">     virtual void commitTransaction(IDBResourceIdentifier&amp;) override final;
</span><span class="cx">     virtual void createObjectStore(const IDBRequestData&amp;, const IDBObjectStoreInfo&amp;) override final;
</span><span class="cx">     virtual void deleteObjectStore(const IDBRequestData&amp;, const String&amp; objectStoreName) override final;
</span><ins>+    virtual void clearObjectStore(const IDBRequestData&amp;, uint64_t objectStoreIdentifier) override final;
</ins><span class="cx">     virtual void putOrAdd(const IDBRequestData&amp;, IDBKey*, SerializedScriptValue&amp;, const IndexedDB::ObjectStoreOverwriteMode) override final;
</span><span class="cx">     virtual void getRecord(const IDBRequestData&amp;, IDBKey*) override final;
</span><span class="cx">     virtual void establishTransaction(uint64_t databaseConnectionIdentifier, const IDBTransactionInfo&amp;) override final;
</span><span class="lines">@@ -73,6 +74,7 @@
</span><span class="cx">     virtual void didCommitTransaction(const IDBResourceIdentifier&amp; transactionIdentifier, const IDBError&amp;) override final;
</span><span class="cx">     virtual void didCreateObjectStore(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didDeleteObjectStore(const IDBResultData&amp;) override final;
</span><ins>+    virtual void didClearObjectStore(const IDBResultData&amp;) override final;
</ins><span class="cx">     virtual void didPutOrAdd(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void didGetRecord(const IDBResultData&amp;) override final;
</span><span class="cx">     virtual void fireVersionChangeEvent(IDBServer::UniqueIDBDatabaseConnection&amp;, uint64_t requestedVersion) override final;
</span></span></pre>
</div>
</div>

</body>
</html>