WebKit Bugzilla
Attachment 373657 Details for
Bug 199585
: Make Document::postTask() safe to call from a background thread
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199585-20190708125508.patch (text/plain), 1.80 KB, created by
Chris Dumez
on 2019-07-08 12:55:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2019-07-08 12:55:09 PDT
Size:
1.80 KB
patch
obsolete
>Subversion Revision: 247226 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 4e1e2499cfb9bac3e1d764b37438c389b84dcde2..78f8b4aea6d6e9cf61c530322da22505180187b3 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-07-08 Chris Dumez <cdumez@apple.com> >+ >+ Make Document::postTask() safe to call from a background thread >+ https://bugs.webkit.org/show_bug.cgi?id=199585 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make Document::postTask() safe to call from a background thread by not calling makeWeakPtr() on the Document. >+ Calling makeWeakPtr() on a document from a background thread is not safe since Document is a main thread >+ object. Instead, capture Document::identifier() in the lambda and lookup the document from its identifier >+ once we're on the main thread. >+ >+ * dom/Document.cpp: >+ (WebCore::Document::postTask): >+ > 2019-07-08 Wenson Hsieh <wenson_hsieh@apple.com> > > Unable to paste from Notes into Excel 365 spreadsheet >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 57ab3e145495d28f95841eae76f25e279d431101..eca1774999c05914668cec05916465781460b152 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -6120,10 +6120,10 @@ void Document::addMessage(MessageSource source, MessageLevel level, const String > > void Document::postTask(Task&& task) > { >- callOnMainThread([documentReference = makeWeakPtr(*this), task = WTFMove(task)]() mutable { >+ callOnMainThread([documentID = identifier(), task = WTFMove(task)]() mutable { > ASSERT(isMainThread()); > >- Document* document = documentReference.get(); >+ auto* document = allDocumentsMap().get(documentID); > if (!document) > return; >
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 199585
: 373657