Title: [268025] trunk/Source/WebKit
Revision
268025
Author
wenson_hs...@apple.com
Date
2020-10-05 18:27:20 -0700 (Mon, 05 Oct 2020)

Log Message

REGRESSION(r267915): Many layout tests are asserting under ~CompletionHandler()
https://bugs.webkit.org/show_bug.cgi?id=217345
<rdar://problem/69973775>

Reviewed by Tim Horton.

I did *not* intend to schedule an async task after every single image load in r267915. Apart from triggering
assertions on various tests, this also causes us to send excessive IPC messages to the UI process when loading
images, which can't be good for performance. Fix this by only calling into `computeAndSendEditDragSnapshot()`
when we've finished loading all dropped image elements.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::didFinishLoadingImageForElement):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (268024 => 268025)


--- trunk/Source/WebKit/ChangeLog	2020-10-06 01:22:44 UTC (rev 268024)
+++ trunk/Source/WebKit/ChangeLog	2020-10-06 01:27:20 UTC (rev 268025)
@@ -1,3 +1,19 @@
+2020-10-05  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        REGRESSION(r267915): Many layout tests are asserting under ~CompletionHandler()
+        https://bugs.webkit.org/show_bug.cgi?id=217345
+        <rdar://problem/69973775>
+
+        Reviewed by Tim Horton.
+
+        I did *not* intend to schedule an async task after every single image load in r267915. Apart from triggering
+        assertions on various tests, this also causes us to send excessive IPC messages to the UI process when loading
+        images, which can't be good for performance. Fix this by only calling into `computeAndSendEditDragSnapshot()`
+        when we've finished loading all dropped image elements.
+
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::didFinishLoadingImageForElement):
+
 2020-10-05  Brady Eidson  <beid...@apple.com>
 
         Change a PDF RELEASE_ASSERT to an early return.

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (268024 => 268025)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-10-06 01:22:44 UTC (rev 268024)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2020-10-06 01:27:20 UTC (rev 268025)
@@ -1015,7 +1015,9 @@
 
 void WebPage::didFinishLoadingImageForElement(WebCore::HTMLImageElement& element)
 {
-    m_pendingImageElementsForDropSnapshot.remove(&element);
+    if (!m_pendingImageElementsForDropSnapshot.remove(&element))
+        return;
+
     bool shouldSendSnapshot = m_pendingImageElementsForDropSnapshot.isEmpty();
     m_page->dragController().finalizeDroppedImagePlaceholder(element, [protectedThis = makeRefPtr(this), shouldSendSnapshot] {
         if (shouldSendSnapshot)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to