Title: [231831] branches/safari-605-branch
Revision
231831
Author
[email protected]
Date
2018-05-15 18:42:00 -0700 (Tue, 15 May 2018)

Log Message

Cherry-pick r231713. rdar://problem/40172913

    LinkLoader fails to remove CachedResourceClient in some cases
    https://bugs.webkit.org/show_bug.cgi?id=185553
    <rdar://problem/36879656>

    Reviewed by Geoffrey Garen.

    Source/WebCore:

    Test: http/tests/preload/link-preload-client-remove.html

    * loader/LinkLoader.cpp:
    (WebCore::LinkLoader::loadLink):

    If there is a link preload already in progress, we fail to clear the client for the ongoing load.
    This may leave the CachedResource client map in a bad state.

    LayoutTests:

    * http/tests/preload/link-preload-client-remove-expected.txt: Added.
    * http/tests/preload/link-preload-client-remove.html: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231713 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-605-branch/LayoutTests/ChangeLog (231830 => 231831)


--- branches/safari-605-branch/LayoutTests/ChangeLog	2018-05-16 01:41:58 UTC (rev 231830)
+++ branches/safari-605-branch/LayoutTests/ChangeLog	2018-05-16 01:42:00 UTC (rev 231831)
@@ -1,3 +1,42 @@
+2018-05-15  Kocsen Chung  <[email protected]>
+
+        Cherry-pick r231713. rdar://problem/40172913
+
+    LinkLoader fails to remove CachedResourceClient in some cases
+    https://bugs.webkit.org/show_bug.cgi?id=185553
+    <rdar://problem/36879656>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Source/WebCore:
+    
+    Test: http/tests/preload/link-preload-client-remove.html
+    
+    * loader/LinkLoader.cpp:
+    (WebCore::LinkLoader::loadLink):
+    
+    If there is a link preload already in progress, we fail to clear the client for the ongoing load.
+    This may leave the CachedResource client map in a bad state.
+    
+    LayoutTests:
+    
+    * http/tests/preload/link-preload-client-remove-expected.txt: Added.
+    * http/tests/preload/link-preload-client-remove.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-11  Antti Koivisto  <[email protected]>
+
+            LinkLoader fails to remove CachedResourceClient in some cases
+            https://bugs.webkit.org/show_bug.cgi?id=185553
+            <rdar://problem/36879656>
+
+            Reviewed by Geoffrey Garen.
+
+            * http/tests/preload/link-preload-client-remove-expected.txt: Added.
+            * http/tests/preload/link-preload-client-remove.html: Added.
+
 2018-05-09  Jason Marcell  <[email protected]>
 
         Cherry-pick r231513. rdar://problem/40096750

Added: branches/safari-605-branch/LayoutTests/http/tests/preload/link-preload-client-remove-expected.txt (0 => 231831)


--- branches/safari-605-branch/LayoutTests/http/tests/preload/link-preload-client-remove-expected.txt	                        (rev 0)
+++ branches/safari-605-branch/LayoutTests/http/tests/preload/link-preload-client-remove-expected.txt	2018-05-16 01:42:00 UTC (rev 231831)
@@ -0,0 +1 @@
+Test that restarting link preload doesn't assert or crash.

Added: branches/safari-605-branch/LayoutTests/http/tests/preload/link-preload-client-remove.html (0 => 231831)


--- branches/safari-605-branch/LayoutTests/http/tests/preload/link-preload-client-remove.html	                        (rev 0)
+++ branches/safari-605-branch/LayoutTests/http/tests/preload/link-preload-client-remove.html	2018-05-16 01:42:00 UTC (rev 231831)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText()
+    testRunner.waitUntilDone();
+    window.addEventListener("load", function() {
+        testRunner.notifyDone();
+    });
+}
+</script>
+<link id=link rel=preload href="" as=fetch>
+<body>
+Test that restarting link preload doesn't assert or crash.
+</body>
+<script>
+link.setAttribute("rel", "preload");
+</script>

Modified: branches/safari-605-branch/Source/WebCore/ChangeLog (231830 => 231831)


--- branches/safari-605-branch/Source/WebCore/ChangeLog	2018-05-16 01:41:58 UTC (rev 231830)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog	2018-05-16 01:42:00 UTC (rev 231831)
@@ -1,5 +1,49 @@
 2018-05-15  Kocsen Chung  <[email protected]>
 
+        Cherry-pick r231713. rdar://problem/40172913
+
+    LinkLoader fails to remove CachedResourceClient in some cases
+    https://bugs.webkit.org/show_bug.cgi?id=185553
+    <rdar://problem/36879656>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Source/WebCore:
+    
+    Test: http/tests/preload/link-preload-client-remove.html
+    
+    * loader/LinkLoader.cpp:
+    (WebCore::LinkLoader::loadLink):
+    
+    If there is a link preload already in progress, we fail to clear the client for the ongoing load.
+    This may leave the CachedResource client map in a bad state.
+    
+    LayoutTests:
+    
+    * http/tests/preload/link-preload-client-remove-expected.txt: Added.
+    * http/tests/preload/link-preload-client-remove.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-05-11  Antti Koivisto  <[email protected]>
+
+            LinkLoader fails to remove CachedResourceClient in some cases
+            https://bugs.webkit.org/show_bug.cgi?id=185553
+            <rdar://problem/36879656>
+
+            Reviewed by Geoffrey Garen.
+
+            Test: http/tests/preload/link-preload-client-remove.html
+
+            * loader/LinkLoader.cpp:
+            (WebCore::LinkLoader::loadLink):
+
+            If there is a link preload already in progress, we fail to clear the client for the ongoing load.
+            This may leave the CachedResource client map in a bad state.
+
+2018-05-15  Kocsen Chung  <[email protected]>
+
         Cherry-pick r231267. rdar://problem/39988097
 
     REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements

Modified: branches/safari-605-branch/Source/WebCore/loader/LinkLoader.cpp (231830 => 231831)


--- branches/safari-605-branch/Source/WebCore/loader/LinkLoader.cpp	2018-05-16 01:41:58 UTC (rev 231830)
+++ branches/safari-605-branch/Source/WebCore/loader/LinkLoader.cpp	2018-05-16 01:42:00 UTC (rev 231831)
@@ -281,10 +281,10 @@
 
     if (m_client.shouldLoadLink()) {
         auto resourceClient = preloadIfNeeded(relAttribute, href, document, as, media, mimeType, crossOrigin, this);
+        if (m_preloadResourceClient)
+            m_preloadResourceClient->clear();
         if (resourceClient)
             m_preloadResourceClient = WTFMove(resourceClient);
-        else if (m_preloadResourceClient)
-            m_preloadResourceClient->clear();
     }
 
 #if ENABLE(LINK_PREFETCH)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to