WebKit Bugzilla
Attachment 358815 Details for
Bug 193167
: IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193167-20190110120104.patch (text/plain), 3.98 KB, created by
Sihui Liu
on 2019-01-10 12:01:04 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Sihui Liu
Created:
2019-01-10 12:01:04 PST
Size:
3.98 KB
patch
obsolete
>Subversion Revision: 239778 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 63394d701f2531582bcb2ddc2a6d087d7b10b596..01a648584b5e71c256b6748b3b389204afb44944 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-01-10 Sihui Liu <sihui_liu@apple.com> >+ >+ IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests >+ https://bugs.webkit.org/show_bug.cgi?id=193167 >+ <rdar://problem/46891688> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Do some cleanup to break retain cycle when context is stopped. >+ >+ * Modules/indexeddb/IDBOpenDBRequest.cpp: >+ (WebCore::IDBOpenDBRequest::cancelForStop): >+ * Modules/indexeddb/IDBTransaction.cpp: >+ (WebCore::IDBTransaction::abortOnServerAndCancelRequests): >+ (WebCore::IDBTransaction::stop): >+ (WebCore::IDBTransaction::removeRequest): >+ * Modules/indexeddb/client/TransactionOperation.h: >+ (WebCore::IDBClient::TransactionOperation::doComplete): >+ > 2019-01-09 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC][MarginCollapsing] Add support for peculiar cases. >diff --git a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp >index 91ce9c4cb9454cebaa104f8943cb42bf51c635d2..44118764d6e0a6bfd4aed341bed98a051c303bca 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp >@@ -115,6 +115,9 @@ void IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion() > void IDBOpenDBRequest::cancelForStop() > { > connectionProxy().openDBRequestCancelled({ connectionProxy(), *this }); >+ >+ if (m_transaction && m_transaction->isVersionChange()) >+ m_transaction->removeRequest(*this); > } > > void IDBOpenDBRequest::dispatchEvent(Event& event) >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >index b82b66a1d23f7af54383b2933c253ec433613626..b2f650f61ebb4c00036449565a85be9af7235401 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >@@ -297,11 +297,12 @@ void IDBTransaction::abortOnServerAndCancelRequests(IDBClient::TransactionOperat > abortInProgressOperations(error); > > for (auto& operation : m_abortQueue) { >- m_currentlyCompletingRequest = nullptr; > m_transactionOperationsInProgressQueue.append(operation.get()); > operation->doComplete(IDBResultData::error(operation->identifier(), error)); >+ m_currentlyCompletingRequest = nullptr; > } > >+ m_abortQueue.clear(); > // Since we're aborting, it should be impossible to have queued any further operations. > ASSERT(m_pendingTransactionOperationQueue.isEmpty()); > } >@@ -338,6 +339,9 @@ void IDBTransaction::stop() > > m_contextStopped = true; > >+ if (isVersionChange()) >+ m_openDBRequest = nullptr; >+ > if (isFinishedOrFinishing()) > return; > >@@ -368,7 +372,6 @@ void IDBTransaction::addRequest(IDBRequest& request) > void IDBTransaction::removeRequest(IDBRequest& request) > { > ASSERT(&m_database->originThread() == &Thread::current()); >- ASSERT(m_openRequests.contains(&request)); > m_openRequests.remove(&request); > } > >diff --git a/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h b/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h >index 8ddb56e178b72ef21a666eb169dfc16ee9892de3..3e02d5972e04fb7ea166edf67a937c3c721a489d 100644 >--- a/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h >+++ b/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h >@@ -98,6 +98,8 @@ public: > // so we need to do this trick to null it out without first destroying it. > WTF::Function<void (const IDBResultData&)> oldCompleteFunction; > std::swap(m_completeFunction, oldCompleteFunction); >+ >+ m_performFunction = { }; > } > > const IDBResourceIdentifier& identifier() const { return m_identifier; }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193167
:
358421
|
358803
| 358815