Title: [278480] trunk/Source/WebCore
Revision
278480
Author
[email protected]
Date
2021-06-04 12:03:13 -0700 (Fri, 04 Jun 2021)

Log Message

DOMFileSystem::listDirectory() fails to protect |this| when going to the background thread
https://bugs.webkit.org/show_bug.cgi?id=226652

Reviewed by Darin Adler.

* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::DOMFileSystem::listDirectory):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (278479 => 278480)


--- trunk/Source/WebCore/ChangeLog	2021-06-04 18:59:28 UTC (rev 278479)
+++ trunk/Source/WebCore/ChangeLog	2021-06-04 19:03:13 UTC (rev 278480)
@@ -1,5 +1,15 @@
 2021-06-04  Chris Dumez  <[email protected]>
 
+        DOMFileSystem::listDirectory() fails to protect |this| when going to the background thread
+        https://bugs.webkit.org/show_bug.cgi?id=226652
+
+        Reviewed by Darin Adler.
+
+        * Modules/entriesapi/DOMFileSystem.cpp:
+        (WebCore::DOMFileSystem::listDirectory):
+
+2021-06-04  Chris Dumez  <[email protected]>
+
         Stop using legacy MainThreadTaskQueue in Document::didLogMessage()
         https://bugs.webkit.org/show_bug.cgi?id=226645
 

Modified: trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp (278479 => 278480)


--- trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp	2021-06-04 18:59:28 UTC (rev 278479)
+++ trunk/Source/WebCore/Modules/entriesapi/DOMFileSystem.cpp	2021-06-04 19:03:13 UTC (rev 278480)
@@ -254,10 +254,10 @@
         return;
     }
 
-    m_workQueue->dispatch([this, context = makeRef(context), completionHandler = WTFMove(completionHandler), fullPath = crossThreadCopy(fullPath), directoryVirtualPath = crossThreadCopy(directoryVirtualPath)]() mutable {
+    m_workQueue->dispatch([protectedThis = makeRef(*this), context = makeRef(context), completionHandler = WTFMove(completionHandler), fullPath = crossThreadCopy(fullPath), directoryVirtualPath = crossThreadCopy(directoryVirtualPath)]() mutable {
         auto listedChildren = listDirectoryWithMetadata(fullPath);
-        callOnMainThread([this, context = WTFMove(context), completionHandler = WTFMove(completionHandler), listedChildren = crossThreadCopy(listedChildren), directoryVirtualPath = directoryVirtualPath.isolatedCopy()]() mutable {
-            completionHandler(toFileSystemEntries(context, *this, WTFMove(listedChildren), directoryVirtualPath));
+        callOnMainThread([protectedThis = WTFMove(protectedThis), context = WTFMove(context), completionHandler = WTFMove(completionHandler), listedChildren = crossThreadCopy(listedChildren), directoryVirtualPath = directoryVirtualPath.isolatedCopy()]() mutable {
+            completionHandler(toFileSystemEntries(context, protectedThis, WTFMove(listedChildren), directoryVirtualPath));
         });
     });
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to