Support for preconnect Link headers
authoryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Mar 2018 06:59:34 +0000 (06:59 +0000)
committeryoav@yoav.ws <yoav@yoav.ws@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Mar 2018 06:59:34 +0000 (06:59 +0000)
commit82a13b8c0684c4f82950d02b99ee1e0404188ad0
tree1b7c00720395d1978465588158f6cbc4754e260d
parentfa14bdcb80c7cb97bf250a06afe2903029748356
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657

Reviewed by Darin Adler.

Source/WebCore:

Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.

Test: http/tests/preconnect/link-header-rel-preconnect-http.php

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
(WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
* loader/LinkLoader.h:

LayoutTests:

Add test to see Link preconnect headers trigger a connection.

* http/tests/preconnect/link-header-rel-preconnect-http-expected.txt: Added.
* http/tests/preconnect/link-header-rel-preconnect-http.html: Added.
* http/tests/preconnect/resources/header-preconnect.php: Added.
* platform/win/TestExpectations: Skipped the preconnect test directory, rather than the individual files in it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229308 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/preconnect/link-header-rel-preconnect-http.html [new file with mode: 0644]
LayoutTests/http/tests/preconnect/resources/header-preconnect.php [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/loader/LinkLoader.cpp
Source/WebCore/loader/LinkLoader.h