Changeset 200483 in webkit
- Timestamp:
- May 5, 2016, 3:13:58 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r200479 r200483 1 2016-05-04 Brady Eidson <beidson@apple.com> 2 3 Modern IDB: Add thread identifiers and assertions to IDB DOM objects. 4 https://bugs.webkit.org/show_bug.cgi?id=157329 5 6 Reviewed by Alex Christensen. 7 8 No new tests (No current change in behavior, will be tested as bug 149953 makes progress). 9 10 * Modules/indexeddb/IDBCursor.cpp: 11 (WebCore::IDBCursor::IDBCursor): 12 (WebCore::IDBCursor::~IDBCursor): 13 (WebCore::IDBCursor::sourcesDeleted): 14 (WebCore::IDBCursor::transaction): 15 (WebCore::IDBCursor::direction): 16 (WebCore::IDBCursor::update): 17 (WebCore::IDBCursor::advance): 18 (WebCore::IDBCursor::continueFunction): 19 (WebCore::IDBCursor::uncheckedIterateCursor): 20 (WebCore::IDBCursor::deleteFunction): 21 (WebCore::IDBCursor::setGetResult): 22 23 * Modules/indexeddb/IDBDatabase.cpp: 24 (WebCore::IDBDatabase::~IDBDatabase): 25 (WebCore::IDBDatabase::hasPendingActivity): 26 (WebCore::IDBDatabase::name): 27 (WebCore::IDBDatabase::version): 28 (WebCore::IDBDatabase::objectStoreNames): 29 (WebCore::IDBDatabase::createObjectStore): 30 (WebCore::IDBDatabase::transaction): 31 (WebCore::IDBDatabase::deleteObjectStore): 32 (WebCore::IDBDatabase::close): 33 (WebCore::IDBDatabase::maybeCloseInServer): 34 (WebCore::IDBDatabase::activeDOMObjectName): 35 (WebCore::IDBDatabase::canSuspendForDocumentSuspension): 36 (WebCore::IDBDatabase::stop): 37 (WebCore::IDBDatabase::startVersionChangeTransaction): 38 (WebCore::IDBDatabase::didStartTransaction): 39 (WebCore::IDBDatabase::willCommitTransaction): 40 (WebCore::IDBDatabase::didCommitTransaction): 41 (WebCore::IDBDatabase::willAbortTransaction): 42 (WebCore::IDBDatabase::didAbortTransaction): 43 (WebCore::IDBDatabase::didCommitOrAbortTransaction): 44 (WebCore::IDBDatabase::fireVersionChangeEvent): 45 (WebCore::IDBDatabase::dispatchEvent): 46 (WebCore::IDBDatabase::didCreateIndexInfo): 47 (WebCore::IDBDatabase::didDeleteIndexInfo): 48 * Modules/indexeddb/IDBDatabase.h: 49 (WebCore::IDBDatabase::originThreadID): 50 51 * Modules/indexeddb/IDBIndex.cpp: 52 (WebCore::IDBIndex::IDBIndex): 53 (WebCore::IDBIndex::~IDBIndex): 54 (WebCore::IDBIndex::name): 55 (WebCore::IDBIndex::objectStore): 56 (WebCore::IDBIndex::keyPath): 57 (WebCore::IDBIndex::unique): 58 (WebCore::IDBIndex::multiEntry): 59 (WebCore::IDBIndex::openCursor): 60 (WebCore::IDBIndex::doCount): 61 (WebCore::IDBIndex::openKeyCursor): 62 (WebCore::IDBIndex::doGet): 63 (WebCore::IDBIndex::doGetKey): 64 (WebCore::IDBIndex::markAsDeleted): 65 66 * Modules/indexeddb/IDBObjectStore.cpp: 67 (WebCore::IDBObjectStore::IDBObjectStore): 68 (WebCore::IDBObjectStore::~IDBObjectStore): 69 (WebCore::IDBObjectStore::name): 70 (WebCore::IDBObjectStore::keyPath): 71 (WebCore::IDBObjectStore::indexNames): 72 (WebCore::IDBObjectStore::transaction): 73 (WebCore::IDBObjectStore::autoIncrement): 74 (WebCore::IDBObjectStore::openCursor): 75 (WebCore::IDBObjectStore::get): 76 (WebCore::IDBObjectStore::putOrAdd): 77 (WebCore::IDBObjectStore::doDelete): 78 (WebCore::IDBObjectStore::clear): 79 (WebCore::IDBObjectStore::createIndex): 80 (WebCore::IDBObjectStore::index): 81 (WebCore::IDBObjectStore::deleteIndex): 82 (WebCore::IDBObjectStore::doCount): 83 (WebCore::IDBObjectStore::markAsDeleted): 84 (WebCore::IDBObjectStore::rollbackInfoForVersionChangeAbort): 85 86 * Modules/indexeddb/IDBOpenDBRequest.cpp: 87 (WebCore::IDBOpenDBRequest::~IDBOpenDBRequest): 88 (WebCore::IDBOpenDBRequest::onError): 89 (WebCore::IDBOpenDBRequest::versionChangeTransactionDidFinish): 90 (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): 91 (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): 92 (WebCore::IDBOpenDBRequest::dispatchEvent): 93 (WebCore::IDBOpenDBRequest::onSuccess): 94 (WebCore::IDBOpenDBRequest::onUpgradeNeeded): 95 (WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): 96 (WebCore::IDBOpenDBRequest::requestCompleted): 97 (WebCore::IDBOpenDBRequest::requestBlocked): 98 99 * Modules/indexeddb/IDBRequest.cpp: 100 (WebCore::IDBRequest::~IDBRequest): 101 (WebCore::IDBRequest::errorCode): 102 (WebCore::IDBRequest::error): 103 (WebCore::IDBRequest::setSource): 104 (WebCore::IDBRequest::setVersionChangeTransaction): 105 (WebCore::IDBRequest::transaction): 106 (WebCore::IDBRequest::readyState): 107 (WebCore::IDBRequest::sourceObjectStoreIdentifier): 108 (WebCore::IDBRequest::sourceIndexIdentifier): 109 (WebCore::IDBRequest::requestedIndexRecordType): 110 (WebCore::IDBRequest::eventTargetInterface): 111 (WebCore::IDBRequest::activeDOMObjectName): 112 (WebCore::IDBRequest::canSuspendForDocumentSuspension): 113 (WebCore::IDBRequest::hasPendingActivity): 114 (WebCore::IDBRequest::stop): 115 (WebCore::IDBRequest::enqueueEvent): 116 (WebCore::IDBRequest::dispatchEvent): 117 (WebCore::IDBRequest::uncaughtExceptionInEventHandler): 118 (WebCore::IDBRequest::setResult): 119 (WebCore::IDBRequest::setResultToStructuredClone): 120 (WebCore::IDBRequest::clearResult): 121 (WebCore::IDBRequest::setResultToUndefined): 122 (WebCore::IDBRequest::resultCursor): 123 (WebCore::IDBRequest::willIterateCursor): 124 (WebCore::IDBRequest::didOpenOrIterateCursor): 125 (WebCore::IDBRequest::requestCompleted): 126 (WebCore::IDBRequest::onError): 127 (WebCore::IDBRequest::onSuccess): 128 * Modules/indexeddb/IDBRequest.h: 129 (WebCore::IDBRequest::originThreadID): 130 131 * Modules/indexeddb/IDBTransaction.cpp: 132 (WebCore::IDBTransaction::IDBTransaction): 133 (WebCore::IDBTransaction::~IDBTransaction): 134 (WebCore::IDBTransaction::mode): 135 (WebCore::IDBTransaction::db): 136 (WebCore::IDBTransaction::serverConnection): 137 (WebCore::IDBTransaction::error): 138 (WebCore::IDBTransaction::objectStore): 139 (WebCore::IDBTransaction::abortDueToFailedRequest): 140 (WebCore::IDBTransaction::transitionedToFinishing): 141 (WebCore::IDBTransaction::abort): 142 (WebCore::IDBTransaction::abortOnServerAndCancelRequests): 143 (WebCore::IDBTransaction::activeDOMObjectName): 144 (WebCore::IDBTransaction::canSuspendForDocumentSuspension): 145 (WebCore::IDBTransaction::hasPendingActivity): 146 (WebCore::IDBTransaction::stop): 147 (WebCore::IDBTransaction::isActive): 148 (WebCore::IDBTransaction::isFinishedOrFinishing): 149 (WebCore::IDBTransaction::addRequest): 150 (WebCore::IDBTransaction::removeRequest): 151 (WebCore::IDBTransaction::scheduleOperation): 152 (WebCore::IDBTransaction::scheduleOperationTimer): 153 (WebCore::IDBTransaction::operationTimerFired): 154 (WebCore::IDBTransaction::commit): 155 (WebCore::IDBTransaction::commitOnServer): 156 (WebCore::IDBTransaction::finishAbortOrCommit): 157 (WebCore::IDBTransaction::didStart): 158 (WebCore::IDBTransaction::notifyDidAbort): 159 (WebCore::IDBTransaction::didAbort): 160 (WebCore::IDBTransaction::didCommit): 161 (WebCore::IDBTransaction::fireOnComplete): 162 (WebCore::IDBTransaction::fireOnAbort): 163 (WebCore::IDBTransaction::enqueueEvent): 164 (WebCore::IDBTransaction::dispatchEvent): 165 (WebCore::IDBTransaction::createObjectStore): 166 (WebCore::IDBTransaction::createObjectStoreOnServer): 167 (WebCore::IDBTransaction::didCreateObjectStoreOnServer): 168 (WebCore::IDBTransaction::createIndex): 169 (WebCore::IDBTransaction::createIndexOnServer): 170 (WebCore::IDBTransaction::didCreateIndexOnServer): 171 (WebCore::IDBTransaction::requestOpenCursor): 172 (WebCore::IDBTransaction::doRequestOpenCursor): 173 (WebCore::IDBTransaction::openCursorOnServer): 174 (WebCore::IDBTransaction::didOpenCursorOnServer): 175 (WebCore::IDBTransaction::iterateCursor): 176 (WebCore::IDBTransaction::iterateCursorOnServer): 177 (WebCore::IDBTransaction::didIterateCursorOnServer): 178 (WebCore::IDBTransaction::requestGetRecord): 179 (WebCore::IDBTransaction::requestGetValue): 180 (WebCore::IDBTransaction::requestGetKey): 181 (WebCore::IDBTransaction::requestIndexRecord): 182 (WebCore::IDBTransaction::getRecordOnServer): 183 (WebCore::IDBTransaction::didGetRecordOnServer): 184 (WebCore::IDBTransaction::requestCount): 185 (WebCore::IDBTransaction::getCountOnServer): 186 (WebCore::IDBTransaction::didGetCountOnServer): 187 (WebCore::IDBTransaction::requestDeleteRecord): 188 (WebCore::IDBTransaction::deleteRecordOnServer): 189 (WebCore::IDBTransaction::didDeleteRecordOnServer): 190 (WebCore::IDBTransaction::requestClearObjectStore): 191 (WebCore::IDBTransaction::clearObjectStoreOnServer): 192 (WebCore::IDBTransaction::didClearObjectStoreOnServer): 193 (WebCore::IDBTransaction::requestPutOrAdd): 194 (WebCore::IDBTransaction::putOrAddOnServer): 195 (WebCore::IDBTransaction::didPutOrAddOnServer): 196 (WebCore::IDBTransaction::deleteObjectStore): 197 (WebCore::IDBTransaction::deleteObjectStoreOnServer): 198 (WebCore::IDBTransaction::didDeleteObjectStoreOnServer): 199 (WebCore::IDBTransaction::deleteIndex): 200 (WebCore::IDBTransaction::deleteIndexOnServer): 201 (WebCore::IDBTransaction::didDeleteIndexOnServer): 202 (WebCore::IDBTransaction::operationDidComplete): 203 (WebCore::IDBTransaction::establishOnServer): 204 (WebCore::IDBTransaction::activate): 205 (WebCore::IDBTransaction::deactivate): 206 1 207 2016-05-05 Nan Wang <n_wang@apple.com> 2 208 -
trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
r200287 r200483 31 31 #include "ExceptionCode.h" 32 32 #include "IDBBindingUtilities.h" 33 #include "IDBDatabase.h" 33 34 #include "IDBDatabaseException.h" 34 35 #include "IDBGetResult.h" … … 117 118 , m_objectStore(&objectStore) 118 119 { 120 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 121 119 122 suspendIfNeeded(); 120 123 } … … 125 128 , m_index(&index) 126 129 { 130 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 131 127 132 suspendIfNeeded(); 128 133 } … … 130 135 IDBCursor::~IDBCursor() 131 136 { 137 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 132 138 } 133 139 134 140 bool IDBCursor::sourcesDeleted() const 135 141 { 142 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 143 136 144 if (m_objectStore) 137 145 return m_objectStore->isDeleted(); … … 152 160 IDBTransaction& IDBCursor::transaction() const 153 161 { 162 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 154 163 return effectiveObjectStore().modernTransaction(); 155 164 } … … 157 166 const String& IDBCursor::direction() const 158 167 { 168 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 159 169 return directionToString(m_info.cursorDirection()); 160 170 } … … 163 173 { 164 174 LOG(IndexedDB, "IDBCursor::update"); 175 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 165 176 166 177 if (sourcesDeleted()) { … … 221 232 { 222 233 LOG(IndexedDB, "IDBCursor::advance"); 234 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 223 235 224 236 if (!m_request) { … … 268 280 { 269 281 LOG(IndexedDB, "IDBCursor::continueFunction (to key %s)", key.loggingString().utf8().data()); 282 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 270 283 271 284 if (!m_request) { … … 317 330 void IDBCursor::uncheckedIterateCursor(const IDBKeyData& key, unsigned count) 318 331 { 332 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 333 319 334 ++m_outstandingRequestCount; 320 335 … … 326 341 { 327 342 LOG(IndexedDB, "IDBCursor::deleteFunction"); 343 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 328 344 329 345 if (sourcesDeleted()) { … … 371 387 { 372 388 LOG(IndexedDB, "IDBCursor::setGetResult - current key %s", getResult.keyData().loggingString().substring(0, 100).utf8().data()); 389 ASSERT(currentThread() == effectiveObjectStore().modernTransaction().database().originThreadID()); 373 390 374 391 auto* context = request.scriptExecutionContext(); -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
r200163 r200483 63 63 IDBDatabase::~IDBDatabase() 64 64 { 65 ASSERT(currentThread() == m_originThreadID); 65 66 m_connectionProxy->connectionToServer().unregisterDatabaseConnection(*this); 66 67 } … … 68 69 bool IDBDatabase::hasPendingActivity() const 69 70 { 71 ASSERT(currentThread() == m_originThreadID); 70 72 return !m_closedInServer; 71 73 } … … 73 75 const String IDBDatabase::name() const 74 76 { 77 ASSERT(currentThread() == m_originThreadID); 75 78 return m_info.name(); 76 79 } … … 78 81 uint64_t IDBDatabase::version() const 79 82 { 83 ASSERT(currentThread() == m_originThreadID); 80 84 return m_info.version(); 81 85 } … … 83 87 RefPtr<DOMStringList> IDBDatabase::objectStoreNames() const 84 88 { 89 ASSERT(currentThread() == m_originThreadID); 90 85 91 RefPtr<DOMStringList> objectStoreNames = DOMStringList::create(); 86 92 for (auto& name : m_info.objectStoreNames()) … … 100 106 LOG(IndexedDB, "IDBDatabase::createObjectStore - (%s %s)", m_info.name().utf8().data(), name.utf8().data()); 101 107 108 ASSERT(currentThread() == m_originThreadID); 102 109 ASSERT(!m_versionChangeTransaction || m_versionChangeTransaction->isVersionChange()); 103 110 … … 145 152 LOG(IndexedDB, "IDBDatabase::transaction"); 146 153 154 ASSERT(currentThread() == m_originThreadID); 155 147 156 if (m_closePending) { 148 157 ec.code = IDBDatabaseException::InvalidStateError; … … 194 203 RefPtr<WebCore::IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& objectStore, const String& mode, ExceptionCodeWithMessage& ec) 195 204 { 205 ASSERT(currentThread() == m_originThreadID); 206 196 207 Vector<String> objectStores(1); 197 208 objectStores[0] = objectStore; … … 203 214 LOG(IndexedDB, "IDBDatabase::deleteObjectStore"); 204 215 216 ASSERT(currentThread() == m_originThreadID); 217 205 218 if (!m_versionChangeTransaction) { 206 219 ec.code = IDBDatabaseException::InvalidStateError; … … 228 241 LOG(IndexedDB, "IDBDatabase::close - %" PRIu64, m_databaseConnectionIdentifier); 229 242 243 ASSERT(currentThread() == m_originThreadID); 244 230 245 m_closePending = true; 231 246 maybeCloseInServer(); … … 235 250 { 236 251 LOG(IndexedDB, "IDBDatabase::maybeCloseInServer - %" PRIu64, m_databaseConnectionIdentifier); 252 253 ASSERT(currentThread() == m_originThreadID); 237 254 238 255 if (m_closedInServer) … … 251 268 const char* IDBDatabase::activeDOMObjectName() const 252 269 { 270 ASSERT(currentThread() == m_originThreadID); 253 271 return "IDBDatabase"; 254 272 } … … 256 274 bool IDBDatabase::canSuspendForDocumentSuspension() const 257 275 { 276 ASSERT(currentThread() == m_originThreadID); 277 258 278 // FIXME: This value will sometimes be false when database operations are actually in progress. 259 279 // Such database operations do not yet exist. … … 264 284 { 265 285 LOG(IndexedDB, "IDBDatabase::stop - %" PRIu64, m_databaseConnectionIdentifier); 286 287 ASSERT(currentThread() == m_originThreadID); 266 288 267 289 Vector<IDBResourceIdentifier> transactionIdentifiers; … … 284 306 LOG(IndexedDB, "IDBDatabase::startVersionChangeTransaction %s", info.identifier().loggingString().utf8().data()); 285 307 308 ASSERT(currentThread() == m_originThreadID); 286 309 ASSERT(!m_versionChangeTransaction); 287 310 ASSERT(info.mode() == IndexedDB::TransactionMode::VersionChange); … … 301 324 LOG(IndexedDB, "IDBDatabase::didStartTransaction %s", transaction.info().identifier().loggingString().utf8().data()); 302 325 ASSERT(!m_versionChangeTransaction); 326 ASSERT(currentThread() == m_originThreadID); 303 327 304 328 // It is possible for the client to have aborted a transaction before the server replies back that it has started. … … 312 336 { 313 337 LOG(IndexedDB, "IDBDatabase::willCommitTransaction %s", transaction.info().identifier().loggingString().utf8().data()); 338 339 ASSERT(currentThread() == m_originThreadID); 314 340 315 341 auto refTransaction = m_activeTransactions.take(transaction.info().identifier()); … … 322 348 LOG(IndexedDB, "IDBDatabase::didCommitTransaction %s", transaction.info().identifier().loggingString().utf8().data()); 323 349 350 ASSERT(currentThread() == m_originThreadID); 351 324 352 if (m_versionChangeTransaction == &transaction) 325 353 m_info.setVersion(transaction.info().newVersion()); … … 331 359 { 332 360 LOG(IndexedDB, "IDBDatabase::willAbortTransaction %s", transaction.info().identifier().loggingString().utf8().data()); 361 362 ASSERT(currentThread() == m_originThreadID); 333 363 334 364 auto refTransaction = m_activeTransactions.take(transaction.info().identifier()); … … 349 379 { 350 380 LOG(IndexedDB, "IDBDatabase::didAbortTransaction %s", transaction.info().identifier().loggingString().utf8().data()); 381 382 ASSERT(currentThread() == m_originThreadID); 351 383 352 384 if (transaction.isVersionChange()) { … … 363 395 { 364 396 LOG(IndexedDB, "IDBDatabase::didCommitOrAbortTransaction %s", transaction.info().identifier().loggingString().utf8().data()); 397 398 ASSERT(currentThread() == m_originThreadID); 365 399 366 400 if (m_versionChangeTransaction == &transaction) … … 392 426 LOG(IndexedDB, "IDBDatabase::fireVersionChangeEvent - current version %" PRIu64 ", requested version %" PRIu64 ", connection %" PRIu64, currentVersion, requestedVersion, m_databaseConnectionIdentifier); 393 427 428 ASSERT(currentThread() == m_originThreadID); 429 394 430 if (!scriptExecutionContext() || m_closePending) { 395 431 serverConnection().didFireVersionChangeEvent(m_databaseConnectionIdentifier, requestIdentifier); … … 405 441 { 406 442 LOG(IndexedDB, "IDBDatabase::dispatchEvent (%" PRIu64 ")", m_databaseConnectionIdentifier); 443 ASSERT(currentThread() == m_originThreadID); 407 444 408 445 bool result = EventTargetWithInlineData::dispatchEvent(event); … … 416 453 void IDBDatabase::didCreateIndexInfo(const IDBIndexInfo& info) 417 454 { 455 ASSERT(currentThread() == m_originThreadID); 456 418 457 auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier()); 419 458 ASSERT(objectStore); … … 423 462 void IDBDatabase::didDeleteIndexInfo(const IDBIndexInfo& info) 424 463 { 464 ASSERT(currentThread() == m_originThreadID); 465 425 466 auto* objectStore = m_info.infoForExistingObjectStore(info.objectStoreIdentifier()); 426 467 ASSERT(objectStore); -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h
r199843 r200483 102 102 bool hasPendingActivity() const final; 103 103 104 ThreadIdentifier originThreadID() const { return m_originThreadID; } 105 104 106 private: 105 107 IDBDatabase(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&, const IDBResultData&); … … 120 122 HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_committingTransactions; 121 123 HashMap<IDBResourceIdentifier, RefPtr<IDBTransaction>> m_abortingTransactions; 124 125 ThreadIdentifier m_originThreadID { currentThread() }; 122 126 }; 123 127 -
trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
r200246 r200483 31 31 #include "IDBBindingUtilities.h" 32 32 #include "IDBCursor.h" 33 #include "IDBDatabase.h" 33 34 #include "IDBDatabaseException.h" 34 35 #include "IDBKeyRangeData.h" … … 47 48 , m_objectStore(objectStore) 48 49 { 50 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 51 49 52 suspendIfNeeded(); 50 53 } … … 52 55 IDBIndex::~IDBIndex() 53 56 { 57 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 54 58 } 55 59 … … 71 75 const String& IDBIndex::name() const 72 76 { 77 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 73 78 return m_info.name(); 74 79 } … … 76 81 RefPtr<IDBObjectStore> IDBIndex::objectStore() 77 82 { 83 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 78 84 return &m_objectStore; 79 85 } … … 81 87 const IDBKeyPath& IDBIndex::keyPath() const 82 88 { 89 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 83 90 return m_info.keyPath(); 84 91 } … … 86 93 bool IDBIndex::unique() const 87 94 { 95 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 88 96 return m_info.unique(); 89 97 } … … 91 99 bool IDBIndex::multiEntry() const 92 100 { 101 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 93 102 return m_info.multiEntry(); 94 103 } … … 97 106 { 98 107 LOG(IndexedDB, "IDBIndex::openCursor"); 108 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 99 109 100 110 if (m_deleted || m_objectStore.isDeleted()) { … … 129 139 { 130 140 LOG(IndexedDB, "IDBIndex::openCursor"); 141 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 142 131 143 RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(context, key, ec.code); 132 144 if (ec.code) { … … 161 173 RefPtr<IDBRequest> IDBIndex::doCount(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec) 162 174 { 175 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 176 163 177 if (m_deleted || m_objectStore.isDeleted()) { 164 178 ec.code = IDBDatabaseException::InvalidStateError; … … 185 199 { 186 200 LOG(IndexedDB, "IDBIndex::openKeyCursor"); 201 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 187 202 188 203 if (m_deleted || m_objectStore.isDeleted()) { … … 242 257 RefPtr<IDBRequest> IDBIndex::doGet(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec) 243 258 { 259 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 260 244 261 if (m_deleted || m_objectStore.isDeleted()) { 245 262 ec.code = IDBDatabaseException::InvalidStateError; … … 286 303 RefPtr<IDBRequest> IDBIndex::doGetKey(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec) 287 304 { 305 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 306 288 307 if (m_deleted || m_objectStore.isDeleted()) { 289 308 ec.code = IDBDatabaseException::InvalidStateError; … … 309 328 void IDBIndex::markAsDeleted() 310 329 { 330 ASSERT(currentThread() == m_objectStore.modernTransaction().database().originThreadID()); 331 311 332 ASSERT(!m_deleted); 312 333 m_deleted = true; -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
r200246 r200483 64 64 , m_transaction(transaction) 65 65 { 66 ASSERT(currentThread() == m_transaction->database().originThreadID()); 67 66 68 suspendIfNeeded(); 67 69 } … … 69 71 IDBObjectStore::~IDBObjectStore() 70 72 { 73 ASSERT(currentThread() == m_transaction->database().originThreadID()); 71 74 } 72 75 … … 88 91 const String& IDBObjectStore::name() const 89 92 { 93 ASSERT(currentThread() == m_transaction->database().originThreadID()); 90 94 return m_info.name(); 91 95 } … … 93 97 const IDBKeyPath& IDBObjectStore::keyPath() const 94 98 { 99 ASSERT(currentThread() == m_transaction->database().originThreadID()); 95 100 return m_info.keyPath(); 96 101 } … … 98 103 RefPtr<DOMStringList> IDBObjectStore::indexNames() const 99 104 { 105 ASSERT(currentThread() == m_transaction->database().originThreadID()); 106 100 107 RefPtr<DOMStringList> indexNames = DOMStringList::create(); 101 108 for (auto& name : m_info.indexNames()) … … 108 115 RefPtr<IDBTransaction> IDBObjectStore::transaction() 109 116 { 117 ASSERT(currentThread() == m_transaction->database().originThreadID());\ 110 118 return &m_transaction.get(); 111 119 } … … 113 121 bool IDBObjectStore::autoIncrement() const 114 122 { 123 ASSERT(currentThread() == m_transaction->database().originThreadID()); 115 124 return m_info.autoIncrement(); 116 125 } … … 119 128 { 120 129 LOG(IndexedDB, "IDBObjectStore::openCursor"); 130 ASSERT(currentThread() == m_transaction->database().originThreadID()); 121 131 122 132 if (m_deleted) { … … 155 165 { 156 166 LOG(IndexedDB, "IDBObjectStore::get"); 167 ASSERT(currentThread() == m_transaction->database().originThreadID()); 157 168 158 169 if (!m_transaction->isActive()) { … … 182 193 { 183 194 LOG(IndexedDB, "IDBObjectStore::get"); 195 ASSERT(currentThread() == m_transaction->database().originThreadID()); 184 196 185 197 if (!m_transaction->isActive()) { … … 228 240 { 229 241 LOG(IndexedDB, "IDBObjectStore::putOrAdd"); 242 ASSERT(currentThread() == m_transaction->database().originThreadID()); 230 243 231 244 auto context = scriptExecutionContextFromExecState(&state); … … 338 351 { 339 352 LOG(IndexedDB, "IDBObjectStore::deleteFunction"); 353 ASSERT(currentThread() == m_transaction->database().originThreadID()); 340 354 341 355 // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before … … 393 407 { 394 408 LOG(IndexedDB, "IDBObjectStore::clear"); 409 ASSERT(currentThread() == m_transaction->database().originThreadID()); 395 410 396 411 // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before … … 424 439 { 425 440 LOG(IndexedDB, "IDBObjectStore::createIndex %s", name.utf8().data()); 441 ASSERT(currentThread() == m_transaction->database().originThreadID()); 426 442 427 443 if (m_deleted) { … … 482 498 { 483 499 LOG(IndexedDB, "IDBObjectStore::index"); 500 ASSERT(currentThread() == m_transaction->database().originThreadID()); 484 501 485 502 if (!scriptExecutionContext()) … … 520 537 { 521 538 LOG(IndexedDB, "IDBObjectStore::deleteIndex %s", name.utf8().data()); 539 ASSERT(currentThread() == m_transaction->database().originThreadID()); 522 540 523 541 if (m_deleted) { … … 586 604 RefPtr<IDBRequest> IDBObjectStore::doCount(ScriptExecutionContext& context, const IDBKeyRangeData& range, ExceptionCodeWithMessage& ec) 587 605 { 606 ASSERT(currentThread() == m_transaction->database().originThreadID()); 607 588 608 // The IDB spec for several IDBObjectStore methods states that transaction related exceptions should fire before 589 609 // the exception for an object store being deleted. … … 613 633 void IDBObjectStore::markAsDeleted() 614 634 { 635 ASSERT(currentThread() == m_transaction->database().originThreadID()); 615 636 m_deleted = true; 616 637 } … … 618 639 void IDBObjectStore::rollbackInfoForVersionChangeAbort() 619 640 { 641 ASSERT(currentThread() == m_transaction->database().originThreadID()); 620 642 m_info = m_originalInfo; 621 643 } -
trunk/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp
r199843 r200483 63 63 IDBOpenDBRequest::~IDBOpenDBRequest() 64 64 { 65 ASSERT(currentThread() == originThreadID()); 65 66 } 66 67 67 68 void IDBOpenDBRequest::onError(const IDBResultData& data) 68 69 { 70 ASSERT(currentThread() == originThreadID()); 71 69 72 m_domError = DOMError::create(data.error().name(), data.error().message()); 70 73 enqueueEvent(IDBRequestCompletionEvent::create(eventNames().errorEvent, true, true, *this)); … … 73 76 void IDBOpenDBRequest::versionChangeTransactionDidFinish() 74 77 { 78 ASSERT(currentThread() == originThreadID()); 79 75 80 // 3.3.7 "versionchange" transaction steps 76 81 // When the transaction is finished, after firing complete/abort on the transaction, immediately set request's transaction property to null. … … 82 87 LOG(IndexedDB, "IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit()"); 83 88 89 ASSERT(currentThread() == originThreadID()); 84 90 ASSERT(hasPendingActivity()); 85 91 m_transaction->addRequest(*this); … … 95 101 LOG(IndexedDB, "IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion()"); 96 102 103 ASSERT(currentThread() == originThreadID()); 97 104 ASSERT(hasPendingActivity()); 98 105 … … 107 114 bool IDBOpenDBRequest::dispatchEvent(Event& event) 108 115 { 116 ASSERT(currentThread() == originThreadID()); 117 109 118 bool result = IDBRequest::dispatchEvent(event); 110 119 … … 119 128 LOG(IndexedDB, "IDBOpenDBRequest::onSuccess()"); 120 129 130 ASSERT(currentThread() == originThreadID()); 131 121 132 setResult(IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData)); 122 133 m_isDone = true; … … 127 138 void IDBOpenDBRequest::onUpgradeNeeded(const IDBResultData& resultData) 128 139 { 140 ASSERT(currentThread() == originThreadID()); 141 129 142 Ref<IDBDatabase> database = IDBDatabase::create(*scriptExecutionContext(), connectionProxy(), resultData); 130 143 Ref<IDBTransaction> transaction = database->startVersionChangeTransaction(resultData.transactionInfo(), *this); … … 148 161 void IDBOpenDBRequest::onDeleteDatabaseSuccess(const IDBResultData& resultData) 149 162 { 163 ASSERT(currentThread() == originThreadID()); 164 150 165 uint64_t oldVersion = resultData.databaseInfo().version(); 151 166 … … 161 176 { 162 177 LOG(IndexedDB, "IDBOpenDBRequest::requestCompleted"); 178 179 ASSERT(currentThread() == originThreadID()); 163 180 164 181 // If an Open request was completed after the page has navigated, leaving this request … … 200 217 void IDBOpenDBRequest::requestBlocked(uint64_t oldVersion, uint64_t newVersion) 201 218 { 219 ASSERT(currentThread() == originThreadID()); 220 202 221 LOG(IndexedDB, "IDBOpenDBRequest::requestBlocked"); 203 222 enqueueEvent(IDBVersionChangeEvent::create(oldVersion, newVersion, eventNames().blockedEvent)); -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
r199843 r200483 120 120 IDBRequest::~IDBRequest() 121 121 { 122 ASSERT(currentThread() == m_originThreadID); 123 122 124 if (m_cursorResult) 123 125 m_cursorResult->clearRequest(); … … 126 128 unsigned short IDBRequest::errorCode(ExceptionCode&) const 127 129 { 130 ASSERT(currentThread() == m_originThreadID); 131 128 132 return 0; 129 133 } … … 131 135 RefPtr<DOMError> IDBRequest::error(ExceptionCodeWithMessage& ec) const 132 136 { 137 ASSERT(currentThread() == m_originThreadID); 138 133 139 if (m_isDone) 134 140 return m_domError; … … 141 147 void IDBRequest::setSource(IDBCursor& cursor) 142 148 { 149 ASSERT(currentThread() == m_originThreadID); 143 150 ASSERT(!m_cursorRequestNotifier); 144 151 … … 154 161 void IDBRequest::setVersionChangeTransaction(IDBTransaction& transaction) 155 162 { 163 ASSERT(currentThread() == m_originThreadID); 156 164 ASSERT(!m_transaction); 157 165 ASSERT(transaction.isVersionChange()); … … 163 171 RefPtr<WebCore::IDBTransaction> IDBRequest::transaction() const 164 172 { 173 ASSERT(currentThread() == m_originThreadID); 165 174 return m_shouldExposeTransactionToDOM ? m_transaction : nullptr; 166 175 } … … 168 177 const String& IDBRequest::readyState() const 169 178 { 179 ASSERT(currentThread() == m_originThreadID); 180 170 181 static NeverDestroyed<String> pendingString(ASCIILiteral("pending")); 171 182 static NeverDestroyed<String> doneString(ASCIILiteral("done")); … … 175 186 uint64_t IDBRequest::sourceObjectStoreIdentifier() const 176 187 { 188 ASSERT(currentThread() == m_originThreadID); 189 177 190 if (m_objectStoreSource) 178 191 return m_objectStoreSource->info().identifier(); … … 184 197 uint64_t IDBRequest::sourceIndexIdentifier() const 185 198 { 199 ASSERT(currentThread() == m_originThreadID); 200 186 201 if (!m_indexSource) 187 202 return 0; … … 191 206 IndexedDB::IndexRecordType IDBRequest::requestedIndexRecordType() const 192 207 { 208 ASSERT(currentThread() == m_originThreadID); 193 209 ASSERT(m_indexSource); 194 210 … … 198 214 EventTargetInterface IDBRequest::eventTargetInterface() const 199 215 { 216 ASSERT(currentThread() == m_originThreadID); 217 200 218 return IDBRequestEventTargetInterfaceType; 201 219 } … … 203 221 const char* IDBRequest::activeDOMObjectName() const 204 222 { 223 ASSERT(currentThread() == m_originThreadID); 224 205 225 return "IDBRequest"; 206 226 } … … 208 228 bool IDBRequest::canSuspendForDocumentSuspension() const 209 229 { 230 ASSERT(currentThread() == m_originThreadID); 210 231 return false; 211 232 } … … 213 234 bool IDBRequest::hasPendingActivity() const 214 235 { 236 ASSERT(currentThread() == m_originThreadID); 215 237 return m_hasPendingActivity; 216 238 } … … 218 240 void IDBRequest::stop() 219 241 { 242 ASSERT(currentThread() == m_originThreadID); 220 243 ASSERT(!m_contextStopped); 221 244 m_contextStopped = true; … … 224 247 void IDBRequest::enqueueEvent(Ref<Event>&& event) 225 248 { 249 ASSERT(currentThread() == m_originThreadID); 226 250 if (!scriptExecutionContext() || m_contextStopped) 227 251 return; … … 235 259 LOG(IndexedDB, "IDBRequest::dispatchEvent - %s (%p)", event.type().string().utf8().data(), this); 236 260 261 ASSERT(currentThread() == m_originThreadID); 237 262 ASSERT(m_hasPendingActivity); 238 263 ASSERT(!m_contextStopped); … … 282 307 LOG(IndexedDB, "IDBRequest::uncaughtExceptionInEventHandler"); 283 308 309 ASSERT(currentThread() == m_originThreadID); 310 284 311 if (m_transaction && m_idbError.code() != IDBDatabaseException::AbortError) 285 312 m_transaction->abortDueToFailedRequest(DOMError::create(IDBDatabaseException::getErrorName(IDBDatabaseException::AbortError), ASCIILiteral("IDBTransaction will abort due to uncaught exception in an event handler"))); … … 288 315 void IDBRequest::setResult(const IDBKeyData& keyData) 289 316 { 317 ASSERT(currentThread() == m_originThreadID); 318 290 319 auto* context = scriptExecutionContext(); 291 320 if (!context) … … 298 327 void IDBRequest::setResult(uint64_t number) 299 328 { 329 ASSERT(currentThread() == m_originThreadID); 330 300 331 auto* context = scriptExecutionContext(); 301 332 if (!context) … … 308 339 void IDBRequest::setResultToStructuredClone(const IDBValue& value) 309 340 { 341 ASSERT(currentThread() == m_originThreadID); 342 310 343 LOG(IndexedDB, "IDBRequest::setResultToStructuredClone"); 311 344 … … 320 353 void IDBRequest::clearResult() 321 354 { 355 ASSERT(currentThread() == m_originThreadID); 356 322 357 m_scriptResult = { }; 323 358 m_cursorResult = nullptr; … … 327 362 void IDBRequest::setResultToUndefined() 328 363 { 364 ASSERT(currentThread() == m_originThreadID); 365 329 366 auto* context = scriptExecutionContext(); 330 367 if (!context) … … 337 374 IDBCursor* IDBRequest::resultCursor() 338 375 { 376 ASSERT(currentThread() == m_originThreadID); 377 339 378 return m_cursorResult.get(); 340 379 } … … 342 381 void IDBRequest::willIterateCursor(IDBCursor& cursor) 343 382 { 383 ASSERT(currentThread() == m_originThreadID); 344 384 ASSERT(m_isDone); 345 385 ASSERT(scriptExecutionContext()); … … 363 403 void IDBRequest::didOpenOrIterateCursor(const IDBResultData& resultData) 364 404 { 405 ASSERT(currentThread() == m_originThreadID); 365 406 ASSERT(m_pendingCursor); 366 407 … … 381 422 void IDBRequest::requestCompleted(const IDBResultData& resultData) 382 423 { 424 ASSERT(currentThread() == m_originThreadID); 425 383 426 m_isDone = true; 384 427 … … 394 437 LOG(IndexedDB, "IDBRequest::onError"); 395 438 439 ASSERT(currentThread() == m_originThreadID); 396 440 ASSERT(!m_idbError.isNull()); 441 397 442 m_domError = DOMError::create(m_idbError.name(), m_idbError.message()); 398 443 enqueueEvent(Event::create(eventNames().errorEvent, true, true)); … … 402 447 { 403 448 LOG(IndexedDB, "IDBRequest::onSuccess"); 449 ASSERT(currentThread() == m_originThreadID); 404 450 405 451 enqueueEvent(Event::create(eventNames().successEvent, false, false)); … … 408 454 void IDBRequest::setResult(Ref<IDBDatabase>&& database) 409 455 { 456 ASSERT(currentThread() == m_originThreadID); 457 410 458 clearResult(); 411 459 m_databaseResult = WTFMove(database); -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h
r199843 r200483 105 105 bool hasPendingActivity() const final; 106 106 107 ThreadIdentifier originThreadID() const { return m_originThreadID; } 108 107 109 protected: 108 110 IDBRequest(ScriptExecutionContext&, IDBClient::IDBConnectionProxy&); … … 171 173 172 174 Ref<IDBClient::IDBConnectionProxy> m_connectionProxy; 175 176 ThreadIdentifier m_originThreadID { currentThread() }; 173 177 }; 174 178 -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r200036 r200483 132 132 { 133 133 LOG(IndexedDB, "IDBTransaction::IDBTransaction - %s", m_info.loggingString().utf8().data()); 134 ASSERT(currentThread() == m_database->originThreadID()); 134 135 135 136 relaxAdoptionRequirement(); … … 156 157 IDBTransaction::~IDBTransaction() 157 158 { 159 ASSERT(currentThread() == m_database->originThreadID()); 158 160 } 159 161 160 162 const String& IDBTransaction::mode() const 161 163 { 164 ASSERT(currentThread() == m_database->originThreadID()); 165 162 166 switch (m_info.mode()) { 163 167 case IndexedDB::TransactionMode::ReadOnly: … … 174 178 WebCore::IDBDatabase* IDBTransaction::db() 175 179 { 180 ASSERT(currentThread() == m_database->originThreadID()); 176 181 return &m_database.get(); 177 182 } … … 179 184 IDBClient::IDBConnectionToServer& IDBTransaction::serverConnection() 180 185 { 186 ASSERT(currentThread() == m_database->originThreadID()); 181 187 return m_database->serverConnection(); 182 188 } … … 184 190 RefPtr<DOMError> IDBTransaction::error() const 185 191 { 192 ASSERT(currentThread() == m_database->originThreadID()); 186 193 return m_domError; 187 194 } … … 190 197 { 191 198 LOG(IndexedDB, "IDBTransaction::objectStore"); 199 ASSERT(currentThread() == m_database->originThreadID()); 192 200 193 201 if (!scriptExecutionContext()) … … 236 244 { 237 245 LOG(IndexedDB, "IDBTransaction::abortDueToFailedRequest"); 246 ASSERT(currentThread() == m_database->originThreadID()); 247 238 248 if (isFinishedOrFinishing()) 239 249 return; … … 246 256 void IDBTransaction::transitionedToFinishing(IndexedDB::TransactionState state) 247 257 { 258 ASSERT(currentThread() == m_database->originThreadID()); 259 248 260 ASSERT(!isFinishedOrFinishing()); 249 261 m_state = state; … … 255 267 { 256 268 LOG(IndexedDB, "IDBTransaction::abort"); 269 ASSERT(currentThread() == m_database->originThreadID()); 257 270 258 271 if (isFinishedOrFinishing()) { … … 280 293 { 281 294 LOG(IndexedDB, "IDBTransaction::abortOnServerAndCancelRequests"); 282 295 ASSERT(currentThread() == m_database->originThreadID()); 283 296 ASSERT(m_transactionOperationQueue.isEmpty()); 284 297 … … 298 311 const char* IDBTransaction::activeDOMObjectName() const 299 312 { 313 ASSERT(currentThread() == m_database->originThreadID()); 300 314 return "IDBTransaction"; 301 315 } … … 303 317 bool IDBTransaction::canSuspendForDocumentSuspension() const 304 318 { 319 ASSERT(currentThread() == m_database->originThreadID()); 305 320 return false; 306 321 } … … 308 323 bool IDBTransaction::hasPendingActivity() const 309 324 { 325 ASSERT(currentThread() == m_database->originThreadID()); 310 326 return !m_contextStopped && m_state != IndexedDB::TransactionState::Finished; 311 327 } … … 314 330 { 315 331 LOG(IndexedDB, "IDBTransaction::stop"); 332 ASSERT(currentThread() == m_database->originThreadID()); 316 333 317 334 // IDBDatabase::stop() calls IDBTransaction::stop() for each of its active transactions. … … 331 348 bool IDBTransaction::isActive() const 332 349 { 350 ASSERT(currentThread() == m_database->originThreadID()); 333 351 return m_state == IndexedDB::TransactionState::Active; 334 352 } … … 336 354 bool IDBTransaction::isFinishedOrFinishing() const 337 355 { 356 ASSERT(currentThread() == m_database->originThreadID()); 357 338 358 return m_state == IndexedDB::TransactionState::Committing 339 359 || m_state == IndexedDB::TransactionState::Aborting … … 343 363 void IDBTransaction::addRequest(IDBRequest& request) 344 364 { 365 ASSERT(currentThread() == m_database->originThreadID()); 345 366 m_openRequests.add(&request); 346 367 } … … 348 369 void IDBTransaction::removeRequest(IDBRequest& request) 349 370 { 371 ASSERT(currentThread() == m_database->originThreadID()); 350 372 ASSERT(m_openRequests.contains(&request)); 351 373 m_openRequests.remove(&request); … … 355 377 { 356 378 ASSERT(!m_transactionOperationMap.contains(operation->identifier())); 379 ASSERT(currentThread() == m_database->originThreadID()); 357 380 358 381 m_transactionOperationQueue.append(operation); … … 364 387 void IDBTransaction::scheduleOperationTimer() 365 388 { 389 ASSERT(currentThread() == m_database->originThreadID()); 390 366 391 if (!m_operationTimer.isActive()) 367 392 m_operationTimer.startOneShot(0); … … 371 396 { 372 397 LOG(IndexedDB, "IDBTransaction::operationTimerFired (%p)", this); 398 ASSERT(currentThread() == m_database->originThreadID()); 373 399 374 400 if (!m_startedOnServer) … … 392 418 { 393 419 LOG(IndexedDB, "IDBTransaction::commit"); 394 420 ASSERT(currentThread() == m_database->originThreadID()); 395 421 ASSERT(!isFinishedOrFinishing()); 396 422 … … 405 431 { 406 432 LOG(IndexedDB, "IDBTransaction::commitOnServer"); 433 ASSERT(currentThread() == m_database->originThreadID()); 434 407 435 serverConnection().commitTransaction(*this); 408 436 … … 414 442 { 415 443 ASSERT(m_state != IndexedDB::TransactionState::Finished); 444 ASSERT(currentThread() == m_database->originThreadID()); 445 416 446 m_state = IndexedDB::TransactionState::Finished; 417 447 } … … 420 450 { 421 451 LOG(IndexedDB, "IDBTransaction::didStart"); 452 ASSERT(currentThread() == m_database->originThreadID()); 422 453 423 454 m_database->didStartTransaction(*this); … … 437 468 void IDBTransaction::notifyDidAbort(const IDBError& error) 438 469 { 470 ASSERT(currentThread() == m_database->originThreadID()); 471 439 472 m_database->didAbortTransaction(*this); 440 473 m_idbError = error; … … 450 483 { 451 484 LOG(IndexedDB, "IDBTransaction::didAbort"); 485 ASSERT(currentThread() == m_database->originThreadID()); 452 486 453 487 if (m_state == IndexedDB::TransactionState::Finished) … … 462 496 { 463 497 LOG(IndexedDB, "IDBTransaction::didCommit"); 464 498 ASSERT(currentThread() == m_database->originThreadID()); 465 499 ASSERT(m_state == IndexedDB::TransactionState::Committing); 466 500 … … 479 513 { 480 514 LOG(IndexedDB, "IDBTransaction::fireOnComplete"); 515 ASSERT(currentThread() == m_database->originThreadID()); 481 516 enqueueEvent(Event::create(eventNames().completeEvent, false, false)); 482 517 } … … 485 520 { 486 521 LOG(IndexedDB, "IDBTransaction::fireOnAbort"); 522 ASSERT(currentThread() == m_database->originThreadID()); 487 523 enqueueEvent(Event::create(eventNames().abortEvent, true, false)); 488 524 } … … 491 527 { 492 528 ASSERT(m_state != IndexedDB::TransactionState::Finished); 529 ASSERT(currentThread() == m_database->originThreadID()); 493 530 494 531 if (!scriptExecutionContext() || m_contextStopped) … … 503 540 LOG(IndexedDB, "IDBTransaction::dispatchEvent"); 504 541 542 ASSERT(currentThread() == m_database->originThreadID()); 505 543 ASSERT(scriptExecutionContext()); 506 544 ASSERT(!m_contextStopped); … … 536 574 ASSERT(isVersionChange()); 537 575 ASSERT(scriptExecutionContext()); 576 ASSERT(currentThread() == m_database->originThreadID()); 538 577 539 578 Ref<IDBObjectStore> objectStore = IDBObjectStore::create(*scriptExecutionContext(), info, *this); … … 549 588 { 550 589 LOG(IndexedDB, "IDBTransaction::createObjectStoreOnServer"); 551 590 ASSERT(currentThread() == m_database->originThreadID()); 552 591 ASSERT(isVersionChange()); 553 592 … … 558 597 { 559 598 LOG(IndexedDB, "IDBTransaction::didCreateObjectStoreOnServer"); 560 599 ASSERT(currentThread() == m_database->originThreadID()); 561 600 ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::CreateObjectStoreSuccess || resultData.type() == IDBResultType::Error); 562 601 } … … 566 605 LOG(IndexedDB, "IDBTransaction::createIndex"); 567 606 ASSERT(isVersionChange()); 607 ASSERT(currentThread() == m_database->originThreadID()); 568 608 569 609 if (!scriptExecutionContext()) … … 579 619 { 580 620 LOG(IndexedDB, "IDBTransaction::createIndexOnServer"); 581 621 ASSERT(currentThread() == m_database->originThreadID()); 582 622 ASSERT(isVersionChange()); 583 623 … … 588 628 { 589 629 LOG(IndexedDB, "IDBTransaction::didCreateIndexOnServer"); 630 ASSERT(currentThread() == m_database->originThreadID()); 590 631 591 632 if (resultData.type() == IDBResultType::CreateIndexSuccess) … … 605 646 { 606 647 LOG(IndexedDB, "IDBTransaction::requestOpenCursor"); 648 ASSERT(currentThread() == m_database->originThreadID()); 607 649 608 650 return doRequestOpenCursor(context, IDBCursorWithValue::create(*this, objectStore, info)); … … 612 654 { 613 655 LOG(IndexedDB, "IDBTransaction::requestOpenCursor"); 656 ASSERT(currentThread() == m_database->originThreadID()); 614 657 615 658 if (info.cursorType() == IndexedDB::CursorType::KeyOnly) … … 622 665 { 623 666 ASSERT(isActive()); 667 ASSERT(currentThread() == m_database->originThreadID()); 624 668 625 669 Ref<IDBRequest> request = IDBRequest::create(context, cursor.get(), *this); … … 635 679 { 636 680 LOG(IndexedDB, "IDBTransaction::openCursorOnServer"); 681 ASSERT(currentThread() == m_database->originThreadID()); 637 682 638 683 m_database->serverConnection().openCursor(operation, info); … … 642 687 { 643 688 LOG(IndexedDB, "IDBTransaction::didOpenCursorOnServer"); 689 ASSERT(currentThread() == m_database->originThreadID()); 644 690 645 691 request.didOpenOrIterateCursor(resultData); … … 651 697 ASSERT(isActive()); 652 698 ASSERT(cursor.request()); 699 ASSERT(currentThread() == m_database->originThreadID()); 653 700 654 701 addRequest(*cursor.request()); … … 661 708 { 662 709 LOG(IndexedDB, "IDBTransaction::iterateCursorOnServer"); 710 ASSERT(currentThread() == m_database->originThreadID()); 663 711 664 712 serverConnection().iterateCursor(operation, key, count); … … 668 716 { 669 717 LOG(IndexedDB, "IDBTransaction::didIterateCursorOnServer"); 718 ASSERT(currentThread() == m_database->originThreadID()); 670 719 671 720 request.didOpenOrIterateCursor(resultData); … … 677 726 ASSERT(isActive()); 678 727 ASSERT(!keyRangeData.isNull); 728 ASSERT(currentThread() == m_database->originThreadID()); 679 729 680 730 Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this); … … 690 740 { 691 741 LOG(IndexedDB, "IDBTransaction::requestGetValue"); 742 ASSERT(currentThread() == m_database->originThreadID()); 743 692 744 return requestIndexRecord(context, index, IndexedDB::IndexRecordType::Value, range); 693 745 } … … 696 748 { 697 749 LOG(IndexedDB, "IDBTransaction::requestGetValue"); 750 ASSERT(currentThread() == m_database->originThreadID()); 751 698 752 return requestIndexRecord(context, index, IndexedDB::IndexRecordType::Key, range); 699 753 } … … 704 758 ASSERT(isActive()); 705 759 ASSERT(!range.isNull); 760 ASSERT(currentThread() == m_database->originThreadID()); 706 761 707 762 Ref<IDBRequest> request = IDBRequest::createGet(context, index, type, *this); … … 717 772 { 718 773 LOG(IndexedDB, "IDBTransaction::getRecordOnServer"); 774 ASSERT(currentThread() == m_database->originThreadID()); 719 775 720 776 serverConnection().getRecord(operation, keyRange); … … 724 780 { 725 781 LOG(IndexedDB, "IDBTransaction::didGetRecordOnServer"); 782 ASSERT(currentThread() == m_database->originThreadID()); 726 783 727 784 if (resultData.type() == IDBResultType::Error) { … … 754 811 ASSERT(isActive()); 755 812 ASSERT(!range.isNull); 813 ASSERT(currentThread() == m_database->originThreadID()); 756 814 757 815 Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this); … … 768 826 ASSERT(isActive()); 769 827 ASSERT(!range.isNull); 828 ASSERT(currentThread() == m_database->originThreadID()); 770 829 771 830 Ref<IDBRequest> request = IDBRequest::createCount(context, index, *this); … … 780 839 { 781 840 LOG(IndexedDB, "IDBTransaction::getCountOnServer"); 841 ASSERT(currentThread() == m_database->originThreadID()); 782 842 783 843 serverConnection().getCount(operation, keyRange); … … 787 847 { 788 848 LOG(IndexedDB, "IDBTransaction::didGetCountOnServer"); 849 ASSERT(currentThread() == m_database->originThreadID()); 789 850 790 851 request.setResult(resultData.resultInteger()); … … 797 858 ASSERT(isActive()); 798 859 ASSERT(!range.isNull); 860 ASSERT(currentThread() == m_database->originThreadID()); 799 861 800 862 Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this); … … 808 870 { 809 871 LOG(IndexedDB, "IDBTransaction::deleteRecordOnServer"); 872 ASSERT(currentThread() == m_database->originThreadID()); 810 873 811 874 serverConnection().deleteRecord(operation, keyRange); … … 815 878 { 816 879 LOG(IndexedDB, "IDBTransaction::didDeleteRecordOnServer"); 880 ASSERT(currentThread() == m_database->originThreadID()); 817 881 818 882 request.setResultToUndefined(); … … 824 888 LOG(IndexedDB, "IDBTransaction::requestClearObjectStore"); 825 889 ASSERT(isActive()); 890 ASSERT(currentThread() == m_database->originThreadID()); 826 891 827 892 Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this); … … 838 903 { 839 904 LOG(IndexedDB, "IDBTransaction::clearObjectStoreOnServer"); 905 ASSERT(currentThread() == m_database->originThreadID()); 840 906 841 907 serverConnection().clearObjectStore(operation, objectStoreIdentifier); … … 845 911 { 846 912 LOG(IndexedDB, "IDBTransaction::didClearObjectStoreOnServer"); 913 ASSERT(currentThread() == m_database->originThreadID()); 847 914 848 915 request.setResultToUndefined(); … … 856 923 ASSERT(!isReadOnly()); 857 924 ASSERT(objectStore.info().autoIncrement() || key); 925 ASSERT(currentThread() == m_database->originThreadID()); 858 926 859 927 Ref<IDBRequest> request = IDBRequest::create(context, objectStore, *this); … … 869 937 { 870 938 LOG(IndexedDB, "IDBTransaction::putOrAddOnServer"); 871 939 ASSERT(currentThread() == m_database->originThreadID()); 872 940 ASSERT(!isReadOnly()); 873 941 ASSERT(value); … … 898 966 { 899 967 LOG(IndexedDB, "IDBTransaction::didPutOrAddOnServer"); 968 ASSERT(currentThread() == m_database->originThreadID()); 900 969 901 970 if (auto* result = resultData.resultKey()) … … 909 978 { 910 979 LOG(IndexedDB, "IDBTransaction::deleteObjectStore"); 911 980 ASSERT(currentThread() == m_database->originThreadID()); 912 981 ASSERT(isVersionChange()); 913 982 … … 923 992 LOG(IndexedDB, "IDBTransaction::deleteObjectStoreOnServer"); 924 993 ASSERT(isVersionChange()); 994 ASSERT(currentThread() == m_database->originThreadID()); 925 995 926 996 serverConnection().deleteObjectStore(operation, objectStoreName); … … 930 1000 { 931 1001 LOG(IndexedDB, "IDBTransaction::didDeleteObjectStoreOnServer"); 1002 ASSERT(currentThread() == m_database->originThreadID()); 932 1003 ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteObjectStoreSuccess || resultData.type() == IDBResultType::Error); 933 1004 } … … 936 1007 { 937 1008 LOG(IndexedDB, "IDBTransaction::deleteIndex"); 938 1009 ASSERT(currentThread() == m_database->originThreadID()); 939 1010 ASSERT(isVersionChange()); 940 1011 … … 947 1018 LOG(IndexedDB, "IDBTransaction::deleteIndexOnServer"); 948 1019 ASSERT(isVersionChange()); 1020 ASSERT(currentThread() == m_database->originThreadID()); 949 1021 950 1022 serverConnection().deleteIndex(operation, objectStoreIdentifier, indexName); … … 954 1026 { 955 1027 LOG(IndexedDB, "IDBTransaction::didDeleteIndexOnServer"); 1028 ASSERT(currentThread() == m_database->originThreadID()); 956 1029 ASSERT_UNUSED(resultData, resultData.type() == IDBResultType::DeleteIndexSuccess || resultData.type() == IDBResultType::Error); 957 1030 } … … 960 1033 { 961 1034 ASSERT(m_transactionOperationMap.get(operation.identifier()) == &operation); 1035 ASSERT(currentThread() == m_database->originThreadID()); 1036 962 1037 m_transactionOperationMap.remove(operation.identifier()); 963 1038 … … 968 1043 { 969 1044 LOG(IndexedDB, "IDBTransaction::establishOnServer"); 1045 ASSERT(currentThread() == m_database->originThreadID()); 970 1046 971 1047 serverConnection().establishTransaction(*this); … … 974 1050 void IDBTransaction::activate() 975 1051 { 1052 ASSERT(currentThread() == m_database->originThreadID()); 1053 976 1054 if (isFinishedOrFinishing()) 977 1055 return; … … 982 1060 void IDBTransaction::deactivate() 983 1061 { 1062 ASSERT(currentThread() == m_database->originThreadID()); 1063 984 1064 if (m_state == IndexedDB::TransactionState::Active) 985 1065 m_state = IndexedDB::TransactionState::Inactive;
Note:
See TracChangeset
for help on using the changeset viewer.