Title: [218502] trunk/Source/WebCore
Revision
218502
Author
beid...@apple.com
Date
2017-06-19 13:12:41 -0700 (Mon, 19 Jun 2017)

Log Message

Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
<rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473

Reviewed by Alex Christensen.

No new tests (No known change in behavior)

I discovered the need to make these changes here due to a transient bug
introduced in r218015 but already explicitly fixed in r218409.

This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.

It also clears out all pending IconLoader and icon load decisions when stopLoading() is called,
as even attempting to start an icon load after detachment is a waste of cycles.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
  load decision.
(WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (218501 => 218502)


--- trunk/Source/WebCore/ChangeLog	2017-06-19 19:53:16 UTC (rev 218501)
+++ trunk/Source/WebCore/ChangeLog	2017-06-19 20:12:41 UTC (rev 218502)
@@ -1,3 +1,25 @@
+2017-06-19  Brady Eidson  <beid...@apple.com>
+
+        Cleanup IconLoader stuff when a DocumentLoader detaches from its frame.
+        <rdar://problem/31418761> and https://bugs.webkit.org/show_bug.cgi?id=173473
+
+        Reviewed by Alex Christensen.
+
+        No new tests (No known change in behavior)
+
+        I discovered the need to make these changes here due to a transient bug
+        introduced in r218015 but already explicitly fixed in r218409.
+        
+        This change adds an assert to guard against a detached DocumentLoader having active IconLoaders.
+
+        It also clears out all pending IconLoader and icon load decisions when stopLoading() is called, 
+        as even attempting to start an icon load after detachment is a waste of cycles.
+        
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::stopLoading): Also explicitly clear all IconLoaders and icons pending
+          load decision.
+        (WebCore::DocumentLoader::finishedLoadingIcon): Assert that this DocumentLoader is not detached.
+
 2017-06-19  Chris Dumez  <cdu...@apple.com>
 
         Use WTF::Function instead of std::function in more places in WebCore/

Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (218501 => 218502)


--- trunk/Source/WebCore/loader/DocumentLoader.cpp	2017-06-19 19:53:16 UTC (rev 218501)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp	2017-06-19 20:12:41 UTC (rev 218502)
@@ -282,6 +282,9 @@
             m_frame->loader().stopLoading(UnloadEventPolicyNone);
     }
 
+    m_iconsPendingLoadDecision.clear();
+    m_iconLoaders.clear();
+
     // Always cancel multipart loaders
     cancelAll(m_multipartSubresourceLoaders);
 
@@ -1689,6 +1692,9 @@
 
 void DocumentLoader::finishedLoadingIcon(IconLoader& loader, SharedBuffer* buffer)
 {
+    // If the DocumentLoader has detached from its frame, all icon loads should have already been cancelled.
+    ASSERT(m_frame);
+
     auto loadIdentifier = m_iconLoaders.take(&loader);
     ASSERT(loadIdentifier);
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to