Changeset 247239 in webkit
- Timestamp:
- Jul 8, 2019 4:56:45 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247238 r247239 1 2019-07-08 Chris Dumez <cdumez@apple.com> 2 3 Make Document::postTask() safe to call from a background thread 4 https://bugs.webkit.org/show_bug.cgi?id=199585 5 6 Reviewed by Alex Christensen. 7 8 Make Document::postTask() safe to call from a background thread by not calling makeWeakPtr() on the Document. 9 Calling makeWeakPtr() on a document from a background thread is not safe since Document is a main thread 10 object. Instead, capture Document::identifier() in the lambda and lookup the document from its identifier 11 once we're on the main thread. 12 13 * dom/Document.cpp: 14 (WebCore::Document::postTask): 15 1 16 2019-07-08 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/WebCore/dom/Document.cpp
r247222 r247239 6121 6121 void Document::postTask(Task&& task) 6122 6122 { 6123 callOnMainThread([document Reference = makeWeakPtr(*this), task = WTFMove(task)]() mutable {6123 callOnMainThread([documentID = identifier(), task = WTFMove(task)]() mutable { 6124 6124 ASSERT(isMainThread()); 6125 6125 6126 Document* document = documentReference.get();6126 auto* document = allDocumentsMap().get(documentID); 6127 6127 if (!document) 6128 6128 return;
Note: See TracChangeset
for help on using the changeset viewer.