Title: [227005] trunk
Revision
227005
Author
[email protected]
Date
2018-01-16 14:52:47 -0800 (Tue, 16 Jan 2018)

Log Message

Unreviewed, rolling out r226962.

The LayoutTest added with this change is a flaky timeout.

Reverted changeset:

"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/226962

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (227004 => 227005)


--- trunk/LayoutTests/ChangeLog	2018-01-16 22:35:39 UTC (rev 227004)
+++ trunk/LayoutTests/ChangeLog	2018-01-16 22:52:47 UTC (rev 227005)
@@ -1,3 +1,15 @@
+2018-01-16  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r226962.
+
+        The LayoutTest added with this change is a flaky timeout.
+
+        Reverted changeset:
+
+        "Support for preconnect Link headers"
+        https://bugs.webkit.org/show_bug.cgi?id=181657
+        https://trac.webkit.org/changeset/226962
+
 2018-01-16  Said Abou-Hallawa  <[email protected]>
 
         REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion

Deleted: trunk/LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http-expected.txt (227004 => 227005)


--- trunk/LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http-expected.txt	2018-01-16 22:35:39 UTC (rev 227004)
+++ trunk/LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http-expected.txt	2018-01-16 22:52:47 UTC (rev 227005)
@@ -1,10 +0,0 @@
-CONSOLE MESSAGE: Successfuly preconnected to http://localhost:8000/
-Tests that Link header's rel=preconnect works as expected over HTTP.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http.php (227004 => 227005)


--- trunk/LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http.php	2018-01-16 22:35:39 UTC (rev 227004)
+++ trunk/LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http.php	2018-01-16 22:52:47 UTC (rev 227005)
@@ -1,19 +0,0 @@
-<?php
-   header('Link: <http://localhost:8000>; rel=preconnect');
-?>
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<script>
-description("Tests that Link header's rel=preconnect works as expected over HTTP.");
-jsTestIsAsync = true;
-
-internals.setConsoleMessageListener(function() {
-    finishJSTest();
-});
-</script>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (227004 => 227005)


--- trunk/Source/WebCore/ChangeLog	2018-01-16 22:35:39 UTC (rev 227004)
+++ trunk/Source/WebCore/ChangeLog	2018-01-16 22:52:47 UTC (rev 227005)
@@ -1,3 +1,15 @@
+2018-01-16  Ryan Haddad  <[email protected]>
+
+        Unreviewed, rolling out r226962.
+
+        The LayoutTest added with this change is a flaky timeout.
+
+        Reverted changeset:
+
+        "Support for preconnect Link headers"
+        https://bugs.webkit.org/show_bug.cgi?id=181657
+        https://trac.webkit.org/changeset/226962
+
 2018-01-16  Simon Fraser  <[email protected]>
 
         Text looks bad on some CSS spec pages

Modified: trunk/Source/WebCore/loader/LinkLoader.cpp (227004 => 227005)


--- trunk/Source/WebCore/loader/LinkLoader.cpp	2018-01-16 22:35:39 UTC (rev 227004)
+++ trunk/Source/WebCore/loader/LinkLoader.cpp	2018-01-16 22:52:47 UTC (rev 227005)
@@ -110,8 +110,7 @@
         // Sanity check to avoid re-entrancy here.
         if (equalIgnoringFragmentIdentifier(url, baseURL))
             continue;
-        preconnect(relAttribute, url, document, header.crossOrigin());
-        preload(relAttribute, url, document, header.as(), header.media(), header.mimeType(), header.crossOrigin(), nullptr);
+        preloadIfNeeded(relAttribute, url, document, header.as(), header.media(), header.mimeType(), header.crossOrigin(), nullptr);
     }
 }
 
@@ -212,28 +211,8 @@
     return false;
 }
 
-void LinkLoader::preconnect(const LinkRelAttribute& relAttribute, const URL& href, Document& document, const String& crossOrigin)
+std::unique_ptr<LinkPreloadResourceClient> LinkLoader::preloadIfNeeded(const LinkRelAttribute& relAttribute, const URL& href, Document& document, const String& as, const String& media, const String& mimeType, const String& crossOriginMode, LinkLoader* loader)
 {
-    if (!relAttribute.isLinkPreconnect || !href.isValid() || !href.protocolIsInHTTPFamily() || !document.frame())
-        return;
-    ASSERT(document.settings().linkPreconnectEnabled());
-    StoredCredentialsPolicy storageCredentialsPolicy = StoredCredentialsPolicy::Use;
-    if (equalIgnoringASCIICase(crossOrigin, "anonymous") && document.securityOrigin().canAccess(SecurityOrigin::create(href)))
-        storageCredentialsPolicy = StoredCredentialsPolicy::DoNotUse;
-    ASSERT(document.frame()->loader().networkingContext());
-    platformStrategies()->loaderStrategy()->preconnectTo(*document.frame()->loader().networkingContext(), href, storageCredentialsPolicy, [weakDocument = document.createWeakPtr(), href](ResourceError error) {
-        if (!weakDocument)
-            return;
-
-        if (!error.isNull())
-            weakDocument->addConsoleMessage(MessageSource::Network, MessageLevel::Error, makeString(ASCIILiteral("Failed to preconnect to "), href.string(), ASCIILiteral(". Error: "), error.localizedDescription()));
-        else
-            weakDocument->addConsoleMessage(MessageSource::Network, MessageLevel::Info, makeString(ASCIILiteral("Successfuly preconnected to "), href.string()));
-    });
-}
-
-std::unique_ptr<LinkPreloadResourceClient> LinkLoader::preload(const LinkRelAttribute& relAttribute, const URL& href, Document& document, const String& as, const String& media, const String& mimeType, const String& crossOriginMode, LinkLoader* loader)
-{
     if (!document.loader() || !relAttribute.isLinkPreload)
         return nullptr;
 
@@ -280,10 +259,25 @@
             document.frame()->loader().client().prefetchDNS(href.host());
     }
 
-    preconnect(relAttribute, href, document, crossOrigin);
+    if (relAttribute.isLinkPreconnect && href.isValid() && href.protocolIsInHTTPFamily() && document.frame()) {
+        ASSERT(document.settings().linkPreconnectEnabled());
+        StoredCredentialsPolicy storageCredentialsPolicy = StoredCredentialsPolicy::Use;
+        if (equalIgnoringASCIICase(crossOrigin, "anonymous") && document.securityOrigin().canAccess(SecurityOrigin::create(href)))
+            storageCredentialsPolicy = StoredCredentialsPolicy::DoNotUse;
+        ASSERT(document.frame()->loader().networkingContext());
+        platformStrategies()->loaderStrategy()->preconnectTo(*document.frame()->loader().networkingContext(), href, storageCredentialsPolicy, [weakDocument = document.createWeakPtr(), href](ResourceError error) {
+            if (!weakDocument)
+                return;
 
+            if (!error.isNull())
+                weakDocument->addConsoleMessage(MessageSource::Network, MessageLevel::Error, makeString(ASCIILiteral("Failed to preconnect to "), href.string(), ASCIILiteral(". Error: "), error.localizedDescription()));
+            else
+                weakDocument->addConsoleMessage(MessageSource::Network, MessageLevel::Info, makeString(ASCIILiteral("Successfuly preconnected to "), href.string()));
+        });
+    }
+
     if (m_client.shouldLoadLink()) {
-        auto resourceClient = preload(relAttribute, href, document, as, media, mimeType, crossOrigin, this);
+        auto resourceClient = preloadIfNeeded(relAttribute, href, document, as, media, mimeType, crossOrigin, this);
         if (resourceClient)
             m_preloadResourceClient = WTFMove(resourceClient);
         else if (m_preloadResourceClient)

Modified: trunk/Source/WebCore/loader/LinkLoader.h (227004 => 227005)


--- trunk/Source/WebCore/loader/LinkLoader.h	2018-01-16 22:35:39 UTC (rev 227004)
+++ trunk/Source/WebCore/loader/LinkLoader.h	2018-01-16 22:52:47 UTC (rev 227005)
@@ -64,8 +64,7 @@
 
 private:
     void notifyFinished(CachedResource&) override;
-    static void preconnect(const LinkRelAttribute&, const URL& href, Document&, const String& crossOrigin);
-    static std::unique_ptr<LinkPreloadResourceClient> preload(const LinkRelAttribute&, const URL& href, Document&, const String& as, const String& media, const String& type, const String& crossOriginMode, LinkLoader*);
+    static std::unique_ptr<LinkPreloadResourceClient> preloadIfNeeded(const LinkRelAttribute&, const URL& href, Document&, const String& as, const String& media, const String& type, const String& crossOriginMode, LinkLoader*);
 
     LinkLoaderClient& m_client;
     CachedResourceHandle<CachedResource> m_cachedLinkResource;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to