<!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>[200483] trunk/Source/WebCore</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/200483">200483</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-05-05 15:13:58 -0700 (Thu, 05 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Modern IDB: Add thread identifiers and assertions to IDB DOM objects.
https://bugs.webkit.org/show_bug.cgi?id=157329
Reviewed by Alex Christensen.
No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::IDBCursor):
(WebCore::IDBCursor::~IDBCursor):
(WebCore::IDBCursor::sourcesDeleted):
(WebCore::IDBCursor::transaction):
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::uncheckedIterateCursor):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::~IDBDatabase):
(WebCore::IDBDatabase::hasPendingActivity):
(WebCore::IDBDatabase::name):
(WebCore::IDBDatabase::version):
(WebCore::IDBDatabase::objectStoreNames):
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::transaction):
(WebCore::IDBDatabase::deleteObjectStore):
(WebCore::IDBDatabase::close):
(WebCore::IDBDatabase::maybeCloseInServer):
(WebCore::IDBDatabase::activeDOMObjectName):
(WebCore::IDBDatabase::canSuspendForDocumentSuspension):
(WebCore::IDBDatabase::stop):
(WebCore::IDBDatabase::startVersionChangeTransaction):
(WebCore::IDBDatabase::didStartTransaction):
(WebCore::IDBDatabase::willCommitTransaction):
(WebCore::IDBDatabase::didCommitTransaction):
(WebCore::IDBDatabase::willAbortTransaction):
(WebCore::IDBDatabase::didAbortTransaction):
(WebCore::IDBDatabase::didCommitOrAbortTransaction):
(WebCore::IDBDatabase::fireVersionChangeEvent):
(WebCore::IDBDatabase::dispatchEvent):
(WebCore::IDBDatabase::didCreateIndexInfo):
(WebCore::IDBDatabase::didDeleteIndexInfo):
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::originThreadID):
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::IDBIndex):
(WebCore::IDBIndex::~IDBIndex):
(WebCore::IDBIndex::name):
(WebCore::IDBIndex::objectStore):
(WebCore::IDBIndex::keyPath):
(WebCore::IDBIndex::unique):
(WebCore::IDBIndex::multiEntry):
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::markAsDeleted):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::IDBObjectStore):
(WebCore::IDBObjectStore::~IDBObjectStore):
(WebCore::IDBObjectStore::name):
(WebCore::IDBObjectStore::keyPath):
(WebCore::IDBObjectStore::indexNames):
(WebCore::IDBObjectStore::transaction):
(WebCore::IDBObjectStore::autoIncrement):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::putOrAdd):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::clear):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::markAsDeleted):
(WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
(WebCore::IDBOpenDBRequest::onError):
(WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
(WebCore::IDBOpenDBRequest::dispatchEvent):
(WebCore::IDBOpenDBRequest::onSuccess):
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
(WebCore::IDBOpenDBRequest::requestCompleted):
(WebCore::IDBOpenDBRequest::requestBlocked):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::~IDBRequest):
(WebCore::IDBRequest::errorCode):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::setSource):
(WebCore::IDBRequest::setVersionChangeTransaction):
(WebCore::IDBRequest::transaction):
(WebCore::IDBRequest::readyState):
(WebCore::IDBRequest::sourceObjectStoreIdentifier):
(WebCore::IDBRequest::sourceIndexIdentifier):
(WebCore::IDBRequest::requestedIndexRecordType):
(WebCore::IDBRequest::eventTargetInterface):
(WebCore::IDBRequest::activeDOMObjectName):
(WebCore::IDBRequest::canSuspendForDocumentSuspension):
(WebCore::IDBRequest::hasPendingActivity):
(WebCore::IDBRequest::stop):
(WebCore::IDBRequest::enqueueEvent):
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
(WebCore::IDBRequest::clearResult):
(WebCore::IDBRequest::setResultToUndefined):
(WebCore::IDBRequest::resultCursor):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBRequest::requestCompleted):
(WebCore::IDBRequest::onError):
(WebCore::IDBRequest::onSuccess):
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::originThreadID):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::~IDBTransaction):
(WebCore::IDBTransaction::mode):
(WebCore::IDBTransaction::db):
(WebCore::IDBTransaction::serverConnection):
(WebCore::IDBTransaction::error):
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::abortDueToFailedRequest):
(WebCore::IDBTransaction::transitionedToFinishing):
(WebCore::IDBTransaction::abort):
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::activeDOMObjectName):
(WebCore::IDBTransaction::canSuspendForDocumentSuspension):
(WebCore::IDBTransaction::hasPendingActivity):
(WebCore::IDBTransaction::stop):
(WebCore::IDBTransaction::isActive):
(WebCore::IDBTransaction::isFinishedOrFinishing):
(WebCore::IDBTransaction::addRequest):
(WebCore::IDBTransaction::removeRequest):
(WebCore::IDBTransaction::scheduleOperation):
(WebCore::IDBTransaction::scheduleOperationTimer):
(WebCore::IDBTransaction::operationTimerFired):
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::commitOnServer):
(WebCore::IDBTransaction::finishAbortOrCommit):
(WebCore::IDBTransaction::didStart):
(WebCore::IDBTransaction::notifyDidAbort):
(WebCore::IDBTransaction::didAbort):
(WebCore::IDBTransaction::didCommit):
(WebCore::IDBTransaction::fireOnComplete):
(WebCore::IDBTransaction::fireOnAbort):
(WebCore::IDBTransaction::enqueueEvent):
(WebCore::IDBTransaction::dispatchEvent):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::createObjectStoreOnServer):
(WebCore::IDBTransaction::didCreateObjectStoreOnServer):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::createIndexOnServer):
(WebCore::IDBTransaction::didCreateIndexOnServer):
(WebCore::IDBTransaction::requestOpenCursor):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::openCursorOnServer):
(WebCore::IDBTransaction::didOpenCursorOnServer):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::iterateCursorOnServer):
(WebCore::IDBTransaction::didIterateCursorOnServer):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestGetValue):
(WebCore::IDBTransaction::requestGetKey):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::getRecordOnServer):
(WebCore::IDBTransaction::didGetRecordOnServer):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::getCountOnServer):
(WebCore::IDBTransaction::didGetCountOnServer):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::deleteRecordOnServer):
(WebCore::IDBTransaction::didDeleteRecordOnServer):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::clearObjectStoreOnServer):
(WebCore::IDBTransaction::didClearObjectStoreOnServer):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::putOrAddOnServer):
(WebCore::IDBTransaction::didPutOrAddOnServer):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteObjectStoreOnServer):
(WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
(WebCore::IDBTransaction::deleteIndex):
(WebCore::IDBTransaction::deleteIndexOnServer):
(WebCore::IDBTransaction::didDeleteIndexOnServer):
(WebCore::IDBTransaction::operationDidComplete):
(WebCore::IDBTransaction::establishOnServer):
(WebCore::IDBTransaction::activate):
(WebCore::IDBTransaction::deactivate):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBCursorcpp">trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabasecpp">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBDatabaseh">trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBIndexcpp">trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp">trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequestcpp">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBRequesth">trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBTransactioncpp">trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/ChangeLog        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -1,3 +1,209 @@
</span><ins>+2016-05-04 Brady Eidson <beidson@apple.com>
+
+ Modern IDB: Add thread identifiers and assertions to IDB DOM objects.
+ https://bugs.webkit.org/show_bug.cgi?id=157329
+
+ Reviewed by Alex Christensen.
+
+ No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
+
+ * Modules/indexeddb/IDBCursor.cpp:
+ (WebCore::IDBCursor::IDBCursor):
+ (WebCore::IDBCursor::~IDBCursor):
+ (WebCore::IDBCursor::sourcesDeleted):
+ (WebCore::IDBCursor::transaction):
+ (WebCore::IDBCursor::direction):
+ (WebCore::IDBCursor::update):
+ (WebCore::IDBCursor::advance):
+ (WebCore::IDBCursor::continueFunction):
+ (WebCore::IDBCursor::uncheckedIterateCursor):
+ (WebCore::IDBCursor::deleteFunction):
+ (WebCore::IDBCursor::setGetResult):
+
+ * Modules/indexeddb/IDBDatabase.cpp:
+ (WebCore::IDBDatabase::~IDBDatabase):
+ (WebCore::IDBDatabase::hasPendingActivity):
+ (WebCore::IDBDatabase::name):
+ (WebCore::IDBDatabase::version):
+ (WebCore::IDBDatabase::objectStoreNames):
+ (WebCore::IDBDatabase::createObjectStore):
+ (WebCore::IDBDatabase::transaction):
+ (WebCore::IDBDatabase::deleteObjectStore):
+ (WebCore::IDBDatabase::close):
+ (WebCore::IDBDatabase::maybeCloseInServer):
+ (WebCore::IDBDatabase::activeDOMObjectName):
+ (WebCore::IDBDatabase::canSuspendForDocumentSuspension):
+ (WebCore::IDBDatabase::stop):
+ (WebCore::IDBDatabase::startVersionChangeTransaction):
+ (WebCore::IDBDatabase::didStartTransaction):
+ (WebCore::IDBDatabase::willCommitTransaction):
+ (WebCore::IDBDatabase::didCommitTransaction):
+ (WebCore::IDBDatabase::willAbortTransaction):
+ (WebCore::IDBDatabase::didAbortTransaction):
+ (WebCore::IDBDatabase::didCommitOrAbortTransaction):
+ (WebCore::IDBDatabase::fireVersionChangeEvent):
+ (WebCore::IDBDatabase::dispatchEvent):
+ (WebCore::IDBDatabase::didCreateIndexInfo):
+ (WebCore::IDBDatabase::didDeleteIndexInfo):
+ * Modules/indexeddb/IDBDatabase.h:
+ (WebCore::IDBDatabase::originThreadID):
+
+ * Modules/indexeddb/IDBIndex.cpp:
+ (WebCore::IDBIndex::IDBIndex):
+ (WebCore::IDBIndex::~IDBIndex):
+ (WebCore::IDBIndex::name):
+ (WebCore::IDBIndex::objectStore):
+ (WebCore::IDBIndex::keyPath):
+ (WebCore::IDBIndex::unique):
+ (WebCore::IDBIndex::multiEntry):
+ (WebCore::IDBIndex::openCursor):
+ (WebCore::IDBIndex::doCount):
+ (WebCore::IDBIndex::openKeyCursor):
+ (WebCore::IDBIndex::doGet):
+ (WebCore::IDBIndex::doGetKey):
+ (WebCore::IDBIndex::markAsDeleted):
+
+ * Modules/indexeddb/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::IDBObjectStore):
+ (WebCore::IDBObjectStore::~IDBObjectStore):
+ (WebCore::IDBObjectStore::name):
+ (WebCore::IDBObjectStore::keyPath):
+ (WebCore::IDBObjectStore::indexNames):
+ (WebCore::IDBObjectStore::transaction):
+ (WebCore::IDBObjectStore::autoIncrement):
+ (WebCore::IDBObjectStore::openCursor):
+ (WebCore::IDBObjectStore::get):
+ (WebCore::IDBObjectStore::putOrAdd):
+ (WebCore::IDBObjectStore::doDelete):
+ (WebCore::IDBObjectStore::clear):
+ (WebCore::IDBObjectStore::createIndex):
+ (WebCore::IDBObjectStore::index):
+ (WebCore::IDBObjectStore::deleteIndex):
+ (WebCore::IDBObjectStore::doCount):
+ (WebCore::IDBObjectStore::markAsDeleted):
+ (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort):
+
+ * Modules/indexeddb/IDBOpenDBRequest.cpp:
+ (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest):
+ (WebCore::IDBOpenDBRequest::onError):
+ (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish):
+ (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
+ (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
+ (WebCore::IDBOpenDBRequest::dispatchEvent):
+ (WebCore::IDBOpenDBRequest::onSuccess):
+ (WebCore::IDBOpenDBRequest::onUpgradeNeeded):
+ (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess):
+ (WebCore::IDBOpenDBRequest::requestCompleted):
+ (WebCore::IDBOpenDBRequest::requestBlocked):
+
+ * Modules/indexeddb/IDBRequest.cpp:
+ (WebCore::IDBRequest::~IDBRequest):
+ (WebCore::IDBRequest::errorCode):
+ (WebCore::IDBRequest::error):
+ (WebCore::IDBRequest::setSource):
+ (WebCore::IDBRequest::setVersionChangeTransaction):
+ (WebCore::IDBRequest::transaction):
+ (WebCore::IDBRequest::readyState):
+ (WebCore::IDBRequest::sourceObjectStoreIdentifier):
+ (WebCore::IDBRequest::sourceIndexIdentifier):
+ (WebCore::IDBRequest::requestedIndexRecordType):
+ (WebCore::IDBRequest::eventTargetInterface):
+ (WebCore::IDBRequest::activeDOMObjectName):
+ (WebCore::IDBRequest::canSuspendForDocumentSuspension):
+ (WebCore::IDBRequest::hasPendingActivity):
+ (WebCore::IDBRequest::stop):
+ (WebCore::IDBRequest::enqueueEvent):
+ (WebCore::IDBRequest::dispatchEvent):
+ (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
+ (WebCore::IDBRequest::setResult):
+ (WebCore::IDBRequest::setResultToStructuredClone):
+ (WebCore::IDBRequest::clearResult):
+ (WebCore::IDBRequest::setResultToUndefined):
+ (WebCore::IDBRequest::resultCursor):
+ (WebCore::IDBRequest::willIterateCursor):
+ (WebCore::IDBRequest::didOpenOrIterateCursor):
+ (WebCore::IDBRequest::requestCompleted):
+ (WebCore::IDBRequest::onError):
+ (WebCore::IDBRequest::onSuccess):
+ * Modules/indexeddb/IDBRequest.h:
+ (WebCore::IDBRequest::originThreadID):
+
+ * Modules/indexeddb/IDBTransaction.cpp:
+ (WebCore::IDBTransaction::IDBTransaction):
+ (WebCore::IDBTransaction::~IDBTransaction):
+ (WebCore::IDBTransaction::mode):
+ (WebCore::IDBTransaction::db):
+ (WebCore::IDBTransaction::serverConnection):
+ (WebCore::IDBTransaction::error):
+ (WebCore::IDBTransaction::objectStore):
+ (WebCore::IDBTransaction::abortDueToFailedRequest):
+ (WebCore::IDBTransaction::transitionedToFinishing):
+ (WebCore::IDBTransaction::abort):
+ (WebCore::IDBTransaction::abortOnServerAndCancelRequests):
+ (WebCore::IDBTransaction::activeDOMObjectName):
+ (WebCore::IDBTransaction::canSuspendForDocumentSuspension):
+ (WebCore::IDBTransaction::hasPendingActivity):
+ (WebCore::IDBTransaction::stop):
+ (WebCore::IDBTransaction::isActive):
+ (WebCore::IDBTransaction::isFinishedOrFinishing):
+ (WebCore::IDBTransaction::addRequest):
+ (WebCore::IDBTransaction::removeRequest):
+ (WebCore::IDBTransaction::scheduleOperation):
+ (WebCore::IDBTransaction::scheduleOperationTimer):
+ (WebCore::IDBTransaction::operationTimerFired):
+ (WebCore::IDBTransaction::commit):
+ (WebCore::IDBTransaction::commitOnServer):
+ (WebCore::IDBTransaction::finishAbortOrCommit):
+ (WebCore::IDBTransaction::didStart):
+ (WebCore::IDBTransaction::notifyDidAbort):
+ (WebCore::IDBTransaction::didAbort):
+ (WebCore::IDBTransaction::didCommit):
+ (WebCore::IDBTransaction::fireOnComplete):
+ (WebCore::IDBTransaction::fireOnAbort):
+ (WebCore::IDBTransaction::enqueueEvent):
+ (WebCore::IDBTransaction::dispatchEvent):
+ (WebCore::IDBTransaction::createObjectStore):
+ (WebCore::IDBTransaction::createObjectStoreOnServer):
+ (WebCore::IDBTransaction::didCreateObjectStoreOnServer):
+ (WebCore::IDBTransaction::createIndex):
+ (WebCore::IDBTransaction::createIndexOnServer):
+ (WebCore::IDBTransaction::didCreateIndexOnServer):
+ (WebCore::IDBTransaction::requestOpenCursor):
+ (WebCore::IDBTransaction::doRequestOpenCursor):
+ (WebCore::IDBTransaction::openCursorOnServer):
+ (WebCore::IDBTransaction::didOpenCursorOnServer):
+ (WebCore::IDBTransaction::iterateCursor):
+ (WebCore::IDBTransaction::iterateCursorOnServer):
+ (WebCore::IDBTransaction::didIterateCursorOnServer):
+ (WebCore::IDBTransaction::requestGetRecord):
+ (WebCore::IDBTransaction::requestGetValue):
+ (WebCore::IDBTransaction::requestGetKey):
+ (WebCore::IDBTransaction::requestIndexRecord):
+ (WebCore::IDBTransaction::getRecordOnServer):
+ (WebCore::IDBTransaction::didGetRecordOnServer):
+ (WebCore::IDBTransaction::requestCount):
+ (WebCore::IDBTransaction::getCountOnServer):
+ (WebCore::IDBTransaction::didGetCountOnServer):
+ (WebCore::IDBTransaction::requestDeleteRecord):
+ (WebCore::IDBTransaction::deleteRecordOnServer):
+ (WebCore::IDBTransaction::didDeleteRecordOnServer):
+ (WebCore::IDBTransaction::requestClearObjectStore):
+ (WebCore::IDBTransaction::clearObjectStoreOnServer):
+ (WebCore::IDBTransaction::didClearObjectStoreOnServer):
+ (WebCore::IDBTransaction::requestPutOrAdd):
+ (WebCore::IDBTransaction::putOrAddOnServer):
+ (WebCore::IDBTransaction::didPutOrAddOnServer):
+ (WebCore::IDBTransaction::deleteObjectStore):
+ (WebCore::IDBTransaction::deleteObjectStoreOnServer):
+ (WebCore::IDBTransaction::didDeleteObjectStoreOnServer):
+ (WebCore::IDBTransaction::deleteIndex):
+ (WebCore::IDBTransaction::deleteIndexOnServer):
+ (WebCore::IDBTransaction::didDeleteIndexOnServer):
+ (WebCore::IDBTransaction::operationDidComplete):
+ (WebCore::IDBTransaction::establishOnServer):
+ (WebCore::IDBTransaction::activate):
+ (WebCore::IDBTransaction::deactivate):
+
</ins><span class="cx"> 2016-05-05 Nan Wang <n_wang@apple.com>
</span><span class="cx">
</span><span class="cx"> For keyboard users, activating a fragment URL should transfer focus and caret to the destination
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "ExceptionCode.h"
</span><span class="cx"> #include "IDBBindingUtilities.h"
</span><ins>+#include "IDBDatabase.h"
</ins><span class="cx"> #include "IDBDatabaseException.h"
</span><span class="cx"> #include "IDBGetResult.h"
</span><span class="cx"> #include "IDBIndex.h"
</span><span class="lines">@@ -116,6 +117,8 @@
</span><span class="cx"> , m_info(info)
</span><span class="cx"> , m_objectStore(&objectStore)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
+
</ins><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -124,15 +127,20 @@
</span><span class="cx"> , m_info(info)
</span><span class="cx"> , m_index(&index)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
+
</ins><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBCursor::~IDBCursor()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBCursor::sourcesDeleted() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
+
</ins><span class="cx"> if (m_objectStore)
</span><span class="cx"> return m_objectStore->isDeleted();
</span><span class="cx">
</span><span class="lines">@@ -151,17 +159,20 @@
</span><span class="cx">
</span><span class="cx"> IDBTransaction& IDBCursor::transaction() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx"> return effectiveObjectStore().modernTransaction();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String& IDBCursor::direction() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx"> return directionToString(m_info.cursorDirection());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<WebCore::IDBRequest> IDBCursor::update(ExecState& exec, JSValue value, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBCursor::update");
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (sourcesDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -220,6 +231,7 @@
</span><span class="cx"> void IDBCursor::advance(unsigned count, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBCursor::advance");
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!m_request) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -267,6 +279,7 @@
</span><span class="cx"> void IDBCursor::continueFunction(const IDBKeyData& key, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBCursor::continueFunction (to key %s)", key.loggingString().utf8().data());
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!m_request) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -316,6 +329,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBCursor::uncheckedIterateCursor(const IDBKeyData& key, unsigned count)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
+
</ins><span class="cx"> ++m_outstandingRequestCount;
</span><span class="cx">
</span><span class="cx"> m_request->willIterateCursor(*this);
</span><span class="lines">@@ -325,6 +340,7 @@
</span><span class="cx"> RefPtr<WebCore::IDBRequest> IDBCursor::deleteFunction(ScriptExecutionContext& context, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBCursor::deleteFunction");
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (sourcesDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -370,6 +386,7 @@
</span><span class="cx"> void IDBCursor::setGetResult(IDBRequest& request, const IDBGetResult& getResult)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBCursor::setGetResult - current key %s", getResult.keyData().loggingString().substring(0, 100).utf8().data());
</span><ins>+ ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> auto* context = request.scriptExecutionContext();
</span><span class="cx"> if (!context)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -62,26 +62,32 @@
</span><span class="cx">
</span><span class="cx"> IDBDatabase::~IDBDatabase()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> m_connectionProxy->connectionToServer().unregisterDatabaseConnection(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBDatabase::hasPendingActivity() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return !m_closedInServer;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String IDBDatabase::name() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return m_info.name();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> uint64_t IDBDatabase::version() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return m_info.version();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<DOMStringList> IDBDatabase::objectStoreNames() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> RefPtr<DOMStringList> objectStoreNames = DOMStringList::create();
</span><span class="cx"> for (auto& name : m_info.objectStoreNames())
</span><span class="cx"> objectStoreNames->append(name);
</span><span class="lines">@@ -99,6 +105,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::createObjectStore - (%s %s)", m_info.name().utf8().data(), name.utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(!m_versionChangeTransaction || m_versionChangeTransaction->isVersionChange());
</span><span class="cx">
</span><span class="cx"> if (!m_versionChangeTransaction) {
</span><span class="lines">@@ -144,6 +151,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::transaction");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_closePending) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'transaction' on 'IDBDatabase': The database connection is closing.");
</span><span class="lines">@@ -193,6 +202,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& objectStore, const String& mode, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> Vector<String> objectStores(1);
</span><span class="cx"> objectStores[0] = objectStore;
</span><span class="cx"> return transaction(context, objectStores, mode, ec);
</span><span class="lines">@@ -202,6 +213,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::deleteObjectStore");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (!m_versionChangeTransaction) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'deleteObjectStore' on 'IDBDatabase': The database is not running a version change transaction.");
</span><span class="lines">@@ -227,6 +240,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::close - %" PRIu64, m_databaseConnectionIdentifier);
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> m_closePending = true;
</span><span class="cx"> maybeCloseInServer();
</span><span class="cx"> }
</span><span class="lines">@@ -235,6 +250,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::maybeCloseInServer - %" PRIu64, m_databaseConnectionIdentifier);
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_closedInServer)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -250,11 +267,14 @@
</span><span class="cx">
</span><span class="cx"> const char* IDBDatabase::activeDOMObjectName() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return "IDBDatabase";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBDatabase::canSuspendForDocumentSuspension() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> // FIXME: This value will sometimes be false when database operations are actually in progress.
</span><span class="cx"> // Such database operations do not yet exist.
</span><span class="cx"> return true;
</span><span class="lines">@@ -264,6 +284,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::stop - %" PRIu64, m_databaseConnectionIdentifier);
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> Vector<IDBResourceIdentifier> transactionIdentifiers;
</span><span class="cx"> transactionIdentifiers.reserveInitialCapacity(m_activeTransactions.size());
</span><span class="cx">
</span><span class="lines">@@ -283,6 +305,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::startVersionChangeTransaction %s", info.identifier().loggingString().utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(!m_versionChangeTransaction);
</span><span class="cx"> ASSERT(info.mode() == IndexedDB::TransactionMode::VersionChange);
</span><span class="cx"> ASSERT(!m_closePending);
</span><span class="lines">@@ -300,6 +323,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::didStartTransaction %s", transaction.info().identifier().loggingString().utf8().data());
</span><span class="cx"> ASSERT(!m_versionChangeTransaction);
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx">
</span><span class="cx"> // It is possible for the client to have aborted a transaction before the server replies back that it has started.
</span><span class="cx"> if (m_abortingTransactions.contains(transaction.info().identifier()))
</span><span class="lines">@@ -312,6 +336,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::willCommitTransaction %s", transaction.info().identifier().loggingString().utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto refTransaction = m_activeTransactions.take(transaction.info().identifier());
</span><span class="cx"> ASSERT(refTransaction);
</span><span class="cx"> m_committingTransactions.set(transaction.info().identifier(), WTFMove(refTransaction));
</span><span class="lines">@@ -321,6 +347,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::didCommitTransaction %s", transaction.info().identifier().loggingString().utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_versionChangeTransaction == &transaction)
</span><span class="cx"> m_info.setVersion(transaction.info().newVersion());
</span><span class="cx">
</span><span class="lines">@@ -331,6 +359,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::willAbortTransaction %s", transaction.info().identifier().loggingString().utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto refTransaction = m_activeTransactions.take(transaction.info().identifier());
</span><span class="cx"> if (!refTransaction)
</span><span class="cx"> refTransaction = m_committingTransactions.take(transaction.info().identifier());
</span><span class="lines">@@ -349,6 +379,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::didAbortTransaction %s", transaction.info().identifier().loggingString().utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (transaction.isVersionChange()) {
</span><span class="cx"> ASSERT(transaction.originalDatabaseInfo());
</span><span class="cx"> ASSERT(m_info.version() == transaction.originalDatabaseInfo()->version());
</span><span class="lines">@@ -363,6 +395,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::didCommitOrAbortTransaction %s", transaction.info().identifier().loggingString().utf8().data());
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_versionChangeTransaction == &transaction)
</span><span class="cx"> m_versionChangeTransaction = nullptr;
</span><span class="cx">
</span><span class="lines">@@ -391,6 +425,8 @@
</span><span class="cx"> uint64_t currentVersion = m_info.version();
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::fireVersionChangeEvent - current version %" PRIu64 ", requested version %" PRIu64 ", connection %" PRIu64, currentVersion, requestedVersion, m_databaseConnectionIdentifier);
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (!scriptExecutionContext() || m_closePending) {
</span><span class="cx"> serverConnection().didFireVersionChangeEvent(m_databaseConnectionIdentifier, requestIdentifier);
</span><span class="cx"> return;
</span><span class="lines">@@ -404,6 +440,7 @@
</span><span class="cx"> bool IDBDatabase::dispatchEvent(Event& event)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBDatabase::dispatchEvent (%" PRIu64 ")", m_databaseConnectionIdentifier);
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx">
</span><span class="cx"> bool result = EventTargetWithInlineData::dispatchEvent(event);
</span><span class="cx">
</span><span class="lines">@@ -415,6 +452,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBDatabase::didCreateIndexInfo(const IDBIndexInfo& info)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier());
</span><span class="cx"> ASSERT(objectStore);
</span><span class="cx"> objectStore->addExistingIndex(info);
</span><span class="lines">@@ -422,6 +461,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBDatabase::didDeleteIndexInfo(const IDBIndexInfo& info)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier());
</span><span class="cx"> ASSERT(objectStore);
</span><span class="cx"> objectStore->deleteIndex(info.name());
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBDatabaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -101,6 +101,8 @@
</span><span class="cx">
</span><span class="cx"> bool hasPendingActivity() const final;
</span><span class="cx">
</span><ins>+ ThreadIdentifier originThreadID() const { return m_originThreadID; }
+
</ins><span class="cx"> private:
</span><span class="cx"> IDBDatabase(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBResultData&);
</span><span class="cx">
</span><span class="lines">@@ -119,6 +121,8 @@
</span><span class="cx"> HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_activeTransactions;
</span><span class="cx"> HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_committingTransactions;
</span><span class="cx"> HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_abortingTransactions;
</span><ins>+
+ ThreadIdentifier m_originThreadID { currentThread() };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBIndexcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx">
</span><span class="cx"> #include "IDBBindingUtilities.h"
</span><span class="cx"> #include "IDBCursor.h"
</span><ins>+#include "IDBDatabase.h"
</ins><span class="cx"> #include "IDBDatabaseException.h"
</span><span class="cx"> #include "IDBKeyRangeData.h"
</span><span class="cx"> #include "IDBObjectStore.h"
</span><span class="lines">@@ -46,11 +47,14 @@
</span><span class="cx"> , m_info(info)
</span><span class="cx"> , m_objectStore(objectStore)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
+
</ins><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBIndex::~IDBIndex()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const char* IDBIndex::activeDOMObjectName() const
</span><span class="lines">@@ -70,32 +74,38 @@
</span><span class="cx">
</span><span class="cx"> const String& IDBIndex::name() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx"> return m_info.name();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBObjectStore> IDBIndex::objectStore()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx"> return &m_objectStore;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const IDBKeyPath& IDBIndex::keyPath() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx"> return m_info.keyPath();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBIndex::unique() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx"> return m_info.unique();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBIndex::multiEntry() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx"> return m_info.multiEntry();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext& context, IDBKeyRange* range, const String& directionString, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::openCursor");
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (m_deleted || m_objectStore.isDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -128,6 +138,8 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext& context, JSValue key, const String& direction, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::openCursor");
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
+
</ins><span class="cx"> RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code);
</span><span class="cx"> if (ec.code) {
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'openCursor' on 'IDBIndex': The parameter is not a valid key.");
</span><span class="lines">@@ -160,6 +172,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBIndex::doCount(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
+
</ins><span class="cx"> if (m_deleted || m_objectStore.isDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'count' on 'IDBIndex': The index or its object store has been deleted.");
</span><span class="lines">@@ -184,6 +198,7 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext& context, IDBKeyRange* range, const String& directionString, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBIndex::openKeyCursor");
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (m_deleted || m_objectStore.isDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -241,6 +256,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBIndex::doGet(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
+
</ins><span class="cx"> if (m_deleted || m_objectStore.isDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'get' on 'IDBIndex': The index or its object store has been deleted.");
</span><span class="lines">@@ -285,6 +302,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBIndex::doGetKey(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
+
</ins><span class="cx"> if (m_deleted || m_objectStore.isDeleted()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="cx"> ec.message = ASCIILiteral("Failed to execute 'getKey' on 'IDBIndex': The index or its object store has been deleted.");
</span><span class="lines">@@ -308,6 +327,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBIndex::markAsDeleted()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID());
+
</ins><span class="cx"> ASSERT(!m_deleted);
</span><span class="cx"> m_deleted = true;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBObjectStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -63,11 +63,14 @@
</span><span class="cx"> , m_originalInfo(info)
</span><span class="cx"> , m_transaction(transaction)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
+
</ins><span class="cx"> suspendIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBObjectStore::~IDBObjectStore()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const char* IDBObjectStore::activeDOMObjectName() const
</span><span class="lines">@@ -87,16 +90,20 @@
</span><span class="cx">
</span><span class="cx"> const String& IDBObjectStore::name() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx"> return m_info.name();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const IDBKeyPath& IDBObjectStore::keyPath() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx"> return m_info.keyPath();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<DOMStringList> IDBObjectStore::indexNames() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
+
</ins><span class="cx"> RefPtr<DOMStringList> indexNames = DOMStringList::create();
</span><span class="cx"> for (auto& name : m_info.indexNames())
</span><span class="cx"> indexNames->append(name);
</span><span class="lines">@@ -107,17 +114,20 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBTransaction> IDBObjectStore::transaction()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());\
</ins><span class="cx"> return &m_transaction.get();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBObjectStore::autoIncrement() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx"> return m_info.autoIncrement();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext& context, IDBKeyRange* range, const String& directionString, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::openCursor");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (m_deleted) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -154,6 +164,7 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext& context, JSValue key, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::get");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!m_transaction->isActive()) {
</span><span class="cx"> ec.code = IDBDatabaseException::TransactionInactiveError;
</span><span class="lines">@@ -181,6 +192,7 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext& context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::get");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!m_transaction->isActive()) {
</span><span class="cx"> ec.code = IDBDatabaseException::TransactionInactiveError;
</span><span class="lines">@@ -227,6 +239,7 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::putOrAdd(ExecState& state, JSValue value, RefPtr<IDBKey> key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::putOrAdd");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> auto context = scriptExecutionContextFromExecState(&state);
</span><span class="cx"> if (!context) {
</span><span class="lines">@@ -337,6 +350,7 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::doDelete(ScriptExecutionContext& context, IDBKeyRange* keyRange, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::deleteFunction");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx"> // the exception for an object store being deleted.
</span><span class="lines">@@ -392,6 +406,7 @@
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::clear(ScriptExecutionContext& context, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::clear");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx"> // the exception for an object store being deleted.
</span><span class="lines">@@ -423,6 +438,7 @@
</span><span class="cx"> RefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext&, const String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::createIndex %s", name.utf8().data());
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (m_deleted) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -481,6 +497,7 @@
</span><span class="cx"> RefPtr<IDBIndex> IDBObjectStore::index(const String& indexName, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::index");
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!scriptExecutionContext())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -519,6 +536,7 @@
</span><span class="cx"> void IDBObjectStore::deleteIndex(const String& name, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBObjectStore::deleteIndex %s", name.utf8().data());
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (m_deleted) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -585,6 +603,8 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<IDBRequest> IDBObjectStore::doCount(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
+
</ins><span class="cx"> // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before
</span><span class="cx"> // the exception for an object store being deleted.
</span><span class="cx"> // However, a handful of W3C IDB tests expect the deleted exception even though the transaction inactive exception also applies.
</span><span class="lines">@@ -612,11 +632,13 @@
</span><span class="cx">
</span><span class="cx"> void IDBObjectStore::markAsDeleted()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx"> m_deleted = true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBObjectStore::rollbackInfoForVersionChangeAbort()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_transaction->database().originThreadID());
</ins><span class="cx"> m_info = m_originalInfo;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBOpenDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -62,16 +62,21 @@
</span><span class="cx">
</span><span class="cx"> IDBOpenDBRequest::~IDBOpenDBRequest()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBOpenDBRequest::onError(const IDBResultData& data)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> m_domError = DOMError::create(data.error().name(), data.error().message());
</span><span class="cx"> enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBOpenDBRequest::versionChangeTransactionDidFinish()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> // 3.3.7 "versionchange" transaction steps
</span><span class="cx"> // When the transaction is finished, after firing complete/abort on the transaction, immediately set request's transaction property to null.
</span><span class="cx"> m_shouldExposeTransactionToDOM = false;
</span><span class="lines">@@ -81,6 +86,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit()");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == originThreadID());
</ins><span class="cx"> ASSERT(hasPendingActivity());
</span><span class="cx"> m_transaction->addRequest(*this);
</span><span class="cx">
</span><span class="lines">@@ -94,6 +100,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion()");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == originThreadID());
</ins><span class="cx"> ASSERT(hasPendingActivity());
</span><span class="cx">
</span><span class="cx"> IDBError idbError(IDBDatabaseException::AbortError);
</span><span class="lines">@@ -106,6 +113,8 @@
</span><span class="cx">
</span><span class="cx"> bool IDBOpenDBRequest::dispatchEvent(Event& event)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> bool result = IDBRequest::dispatchEvent(event);
</span><span class="cx">
</span><span class="cx"> if (m_transaction && m_transaction->isVersionChange() && (event.type() == eventNames().errorEvent || event.type() == eventNames().successEvent))
</span><span class="lines">@@ -118,6 +127,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::onSuccess()");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> setResult(IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData));
</span><span class="cx"> m_isDone = true;
</span><span class="cx">
</span><span class="lines">@@ -126,6 +137,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBOpenDBRequest::onUpgradeNeeded(const IDBResultData& resultData)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> Ref<IDBDatabase> database = IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData);
</span><span class="cx"> Ref<IDBTransaction> transaction = database->startVersionChangeTransaction(resultData.transactionInfo(), *this);
</span><span class="cx">
</span><span class="lines">@@ -147,6 +160,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBOpenDBRequest::onDeleteDatabaseSuccess(const IDBResultData& resultData)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> uint64_t oldVersion = resultData.databaseInfo().version();
</span><span class="cx">
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::onDeleteDatabaseSuccess() - current version is %" PRIu64, oldVersion);
</span><span class="lines">@@ -161,6 +176,8 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::requestCompleted");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> // If an Open request was completed after the page has navigated, leaving this request
</span><span class="cx"> // with a stopped script execution context, we need to message back to the server so it
</span><span class="cx"> // doesn't hang waiting on a database connection or transaction that will never exist.
</span><span class="lines">@@ -199,6 +216,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBOpenDBRequest::requestBlocked(uint64_t oldVersion, uint64_t newVersion)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == originThreadID());
+
</ins><span class="cx"> LOG(IndexedDB, "IDBOpenDBRequest::requestBlocked");
</span><span class="cx"> enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, eventNames().blockedEvent));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -119,17 +119,23 @@
</span><span class="cx">
</span><span class="cx"> IDBRequest::~IDBRequest()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_cursorResult)
</span><span class="cx"> m_cursorResult->clearRequest();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned short IDBRequest::errorCode(ExceptionCode&) const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> return 0;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<DOMError> IDBRequest::error(ExceptionCodeWithMessage& ec) const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_isDone)
</span><span class="cx"> return m_domError;
</span><span class="cx">
</span><span class="lines">@@ -140,6 +146,7 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setSource(IDBCursor& cursor)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(!m_cursorRequestNotifier);
</span><span class="cx">
</span><span class="cx"> m_objectStoreSource = nullptr;
</span><span class="lines">@@ -153,6 +160,7 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setVersionChangeTransaction(IDBTransaction& transaction)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(!m_transaction);
</span><span class="cx"> ASSERT(transaction.isVersionChange());
</span><span class="cx"> ASSERT(!transaction.isFinishedOrFinishing());
</span><span class="lines">@@ -162,11 +170,14 @@
</span><span class="cx">
</span><span class="cx"> RefPtr<WebCore::IDBTransaction> IDBRequest::transaction() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return m_shouldExposeTransactionToDOM ? m_transaction : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String& IDBRequest::readyState() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> static NeverDestroyed<String> pendingString(ASCIILiteral("pending"));
</span><span class="cx"> static NeverDestroyed<String> doneString(ASCIILiteral("done"));
</span><span class="cx"> return m_isDone ? doneString : pendingString;
</span><span class="lines">@@ -174,6 +185,8 @@
</span><span class="cx">
</span><span class="cx"> uint64_t IDBRequest::sourceObjectStoreIdentifier() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_objectStoreSource)
</span><span class="cx"> return m_objectStoreSource->info().identifier();
</span><span class="cx"> if (m_indexSource)
</span><span class="lines">@@ -183,6 +196,8 @@
</span><span class="cx">
</span><span class="cx"> uint64_t IDBRequest::sourceIndexIdentifier() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (!m_indexSource)
</span><span class="cx"> return 0;
</span><span class="cx"> return m_indexSource->info().identifier();
</span><span class="lines">@@ -190,6 +205,7 @@
</span><span class="cx">
</span><span class="cx"> IndexedDB::IndexRecordType IDBRequest::requestedIndexRecordType() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(m_indexSource);
</span><span class="cx">
</span><span class="cx"> return m_requestedIndexRecordType;
</span><span class="lines">@@ -197,32 +213,40 @@
</span><span class="cx">
</span><span class="cx"> EventTargetInterface IDBRequest::eventTargetInterface() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> return IDBRequestEventTargetInterfaceType;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const char* IDBRequest::activeDOMObjectName() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> return "IDBRequest";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBRequest::canSuspendForDocumentSuspension() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBRequest::hasPendingActivity() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> return m_hasPendingActivity;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBRequest::stop()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(!m_contextStopped);
</span><span class="cx"> m_contextStopped = true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBRequest::enqueueEvent(Ref<Event>&& event)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> if (!scriptExecutionContext() || m_contextStopped)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -234,6 +258,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBRequest::dispatchEvent - %s (%p)", event.type().string().utf8().data(), this);
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(m_hasPendingActivity);
</span><span class="cx"> ASSERT(!m_contextStopped);
</span><span class="cx">
</span><span class="lines">@@ -281,12 +306,16 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBRequest::uncaughtExceptionInEventHandler");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> if (m_transaction && m_idbError.code() != IDBDatabaseException::AbortError)
</span><span class="cx"> m_transaction->abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError), ASCIILiteral("IDBTransaction will abort due to uncaught exception in an event handler")));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setResult(const IDBKeyData& keyData)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto* context = scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return;
</span><span class="lines">@@ -297,6 +326,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setResult(uint64_t number)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto* context = scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return;
</span><span class="lines">@@ -307,6 +338,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setResultToStructuredClone(const IDBValue& value)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> LOG(IndexedDB, "IDBRequest::setResultToStructuredClone");
</span><span class="cx">
</span><span class="cx"> auto* context = scriptExecutionContext();
</span><span class="lines">@@ -319,6 +352,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::clearResult()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> m_scriptResult = { };
</span><span class="cx"> m_cursorResult = nullptr;
</span><span class="cx"> m_databaseResult = nullptr;
</span><span class="lines">@@ -326,6 +361,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setResultToUndefined()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> auto* context = scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><span class="cx"> return;
</span><span class="lines">@@ -336,11 +373,14 @@
</span><span class="cx">
</span><span class="cx"> IDBCursor* IDBRequest::resultCursor()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> return m_cursorResult.get();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBRequest::willIterateCursor(IDBCursor& cursor)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(m_isDone);
</span><span class="cx"> ASSERT(scriptExecutionContext());
</span><span class="cx"> ASSERT(m_transaction);
</span><span class="lines">@@ -362,6 +402,7 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::didOpenOrIterateCursor(const IDBResultData& resultData)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(m_pendingCursor);
</span><span class="cx">
</span><span class="cx"> clearResult();
</span><span class="lines">@@ -380,6 +421,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBRequest::requestCompleted(const IDBResultData& resultData)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> m_isDone = true;
</span><span class="cx">
</span><span class="cx"> m_idbError = resultData.error();
</span><span class="lines">@@ -393,7 +436,9 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBRequest::onError");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx"> ASSERT(!m_idbError.isNull());
</span><ins>+
</ins><span class="cx"> m_domError = DOMError::create(m_idbError.name(), m_idbError.message());
</span><span class="cx"> enqueueEvent(Event::create(eventNames().errorEvent, true, true));
</span><span class="cx"> }
</span><span class="lines">@@ -401,12 +446,15 @@
</span><span class="cx"> void IDBRequest::onSuccess()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBRequest::onSuccess");
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
</ins><span class="cx">
</span><span class="cx"> enqueueEvent(Event::create(eventNames().successEvent, false, false));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBRequest::setResult(Ref<IDBDatabase>&& database)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_originThreadID);
+
</ins><span class="cx"> clearResult();
</span><span class="cx"> m_databaseResult = WTFMove(database);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -104,6 +104,8 @@
</span><span class="cx">
</span><span class="cx"> bool hasPendingActivity() const final;
</span><span class="cx">
</span><ins>+ ThreadIdentifier originThreadID() const { return m_originThreadID; }
+
</ins><span class="cx"> protected:
</span><span class="cx"> IDBRequest(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&);
</span><span class="cx">
</span><span class="lines">@@ -170,6 +172,8 @@
</span><span class="cx"> std::unique_ptr<ScopeGuard> m_cursorRequestNotifier;
</span><span class="cx">
</span><span class="cx"> Ref<IDBClient::IDBConnectionProxy> m_connectionProxy;
</span><ins>+
+ ThreadIdentifier m_originThreadID { currentThread() };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBTransactioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp (200482 => 200483)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-05-05 22:11:59 UTC (rev 200482)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp        2016-05-05 22:13:58 UTC (rev 200483)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx">
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::IDBTransaction - %s", m_info.loggingString().utf8().data());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> relaxAdoptionRequirement();
</span><span class="cx">
</span><span class="lines">@@ -155,10 +156,13 @@
</span><span class="cx">
</span><span class="cx"> IDBTransaction::~IDBTransaction()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const String& IDBTransaction::mode() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> switch (m_info.mode()) {
</span><span class="cx"> case IndexedDB::TransactionMode::ReadOnly:
</span><span class="cx"> return IDBTransaction::modeReadOnly();
</span><span class="lines">@@ -173,22 +177,26 @@
</span><span class="cx">
</span><span class="cx"> WebCore::IDBDatabase* IDBTransaction::db()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return &m_database.get();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IDBClient::IDBConnectionToServer& IDBTransaction::serverConnection()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return m_database->serverConnection();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<DOMError> IDBTransaction::error() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return m_domError;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<WebCore::IDBObjectStore> IDBTransaction::objectStore(const String& objectStoreName, ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::objectStore");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!scriptExecutionContext())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -235,6 +243,8 @@
</span><span class="cx"> void IDBTransaction::abortDueToFailedRequest(DOMError& error)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::abortDueToFailedRequest");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> if (isFinishedOrFinishing())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -245,6 +255,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::transitionedToFinishing(IndexedDB::TransactionState state)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> ASSERT(!isFinishedOrFinishing());
</span><span class="cx"> m_state = state;
</span><span class="cx"> ASSERT(isFinishedOrFinishing());
</span><span class="lines">@@ -254,6 +266,7 @@
</span><span class="cx"> void IDBTransaction::abort(ExceptionCodeWithMessage& ec)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::abort");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (isFinishedOrFinishing()) {
</span><span class="cx"> ec.code = IDBDatabaseException::InvalidStateError;
</span><span class="lines">@@ -279,7 +292,7 @@
</span><span class="cx"> void IDBTransaction::abortOnServerAndCancelRequests(IDBClient::TransactionOperation& operation)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::abortOnServerAndCancelRequests");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(m_transactionOperationQueue.isEmpty());
</span><span class="cx">
</span><span class="cx"> serverConnection().abortTransaction(*this);
</span><span class="lines">@@ -297,22 +310,26 @@
</span><span class="cx">
</span><span class="cx"> const char* IDBTransaction::activeDOMObjectName() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return "IDBTransaction";
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBTransaction::canSuspendForDocumentSuspension() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBTransaction::hasPendingActivity() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return !m_contextStopped && m_state != IndexedDB::TransactionState::Finished;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::stop()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::stop");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> // IDBDatabase::stop() calls IDBTransaction::stop() for each of its active transactions.
</span><span class="cx"> // Since the order of calling ActiveDOMObject::stop() is random, we might already have been stopped.
</span><span class="lines">@@ -330,11 +347,14 @@
</span><span class="cx">
</span><span class="cx"> bool IDBTransaction::isActive() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> return m_state == IndexedDB::TransactionState::Active;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool IDBTransaction::isFinishedOrFinishing() const
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> return m_state == IndexedDB::TransactionState::Committing
</span><span class="cx"> || m_state == IndexedDB::TransactionState::Aborting
</span><span class="cx"> || m_state == IndexedDB::TransactionState::Finished;
</span><span class="lines">@@ -342,11 +362,13 @@
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::addRequest(IDBRequest& request)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> m_openRequests.add(&request);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::removeRequest(IDBRequest& request)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(m_openRequests.contains(&request));
</span><span class="cx"> m_openRequests.remove(&request);
</span><span class="cx"> }
</span><span class="lines">@@ -354,6 +376,7 @@
</span><span class="cx"> void IDBTransaction::scheduleOperation(RefPtr<IDBClient::TransactionOperation>&& operation)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!m_transactionOperationMap.contains(operation->identifier()));
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> m_transactionOperationQueue.append(operation);
</span><span class="cx"> m_transactionOperationMap.set(operation->identifier(), WTFMove(operation));
</span><span class="lines">@@ -363,6 +386,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::scheduleOperationTimer()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> if (!m_operationTimer.isActive())
</span><span class="cx"> m_operationTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="lines">@@ -370,6 +395,7 @@
</span><span class="cx"> void IDBTransaction::operationTimerFired()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::operationTimerFired (%p)", this);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!m_startedOnServer)
</span><span class="cx"> return;
</span><span class="lines">@@ -391,7 +417,7 @@
</span><span class="cx"> void IDBTransaction::commit()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::commit");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(!isFinishedOrFinishing());
</span><span class="cx">
</span><span class="cx"> transitionedToFinishing(IndexedDB::TransactionState::Committing);
</span><span class="lines">@@ -404,6 +430,8 @@
</span><span class="cx"> void IDBTransaction::commitOnServer(IDBClient::TransactionOperation& operation)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::commitOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> serverConnection().commitTransaction(*this);
</span><span class="cx">
</span><span class="cx"> ASSERT(m_transactionOperationMap.contains(operation.identifier()));
</span><span class="lines">@@ -413,12 +441,15 @@
</span><span class="cx"> void IDBTransaction::finishAbortOrCommit()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_state != IndexedDB::TransactionState::Finished);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> m_state = IndexedDB::TransactionState::Finished;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::didStart(const IDBError& error)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didStart");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> m_database->didStartTransaction(*this);
</span><span class="cx">
</span><span class="lines">@@ -436,6 +467,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::notifyDidAbort(const IDBError& error)
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> m_database->didAbortTransaction(*this);
</span><span class="cx"> m_idbError = error;
</span><span class="cx"> fireOnAbort();
</span><span class="lines">@@ -449,6 +482,7 @@
</span><span class="cx"> void IDBTransaction::didAbort(const IDBError& error)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didAbort");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (m_state == IndexedDB::TransactionState::Finished)
</span><span class="cx"> return;
</span><span class="lines">@@ -461,7 +495,7 @@
</span><span class="cx"> void IDBTransaction::didCommit(const IDBError& error)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didCommit");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(m_state == IndexedDB::TransactionState::Committing);
</span><span class="cx">
</span><span class="cx"> if (error.isNull()) {
</span><span class="lines">@@ -478,18 +512,21 @@
</span><span class="cx"> void IDBTransaction::fireOnComplete()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::fireOnComplete");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> enqueueEvent(Event::create(eventNames().completeEvent, false, false));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::fireOnAbort()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::fireOnAbort");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> enqueueEvent(Event::create(eventNames().abortEvent, true, false));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::enqueueEvent(Ref<Event>&& event)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_state != IndexedDB::TransactionState::Finished);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!scriptExecutionContext() || m_contextStopped)
</span><span class="cx"> return;
</span><span class="lines">@@ -502,6 +539,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::dispatchEvent");
</span><span class="cx">
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(scriptExecutionContext());
</span><span class="cx"> ASSERT(!m_contextStopped);
</span><span class="cx"> ASSERT(event.target() == this);
</span><span class="lines">@@ -535,6 +573,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::createObjectStore");
</span><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx"> ASSERT(scriptExecutionContext());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBObjectStore> objectStore = IDBObjectStore::create(*scriptExecutionContext(), info, *this);
</span><span class="cx"> m_referencedObjectStores.set(info.name(), &objectStore.get());
</span><span class="lines">@@ -548,7 +587,7 @@
</span><span class="cx"> void IDBTransaction::createObjectStoreOnServer(IDBClient::TransactionOperation& operation, const IDBObjectStoreInfo& info)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::createObjectStoreOnServer");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx">
</span><span class="cx"> m_database->serverConnection().createObjectStore(operation, info);
</span><span class="lines">@@ -557,7 +596,7 @@
</span><span class="cx"> void IDBTransaction::didCreateObjectStoreOnServer(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didCreateObjectStoreOnServer");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateObjectStoreSuccess || resultData.type() == IDBResultType::Error);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -565,6 +604,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::createIndex");
</span><span class="cx"> ASSERT(isVersionChange());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (!scriptExecutionContext())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -578,7 +618,7 @@
</span><span class="cx"> void IDBTransaction::createIndexOnServer(IDBClient::TransactionOperation& operation, const IDBIndexInfo& info)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::createIndexOnServer");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx">
</span><span class="cx"> m_database->serverConnection().createIndex(operation, info);
</span><span class="lines">@@ -587,6 +627,7 @@
</span><span class="cx"> void IDBTransaction::didCreateIndexOnServer(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didCreateIndexOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (resultData.type() == IDBResultType::CreateIndexSuccess)
</span><span class="cx"> return;
</span><span class="lines">@@ -604,6 +645,7 @@
</span><span class="cx"> Ref<IDBRequest> IDBTransaction::requestOpenCursor(ScriptExecutionContext& context, IDBObjectStore& objectStore, const IDBCursorInfo& info)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestOpenCursor");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> return doRequestOpenCursor(context, IDBCursorWithValue::create(*this, objectStore, info));
</span><span class="cx"> }
</span><span class="lines">@@ -611,6 +653,7 @@
</span><span class="cx"> Ref<IDBRequest> IDBTransaction::requestOpenCursor(ScriptExecutionContext& context, IDBIndex& index, const IDBCursorInfo& info)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestOpenCursor");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (info.cursorType() == IndexedDB::CursorType::KeyOnly)
</span><span class="cx"> return doRequestOpenCursor(context, IDBCursor::create(*this, index, info));
</span><span class="lines">@@ -621,6 +664,7 @@
</span><span class="cx"> Ref<IDBRequest> IDBTransaction::doRequestOpenCursor(ScriptExecutionContext& context, Ref<IDBCursor>&& cursor)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isActive());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::create(context, cursor.get(), *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -634,6 +678,7 @@
</span><span class="cx"> void IDBTransaction::openCursorOnServer(IDBClient::TransactionOperation& operation, const IDBCursorInfo& info)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::openCursorOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> m_database->serverConnection().openCursor(operation, info);
</span><span class="cx"> }
</span><span class="lines">@@ -641,6 +686,7 @@
</span><span class="cx"> void IDBTransaction::didOpenCursorOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didOpenCursorOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> request.didOpenOrIterateCursor(resultData);
</span><span class="cx"> }
</span><span class="lines">@@ -650,6 +696,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::iterateCursor");
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(cursor.request());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> addRequest(*cursor.request());
</span><span class="cx">
</span><span class="lines">@@ -660,6 +707,7 @@
</span><span class="cx"> void IDBTransaction::iterateCursorOnServer(IDBClient::TransactionOperation& operation, const IDBKeyData& key, const unsigned long& count)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::iterateCursorOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().iterateCursor(operation, key, count);
</span><span class="cx"> }
</span><span class="lines">@@ -667,6 +715,7 @@
</span><span class="cx"> void IDBTransaction::didIterateCursorOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didIterateCursorOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> request.didOpenOrIterateCursor(resultData);
</span><span class="cx"> }
</span><span class="lines">@@ -676,6 +725,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestGetRecord");
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(!keyRangeData.isNull);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -689,12 +739,16 @@
</span><span class="cx"> Ref<IDBRequest> IDBTransaction::requestGetValue(ScriptExecutionContext& context, IDBIndex& index, const IDBKeyRangeData& range)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestGetValue");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> return requestIndexRecord(context, index, IndexedDB::IndexRecordType::Value, range);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Ref<IDBRequest> IDBTransaction::requestGetKey(ScriptExecutionContext& context, IDBIndex& index, const IDBKeyRangeData& range)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestGetValue");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> return requestIndexRecord(context, index, IndexedDB::IndexRecordType::Key, range);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -703,6 +757,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestGetValue");
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(!range.isNull);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::createGet(context, index, type, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -716,6 +771,7 @@
</span><span class="cx"> void IDBTransaction::getRecordOnServer(IDBClient::TransactionOperation& operation, const IDBKeyRangeData& keyRange)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::getRecordOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().getRecord(operation, keyRange);
</span><span class="cx"> }
</span><span class="lines">@@ -723,6 +779,7 @@
</span><span class="cx"> void IDBTransaction::didGetRecordOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didGetRecordOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (resultData.type() == IDBResultType::Error) {
</span><span class="cx"> request.requestCompleted(resultData);
</span><span class="lines">@@ -753,6 +810,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestCount (IDBObjectStore)");
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(!range.isNull);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -767,6 +825,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestCount (IDBIndex)");
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(!range.isNull);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::createCount(context, index, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -779,6 +838,7 @@
</span><span class="cx"> void IDBTransaction::getCountOnServer(IDBClient::TransactionOperation& operation, const IDBKeyRangeData& keyRange)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::getCountOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().getCount(operation, keyRange);
</span><span class="cx"> }
</span><span class="lines">@@ -786,6 +846,7 @@
</span><span class="cx"> void IDBTransaction::didGetCountOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didGetCountOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> request.setResult(resultData.resultInteger());
</span><span class="cx"> request.requestCompleted(resultData);
</span><span class="lines">@@ -796,6 +857,7 @@
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestDeleteRecord");
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(!range.isNull);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -807,6 +869,7 @@
</span><span class="cx"> void IDBTransaction::deleteRecordOnServer(IDBClient::TransactionOperation& operation, const IDBKeyRangeData& keyRange)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::deleteRecordOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().deleteRecord(operation, keyRange);
</span><span class="cx"> }
</span><span class="lines">@@ -814,6 +877,7 @@
</span><span class="cx"> void IDBTransaction::didDeleteRecordOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didDeleteRecordOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> request.setResultToUndefined();
</span><span class="cx"> request.requestCompleted(resultData);
</span><span class="lines">@@ -823,6 +887,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::requestClearObjectStore");
</span><span class="cx"> ASSERT(isActive());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -837,6 +902,7 @@
</span><span class="cx"> void IDBTransaction::clearObjectStoreOnServer(IDBClient::TransactionOperation& operation, const uint64_t& objectStoreIdentifier)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::clearObjectStoreOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().clearObjectStore(operation, objectStoreIdentifier);
</span><span class="cx"> }
</span><span class="lines">@@ -844,6 +910,7 @@
</span><span class="cx"> void IDBTransaction::didClearObjectStoreOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didClearObjectStoreOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> request.setResultToUndefined();
</span><span class="cx"> request.requestCompleted(resultData);
</span><span class="lines">@@ -855,6 +922,7 @@
</span><span class="cx"> ASSERT(isActive());
</span><span class="cx"> ASSERT(!isReadOnly());
</span><span class="cx"> ASSERT(objectStore.info().autoIncrement() || key);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this);
</span><span class="cx"> addRequest(request.get());
</span><span class="lines">@@ -868,7 +936,7 @@
</span><span class="cx"> void IDBTransaction::putOrAddOnServer(IDBClient::TransactionOperation& operation, RefPtr<IDBKey> key, RefPtr<SerializedScriptValue> value, const IndexedDB::ObjectStoreOverwriteMode& overwriteMode)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::putOrAddOnServer");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(!isReadOnly());
</span><span class="cx"> ASSERT(value);
</span><span class="cx">
</span><span class="lines">@@ -897,6 +965,7 @@
</span><span class="cx"> void IDBTransaction::didPutOrAddOnServer(IDBRequest& request, const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didPutOrAddOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> if (auto* result = resultData.resultKey())
</span><span class="cx"> request.setResult(*result);
</span><span class="lines">@@ -908,7 +977,7 @@
</span><span class="cx"> void IDBTransaction::deleteObjectStore(const String& objectStoreName)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::deleteObjectStore");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx">
</span><span class="cx"> if (auto objectStore = m_referencedObjectStores.take(objectStoreName))
</span><span class="lines">@@ -922,6 +991,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::deleteObjectStoreOnServer");
</span><span class="cx"> ASSERT(isVersionChange());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().deleteObjectStore(operation, objectStoreName);
</span><span class="cx"> }
</span><span class="lines">@@ -929,13 +999,14 @@
</span><span class="cx"> void IDBTransaction::didDeleteObjectStoreOnServer(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didDeleteObjectStoreOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteObjectStoreSuccess || resultData.type() == IDBResultType::Error);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::deleteIndex(uint64_t objectStoreIdentifier, const String& indexName)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::deleteIndex");
</span><del>-
</del><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT(isVersionChange());
</span><span class="cx">
</span><span class="cx"> auto operation = IDBClient::createTransactionOperation(*this, &IDBTransaction::didDeleteIndexOnServer, &IDBTransaction::deleteIndexOnServer, objectStoreIdentifier, indexName);
</span><span class="lines">@@ -946,6 +1017,7 @@
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::deleteIndexOnServer");
</span><span class="cx"> ASSERT(isVersionChange());
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().deleteIndex(operation, objectStoreIdentifier, indexName);
</span><span class="cx"> }
</span><span class="lines">@@ -953,12 +1025,15 @@
</span><span class="cx"> void IDBTransaction::didDeleteIndexOnServer(const IDBResultData& resultData)
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::didDeleteIndexOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx"> ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteIndexSuccess || resultData.type() == IDBResultType::Error);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::operationDidComplete(IDBClient::TransactionOperation& operation)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_transactionOperationMap.get(operation.identifier()) == &operation);
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> m_transactionOperationMap.remove(operation.identifier());
</span><span class="cx">
</span><span class="cx"> scheduleOperationTimer();
</span><span class="lines">@@ -967,12 +1042,15 @@
</span><span class="cx"> void IDBTransaction::establishOnServer()
</span><span class="cx"> {
</span><span class="cx"> LOG(IndexedDB, "IDBTransaction::establishOnServer");
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
</ins><span class="cx">
</span><span class="cx"> serverConnection().establishTransaction(*this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::activate()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> if (isFinishedOrFinishing())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -981,6 +1059,8 @@
</span><span class="cx">
</span><span class="cx"> void IDBTransaction::deactivate()
</span><span class="cx"> {
</span><ins>+ ASSERT(currentThread() == m_database->originThreadID());
+
</ins><span class="cx"> if (m_state == IndexedDB::TransactionState::Active)
</span><span class="cx"> m_state = IndexedDB::TransactionState::Inactive;
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>