Changeset 202821 in webkit
- Timestamp:
- Jul 5, 2016 11:04:28 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202815 r202821 1 2016-07-05 Brady Eidson <beidson@apple.com> 2 3 TransactionOperations can get destroyed on the wrong thread. 4 https://bugs.webkit.org/show_bug.cgi?id=159103 5 6 Reviewed by Alex Christensen. 7 8 No new tests (Very racy, not feasible to write a dedicated test for, caught on bots occasionally as-is). 9 10 * Modules/indexeddb/IDBActiveDOMObject.h: 11 (WebCore::IDBActiveDOMObject::callFunctionOnOriginThread): 12 13 * Modules/indexeddb/client/IDBConnectionProxy.cpp: 14 (WebCore::IDBClient::IDBConnectionProxy::completeOperation): Pass the last ref to the operation to its 15 origin thread to be deleted there. 16 17 * Modules/indexeddb/client/TransactionOperation.h: 18 (WebCore::IDBClient::TransactionOperation::performCompleteOnOriginThread): 19 1 20 2016-07-05 Youenn Fablet <youenn@apple.com> 2 21 -
trunk/Source/WebCore/Modules/indexeddb/IDBActiveDOMObject.h
r201504 r202821 64 64 } 65 65 66 void callFunctionOnOriginThread(Function<void ()>&& function) 67 { 68 if (originThreadID() == currentThread()) { 69 function(); 70 return; 71 } 72 73 Locker<Lock> lock(m_scriptExecutionContextLock); 74 75 ScriptExecutionContext* context = scriptExecutionContext(); 76 if (!context) 77 return; 78 79 context->postTask(WTFMove(function)); 80 } 81 66 82 protected: 67 83 IDBActiveDOMObject(ScriptExecutionContext* context) -
trunk/Source/WebCore/Modules/indexeddb/client/IDBConnectionProxy.cpp
r202809 r202821 224 224 return; 225 225 226 operation->performCompleteOnOriginThread(resultData );226 operation->performCompleteOnOriginThread(resultData, WTFMove(operation)); 227 227 } 228 228 -
trunk/Source/WebCore/Modules/indexeddb/client/TransactionOperation.h
r201356 r202821 63 63 } 64 64 65 void performCompleteOnOriginThread(const IDBResultData& data )65 void performCompleteOnOriginThread(const IDBResultData& data, RefPtr<TransactionOperation>&& lastRef) 66 66 { 67 67 ASSERT(isMainThread()); … … 69 69 if (m_originThreadID == currentThread()) 70 70 completed(data); 71 else 71 else { 72 72 m_transaction->performCallbackOnOriginThread(*this, &TransactionOperation::completed, data); 73 m_transaction->callFunctionOnOriginThread([lastRef = WTFMove(lastRef)]() { 74 }); 75 } 73 76 } 74 77
Note: See TracChangeset
for help on using the changeset viewer.