LayoutTests/imported/w3c:
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 May 2017 22:53:13 +0000 (22:53 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 May 2017 22:53:13 +0000 (22:53 +0000)
commite22d30592246666df2658d1edfa435c0317bba48
treee2c203dcbc5a87da3d1055ec4bae0ced8e363435
parent430e61a7ed8a0fec5a03dae5efeba357d9a3f65f
LayoutTests/imported/w3c:
Implement Subresource Integrity (SRI)
https://bugs.webkit.org/show_bug.cgi?id=148363
<rdar://problem/18945879>

Reviewed by Youenn Fablet.

* web-platform-tests/fetch/api/basic/integrity-expected.txt:
* web-platform-tests/fetch/api/basic/integrity-worker-expected.txt:
Update results now that integrity is implemented.

Source/WebCore:
Implement Subresource Integrity (SRI) [Part 2 - Fetch]
https://bugs.webkit.org/show_bug.cgi?id=148363
<rdar://problem/18945879>

Reviewed by Youenn Fablet.

Tests: http/tests/subresource-integrity/sri-fetch-worker.html
       http/tests/subresource-integrity/sri-fetch.html

* loader/FetchOptions.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::isolatedCopy):
* loader/ThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::LoaderTaskOptions::LoaderTaskOptions):
Add integrity metadata to the fetch options, and fix the implementation of
ThreadableLoaderOptions::isolatedCopy to work correctly (it was missing isolated
copy derivedCachedDataTypesToRetrieve).

* Modules/fetch/FetchRequest.cpp:
(WebCore::buildOptions):
(WebCore::FetchRequest::initializeOptions):
* Modules/fetch/FetchRequest.h:
Switch to using the integrity metadata on the fetchOptions, removing the need to
store them directly on the internal request.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::didReceiveResponse):
(WebCore::DocumentThreadableLoader::didReceiveData):
(WebCore::DocumentThreadableLoader::didFinishLoading):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::DocumentThreadableLoader::reportIntegrityMetadataError):
* loader/DocumentThreadableLoader.h:
Add a new flag, m_delayCallbacksForIntegrityCheck, which is used when integrity metadata
is present, so we can implement the 'wait' concept from the fetch spec, and delay informing
the clients until we have validated the integrity metadata.

LayoutTests:
Implement Subresource Integrity (SRI)
https://bugs.webkit.org/show_bug.cgi?id=148363
<rdar://problem/18945879>

Reviewed by Youenn Fablet.

Add tests for Subresource Integrity for Fetch based off the ones from Web
Platform Tests. Additional tests for more CORS combinations have been added.

* http/tests/subresource-integrity/resources/crossorigin-anon-resource.txt: Added.
* http/tests/subresource-integrity/resources/crossorigin-creds-resource.txt: Added.
* http/tests/subresource-integrity/resources/crossorigin-ineligible-resource.txt: Added.
* http/tests/subresource-integrity/resources/resource.txt: Added.
* http/tests/subresource-integrity/sri-fetch-expected.txt: Added.
* http/tests/subresource-integrity/sri-fetch-worker-expected.txt: Added.
* http/tests/subresource-integrity/sri-fetch-worker.html: Added.
* http/tests/subresource-integrity/sri-fetch.html: Added.
* http/tests/subresource-integrity/sri-fetch.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@216553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/subresource-integrity/resources/crossorigin-anon-resource.txt [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/resources/crossorigin-creds-resource.txt [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/resources/crossorigin-ineligible-resource.txt [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/resources/resource.txt [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/sri-fetch-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/sri-fetch-worker-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/sri-fetch-worker.html [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/sri-fetch.html [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/sri-fetch.js [new file with mode: 0644]
LayoutTests/http/tests/subresource-integrity/sri-script.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity-expected.txt
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity-worker-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchRequest.cpp
Source/WebCore/Modules/fetch/FetchRequest.h
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/DocumentThreadableLoader.h
Source/WebCore/loader/FetchOptions.h
Source/WebCore/loader/ThreadableLoader.cpp
Source/WebCore/loader/ThreadableLoader.h
Source/WebCore/loader/WorkerThreadableLoader.cpp