Changeset 242043 in webkit
- Timestamp:
- Feb 25, 2019 8:50:20 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r242037 r242043 1 2019-02-25 Sihui Liu <sihui_liu@apple.com> 2 3 IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests 4 https://bugs.webkit.org/show_bug.cgi?id=194709 5 6 Reviewed by Geoffrey Garen. 7 8 * TestExpectations: 9 * platform/wk2/TestExpectations: 10 * storage/indexeddb/IDBObject-leak-expected.txt: Added. 11 * storage/indexeddb/IDBObject-leak.html: Added. 12 1 13 2019-02-25 Zan Dobersek <zdobersek@igalia.com> 2 14 -
trunk/LayoutTests/TestExpectations
r241942 r242043 131 131 http/tests/navigation/useragent-reload.php [ Skip ] 132 132 storage/indexeddb/modern/opendatabase-after-storage-crash.html [ Skip ] 133 storage/indexeddb/IDBObject-leak.html [ Skip ] 133 134 fast/forms/call-text-did-change-in-text-field-when-typing.html [ Skip ] 134 135 -
trunk/LayoutTests/platform/wk2/TestExpectations
r241755 r242043 747 747 http/tests/navigation/useragent-reload.php [ Pass ] 748 748 storage/indexeddb/modern/opendatabase-after-storage-crash.html [ Pass ] 749 storage/indexeddb/IDBObject-leak.html [ Pass ] 749 750 750 751 fast/forms/call-text-did-change-in-text-field-when-typing.html [ Pass ] -
trunk/Source/WebCore/ChangeLog
r242041 r242043 1 2019-02-25 Sihui Liu <sihui_liu@apple.com> 2 3 IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests 4 https://bugs.webkit.org/show_bug.cgi?id=194709 5 6 Reviewed by Geoffrey Garen. 7 8 When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 9 IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 10 11 Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle 12 between IDBOpenDBRequest and IDBTransaction. 13 14 Test: storage/indexeddb/IDBObject-leak.html 15 16 * Modules/indexeddb/IDBDatabase.cpp: 17 (WebCore::IDBDatabase::connectionToServerLost): 18 * Modules/indexeddb/IDBTransaction.cpp: 19 (WebCore::IDBTransaction::IDBTransaction): 20 (WebCore::IDBTransaction::~IDBTransaction): 21 (WebCore::IDBTransaction::connectionClosedFromServer): 22 * Modules/indexeddb/IDBTransaction.h: 23 * testing/Internals.cpp: 24 (WebCore::Internals::numberOfIDBTransactions const): 25 * testing/Internals.h: 26 * testing/Internals.idl: 27 1 28 2019-02-25 Zalan Bujtas <zalan@apple.com> 2 29 -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
r241761 r242043 265 265 m_closedInServer = true; 266 266 267 for (auto& transaction : m_activeTransactions.values()) 267 auto transactions = copyToVector(m_activeTransactions.values()); 268 for (auto& transaction : transactions) 268 269 transaction->connectionClosedFromServer(error); 269 270 -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r241761 r242043 60 60 using namespace JSC; 61 61 62 std::atomic<unsigned> IDBTransaction::numberOfIDBTransactions { 0 }; 63 62 64 Ref<IDBTransaction> IDBTransaction::create(IDBDatabase& database, const IDBTransactionInfo& info) 63 65 { … … 83 85 ASSERT(&m_database->originThread() == &Thread::current()); 84 86 87 ++numberOfIDBTransactions; 88 85 89 if (m_info.mode() == IDBTransactionMode::Versionchange) { 86 90 ASSERT(m_openDBRequest); … … 106 110 IDBTransaction::~IDBTransaction() 107 111 { 112 --numberOfIDBTransactions; 108 113 ASSERT(&m_database->originThread() == &Thread::current()); 109 114 } … … 1435 1440 LOG(IndexedDB, "IDBTransaction::connectionClosedFromServer - %s", error.message().utf8().data()); 1436 1441 1437 m_state = IndexedDB::TransactionState::Aborting; 1442 m_database->willAbortTransaction(*this); 1443 transitionedToFinishing(IndexedDB::TransactionState::Aborting); 1438 1444 1439 1445 abortInProgressOperations(error); … … 1446 1452 operation->doComplete(IDBResultData::error(operation->identifier(), error)); 1447 1453 } 1454 m_currentlyCompletingRequest = nullptr; 1448 1455 1449 1456 connectionProxy().forgetActiveOperations(operations); … … 1455 1462 m_idbError = error; 1456 1463 m_domError = error.toDOMException(); 1464 m_database->didAbortTransaction(*this); 1457 1465 fireOnAbort(); 1458 1466 } -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h
r241761 r242043 153 153 void visitReferencedObjectStores(JSC::SlotVisitor&) const; 154 154 155 WEBCORE_EXPORT static std::atomic<unsigned> numberOfIDBTransactions; 156 155 157 private: 156 158 IDBTransaction(IDBDatabase&, const IDBTransactionInfo&, IDBOpenDBRequest*); -
trunk/Source/WebCore/testing/Internals.cpp
r242019 r242043 94 94 #include "HistoryItem.h" 95 95 #include "HitTestResult.h" 96 #include "IDBRequest.h" 97 #include "IDBTransaction.h" 96 98 #include "InspectorClient.h" 97 99 #include "InspectorController.h" … … 2375 2377 } 2376 2378 2379 unsigned Internals::numberOfIDBTransactions() const 2380 { 2381 return IDBTransaction::numberOfIDBTransactions; 2382 } 2383 2377 2384 unsigned Internals::numberOfLiveNodes() const 2378 2385 { -
trunk/Source/WebCore/testing/Internals.h
r242019 r242043 379 379 ExceptionOr<void> insertUserCSS(const String&) const; 380 380 381 unsigned numberOfIDBTransactions() const; 382 381 383 unsigned numberOfLiveNodes() const; 382 384 unsigned numberOfLiveDocuments() const; -
trunk/Source/WebCore/testing/Internals.idl
r242019 r242043 406 406 void endSimulatedMemoryPressure(); 407 407 408 unsigned long numberOfIDBTransactions(); 409 408 410 unsigned long numberOfLiveNodes(); 409 411 unsigned long numberOfLiveDocuments();
Note: See TracChangeset
for help on using the changeset viewer.