<!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>[194414] 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/194414">194414</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-12-23 23:40:29 -0800 (Wed, 23 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: Don't open any new connections until after version change transactions are completely handled.
https://bugs.webkit.org/show_bug.cgi?id=152441
Reviewed by Alex Christensen.
Source/WebCore:
No new tests (At least 4 failing tests now pass).
When a version change transaction is in progress for a database, the server should not open any new connections
to that database until the version change transaction has been 100% completed.
This means *all* events related to finishing the transaction must fire.
To support this, a new message from client -> server is added.
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
* Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
(WebCore::IDBClient::IDBOpenDBRequest::dispatchEvent):
* Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
* Modules/indexeddb/client/IDBRequestImpl.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction): Deleted.
(WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::didFinishHandlingVersionChange):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::loggingString):
* Modules/indexeddb/shared/IDBTransactionInfo.h:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
* Modules/indexeddb/shared/InProcessIDBServer.h:
LayoutTests:
* platform/mac-wk1/TestExpectations: Enable 4 now-passing tests.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1TestExpectations">trunk/LayoutTests/platform/mac-wk1/TestExpectations</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="#trunkSourceWebCoreModulesindexeddbclientIDBOpenDBRequestImplcpp">trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBOpenDBRequestImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh">trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.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="#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="#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="#trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfocpp">trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfoh">trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.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>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/LayoutTests/ChangeLog        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -1,5 +1,14 @@
</span><span class="cx"> 2015-12-23 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><ins>+ Modern IDB: Don't open any new connections until after version change transactions are completely handled.
+ https://bugs.webkit.org/show_bug.cgi?id=152441
+
+ Reviewed by Alex Christensen.
+
+ * platform/mac-wk1/TestExpectations: Enable 4 now-passing tests.
+
+2015-12-23 Brady Eidson <beidson@apple.com>
+
</ins><span class="cx"> Modern IDB: storage/indexeddb/transaction-basics.html fails.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=152481
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -99,10 +99,6 @@
</span><span class="cx"> storage/indexeddb/database-deletepending-flag.html [ Failure ]
</span><span class="cx"> storage/indexeddb/delete-closed-database-object.html [ Failure ]
</span><span class="cx"> storage/indexeddb/intversion-gated-on-delete.html [ Failure ]
</span><del>-storage/indexeddb/intversion-open-in-upgradeneeded.html [ Failure ]
-storage/indexeddb/intversion-pending-version-changes-descending.html [ Failure ]
-storage/indexeddb/intversion-pending-version-changes-same.html [ Failure ]
-storage/indexeddb/intversion-two-opens-no-versions.html [ Failure ]
</del><span class="cx"> storage/indexeddb/odd-strings.html [ Failure ]
</span><span class="cx"> storage/indexeddb/open-db-private-browsing.html [ Failure ]
</span><span class="cx"> storage/indexeddb/properties-disabled-at-runtime.html [ Failure ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/ChangeLog        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -1,5 +1,55 @@
</span><span class="cx"> 2015-12-23 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><ins>+ Modern IDB: Don't open any new connections until after version change transactions are completely handled.
+ https://bugs.webkit.org/show_bug.cgi?id=152441
+
+ Reviewed by Alex Christensen.
+
+ No new tests (At least 4 failing tests now pass).
+
+ When a version change transaction is in progress for a database, the server should not open any new connections
+ to that database until the version change transaction has been 100% completed.
+
+ This means *all* events related to finishing the transaction must fire.
+
+ To support this, a new message from client -> server is added.
+
+ * Modules/indexeddb/client/IDBConnectionToServer.cpp:
+ (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
+ * Modules/indexeddb/client/IDBConnectionToServer.h:
+ * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
+
+ * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp:
+ (WebCore::IDBClient::IDBOpenDBRequest::dispatchEvent):
+ * Modules/indexeddb/client/IDBOpenDBRequestImpl.h:
+ * Modules/indexeddb/client/IDBRequestImpl.h:
+
+ * Modules/indexeddb/server/IDBServer.cpp:
+ (WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
+ * Modules/indexeddb/server/IDBServer.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
+ (WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
+ (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction): Deleted.
+ (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction): Deleted.
+ (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): Deleted.
+ * Modules/indexeddb/server/UniqueIDBDatabase.h:
+
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
+ (WebCore::IDBServer::UniqueIDBDatabaseTransaction::didFinishHandlingVersionChange):
+ * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
+
+ * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
+ (WebCore::IDBTransactionInfo::loggingString):
+ * Modules/indexeddb/shared/IDBTransactionInfo.h:
+
+ * Modules/indexeddb/shared/InProcessIDBServer.cpp:
+ (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
+ * Modules/indexeddb/shared/InProcessIDBServer.h:
+
+2015-12-23 Brady Eidson <beidson@apple.com>
+
</ins><span class="cx"> Modern IDB: storage/indexeddb/transaction-basics.html fails.
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=152481
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -290,6 +290,13 @@
</span><span class="cx"> transaction->didCommit(error);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBConnectionToServer::didFinishHandlingVersionChangeTransaction(IDBTransaction& transaction)
+{
+ LOG(IndexedDB, "IDBConnectionToServer::didFinishHandlingVersionChangeTransaction");
+ auto identifier = transaction.info().identifier();
+ m_delegate->didFinishHandlingVersionChangeTransaction(identifier);
+}
+
</ins><span class="cx"> void IDBConnectionToServer::abortTransaction(IDBTransaction& transaction)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBConnectionToServer::abortTransaction");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBConnectionToServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServer.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -98,6 +98,8 @@
</span><span class="cx"> void commitTransaction(IDBTransaction&);
</span><span class="cx"> void didCommitTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
</span><span class="cx">
</span><ins>+ void didFinishHandlingVersionChangeTransaction(IDBTransaction&);
+
</ins><span class="cx"> void abortTransaction(IDBTransaction&);
</span><span class="cx"> void didAbortTransaction(const IDBResourceIdentifier& transactionIdentifier, const IDBError&);
</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 (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionToServerDelegate.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> virtual void openDatabase(IDBRequestData&) = 0;
</span><span class="cx"> virtual void abortTransaction(IDBResourceIdentifier&) = 0;
</span><span class="cx"> virtual void commitTransaction(IDBResourceIdentifier&) = 0;
</span><ins>+ virtual void didFinishHandlingVersionChangeTransaction(IDBResourceIdentifier&) = 0;
</ins><span class="cx"> virtual void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) = 0;
</span><span class="cx"> virtual void deleteObjectStore(const IDBRequestData&, const String& objectStoreName) = 0;
</span><span class="cx"> virtual void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBOpenDBRequestImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -101,6 +101,16 @@
</span><span class="cx"> enqueueEvent(Event::create(eventNames().errorEvent, true, true));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool IDBOpenDBRequest::dispatchEvent(Event& event)
+{
+ bool result = IDBRequest::dispatchEvent(event);
+
+ if (m_transaction && m_transaction->isVersionChange() && (event.type() == eventNames().errorEvent || event.type() == eventNames().successEvent))
+ m_transaction->database().serverConnection().didFinishHandlingVersionChangeTransaction(*m_transaction);
+
+ return result;
+}
+
</ins><span class="cx"> void IDBOpenDBRequest::onSuccess(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::onSuccess()");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBOpenDBRequestImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBOpenDBRequestImpl.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -57,6 +57,8 @@
</span><span class="cx"> void fireSuccessAfterVersionChangeCommit();
</span><span class="cx"> void fireErrorAfterVersionChangeCompletion();
</span><span class="cx">
</span><ins>+ virtual bool dispatchEvent(Event&) override final;
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBOpenDBRequest(IDBConnectionToServer&, ScriptExecutionContext*, const IDBDatabaseIdentifier&, uint64_t version, IndexedDB::RequestType);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbclientIDBRequestImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBRequestImpl.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx"> using RefCounted<IDBRequest>::deref;
</span><span class="cx">
</span><span class="cx"> void enqueueEvent(Ref<Event>&&);
</span><del>- virtual bool dispatchEvent(Event&) override final;
</del><ins>+ virtual bool dispatchEvent(Event&) override;
</ins><span class="cx">
</span><span class="cx"> IDBConnectionToServer& connection() { return m_connection; }
</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 (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -317,6 +317,17 @@
</span><span class="cx"> transaction->commit();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void IDBServer::didFinishHandlingVersionChangeTransaction(const IDBResourceIdentifier& transactionIdentifier)
+{
+ LOG(IndexedDB, "IDBServer::didFinishHandlingVersionChangeTransaction");
+
+ auto transaction = m_transactions.get(transactionIdentifier);
+ if (!transaction)
+ return;
+
+ transaction->didFinishHandlingVersionChange();
+}
+
</ins><span class="cx"> void IDBServer::databaseConnectionClosed(uint64_t databaseConnectionIdentifier)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBServer::databaseConnectionClosed");
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/IDBServer.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> void deleteDatabase(const IDBRequestData&);
</span><span class="cx"> void abortTransaction(const IDBResourceIdentifier&);
</span><span class="cx"> void commitTransaction(const IDBResourceIdentifier&);
</span><ins>+ void didFinishHandlingVersionChangeTransaction(const IDBResourceIdentifier&);
</ins><span class="cx"> void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&);
</span><span class="cx"> void deleteObjectStore(const IDBRequestData&, const String& objectStoreName);
</span><span class="cx"> void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -206,13 +206,10 @@
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="cx"> LOG(IndexedDB, "(main) UniqueIDBDatabase::handleDatabaseOperations - There are %zu pending", m_pendingDatabaseOperations.size());
</span><span class="cx">
</span><del>- if (m_versionChangeDatabaseConnection || m_currentOperation) {
- // We can't start the next database operation quite yet, but we might need to notify all open connections
- // about a pending delete.
- if (!m_pendingDatabaseOperations.isEmpty() && m_pendingDatabaseOperations.first()->isDeleteRequest() && !m_hasNotifiedConnectionsOfDelete) {
- m_hasNotifiedConnectionsOfDelete = true;
- notifyConnectionsOfVersionChange(0);
- }
</del><ins>+ if (m_versionChangeDatabaseConnection || m_versionChangeTransaction || m_currentOperation) {
+ // We can't start any new open-database operations right now, but we might be able to start handling a delete operation.
+ if (!m_currentOperation && !m_pendingDatabaseOperations.isEmpty() && m_pendingDatabaseOperations.first()->isDeleteRequest())
+ m_currentOperation = m_pendingDatabaseOperations.takeFirst();
</ins><span class="cx">
</span><span class="cx"> // Some operations (such as the first open operation after a delete) require multiple passes to completely handle
</span><span class="cx"> if (m_currentOperation)
</span><span class="lines">@@ -849,9 +846,6 @@
</span><span class="cx"> ASSERT(&m_versionChangeTransaction->databaseConnection() == m_versionChangeDatabaseConnection);
</span><span class="cx"> ASSERT(m_databaseInfo->version() == transaction.info().newVersion());
</span><span class="cx">
</span><del>- m_versionChangeTransaction = nullptr;
- m_versionChangeDatabaseConnection = nullptr;
-
</del><span class="cx"> invokeOperationAndTransactionTimer();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -889,6 +883,20 @@
</span><span class="cx"> m_server.postDatabaseTask(createCrossThreadTask(*this, &UniqueIDBDatabase::performAbortTransaction, callbackID, transaction.info().identifier()));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabase::didFinishHandlingVersionChange(UniqueIDBDatabaseTransaction& transaction)
+{
+ ASSERT(isMainThread());
+ LOG(IndexedDB, "(main) UniqueIDBDatabase::didFinishHandlingVersionChange");
+
+ ASSERT(m_versionChangeTransaction);
+ ASSERT_UNUSED(transaction, m_versionChangeTransaction == &transaction);
+
+ m_versionChangeTransaction = nullptr;
+ m_versionChangeDatabaseConnection = nullptr;
+
+ invokeOperationAndTransactionTimer();
+}
+
</ins><span class="cx"> void UniqueIDBDatabase::performAbortTransaction(uint64_t callbackIdentifier, const IDBResourceIdentifier& transactionIdentifier)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span><span class="lines">@@ -907,9 +915,6 @@
</span><span class="cx"> ASSERT(&m_versionChangeTransaction->databaseConnection() == m_versionChangeDatabaseConnection);
</span><span class="cx"> ASSERT(m_versionChangeTransaction->originalDatabaseInfo());
</span><span class="cx"> m_databaseInfo = std::make_unique<IDBDatabaseInfo>(*m_versionChangeTransaction->originalDatabaseInfo());
</span><del>-
- m_versionChangeTransaction = nullptr;
- m_versionChangeDatabaseConnection = nullptr;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inProgressTransactionCompleted(transactionIdentifier);
</span><span class="lines">@@ -1094,9 +1099,6 @@
</span><span class="cx"> auto transaction = m_inProgressTransactions.take(transactionIdentifier);
</span><span class="cx"> ASSERT(transaction);
</span><span class="cx">
</span><del>- if (m_versionChangeTransaction == transaction)
- m_versionChangeTransaction = nullptr;
-
</del><span class="cx"> for (auto objectStore : transaction->objectStoreIdentifiers())
</span><span class="cx"> m_objectStoreTransactionCounts.remove(objectStore);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabase.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -92,6 +92,7 @@
</span><span class="cx"> void iterateCursor(const IDBRequestData&, const IDBKeyData&, unsigned long count, GetResultCallback);
</span><span class="cx"> void commitTransaction(UniqueIDBDatabaseTransaction&, ErrorCallback);
</span><span class="cx"> void abortTransaction(UniqueIDBDatabaseTransaction&, ErrorCallback);
</span><ins>+ void didFinishHandlingVersionChange(UniqueIDBDatabaseTransaction&);
</ins><span class="cx"> void transactionDestroyed(UniqueIDBDatabaseTransaction&);
</span><span class="cx"> void connectionClosedFromClient(UniqueIDBDatabaseConnection&);
</span><span class="cx">
</span><span class="lines">@@ -183,7 +184,7 @@
</span><span class="cx"> HashSet<RefPtr<UniqueIDBDatabaseConnection>> m_closePendingDatabaseConnections;
</span><span class="cx">
</span><span class="cx"> RefPtr<UniqueIDBDatabaseConnection> m_versionChangeDatabaseConnection;
</span><del>- UniqueIDBDatabaseTransaction* m_versionChangeTransaction { nullptr };
</del><ins>+ RefPtr<UniqueIDBDatabaseTransaction> m_versionChangeTransaction;
</ins><span class="cx">
</span><span class="cx"> bool m_isOpeningBackingStore { false };
</span><span class="cx"> std::unique_ptr<IDBBackingStore> m_backingStore;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -309,6 +309,14 @@
</span><span class="cx"> m_databaseConnection->connectionToClient().didStartTransaction(m_transactionInfo.identifier(), error);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void UniqueIDBDatabaseTransaction::didFinishHandlingVersionChange()
+{
+ LOG(IndexedDB, "UniqueIDBDatabaseTransaction::didFinishHandlingVersionChange");
+ ASSERT(isVersionChange());
+
+ m_databaseConnection->database().didFinishHandlingVersionChange(*this);
+}
+
</ins><span class="cx"> } // namespace IDBServer
</span><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbserverUniqueIDBDatabaseTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -79,6 +79,7 @@
</span><span class="cx"> void iterateCursor(const IDBRequestData&, const IDBKeyData&, unsigned long count);
</span><span class="cx">
</span><span class="cx"> void didActivateInBackingStore(const IDBError&);
</span><ins>+ void didFinishHandlingVersionChange();
</ins><span class="cx">
</span><span class="cx"> const Vector<uint64_t>& objectStoreIdentifiers();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx">
</span><ins>+#include "IDBTransactionImpl.h"
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> IDBTransactionInfo::IDBTransactionInfo(const IDBResourceIdentifier& identifier)
</span><span class="lines">@@ -80,6 +82,28 @@
</span><span class="cx"> return WTF::move(result);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#ifndef NDEBUG
+String IDBTransactionInfo::loggingString() const
+{
+ String modeString;
+ switch (m_mode) {
+ case IndexedDB::TransactionMode::ReadOnly:
+ modeString = IDBTransaction::modeReadOnly();
+ break;
+ case IndexedDB::TransactionMode::ReadWrite:
+ modeString = IDBTransaction::modeReadWrite();
+ break;
+ case IndexedDB::TransactionMode::VersionChange:
+ modeString = IDBTransaction::modeVersionChange();
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
+
+ return makeString("Transaction: ", m_identifier.loggingString(), " mode ", modeString, " newVersion ", String::number(m_newVersion));
+}
+#endif
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedIDBTransactionInfoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/IDBTransactionInfo.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -61,6 +61,10 @@
</span><span class="cx">
</span><span class="cx"> IDBDatabaseInfo* originalDatabaseInfo() const { return m_originalDatabaseInfo.get(); }
</span><span class="cx">
</span><ins>+#ifndef NDEBUG
+ String loggingString() const;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBTransactionInfo(const IDBResourceIdentifier&);
</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 (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.cpp        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -224,6 +224,14 @@
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InProcessIDBServer::didFinishHandlingVersionChangeTransaction(IDBResourceIdentifier& transactionIdentifier)
+{
+ RefPtr<InProcessIDBServer> self(this);
+ RunLoop::current().dispatch([this, self, transactionIdentifier] {
+ m_server->didFinishHandlingVersionChangeTransaction(transactionIdentifier);
+ });
+}
+
</ins><span class="cx"> void InProcessIDBServer::createObjectStore(const IDBRequestData& resultData, const IDBObjectStoreInfo& info)
</span><span class="cx"> {
</span><span class="cx"> RefPtr<InProcessIDBServer> self(this);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbsharedInProcessIDBServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h (194413 => 194414)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-12-24 07:39:01 UTC (rev 194413)
+++ trunk/Source/WebCore/Modules/indexeddb/shared/InProcessIDBServer.h        2015-12-24 07:40:29 UTC (rev 194414)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> virtual void openDatabase(IDBRequestData&) override final;
</span><span class="cx"> virtual void abortTransaction(IDBResourceIdentifier&) override final;
</span><span class="cx"> virtual void commitTransaction(IDBResourceIdentifier&) override final;
</span><ins>+ virtual void didFinishHandlingVersionChangeTransaction(IDBResourceIdentifier&) override final;
</ins><span class="cx"> virtual void createObjectStore(const IDBRequestData&, const IDBObjectStoreInfo&) override final;
</span><span class="cx"> virtual void deleteObjectStore(const IDBRequestData&, const String& objectStoreName) override final;
</span><span class="cx"> virtual void clearObjectStore(const IDBRequestData&, uint64_t objectStoreIdentifier) override final;
</span></span></pre>
</div>
</div>
</body>
</html>