Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2017 19:20:51 +0000 (19:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2017 19:20:51 +0000 (19:20 +0000)
commit05a6f807e4f8d56a0a3465cce9e6bb62403f4406
tree5307deecb35e9cec260f8d459eae49a2b3ab1848
parent734e8cae83c8f99e7ed9bd40c827d2fd0e469e6f
Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues with Inspector showing Resource
https://bugs.webkit.org/show_bug.cgi?id=165569
<rdar://problem/29607569>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-01-04
Reviewed by Youenn Fablet.

Source/WebCore:

Test: http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
* loader/ThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::LoaderTaskOptions::LoaderTaskOptions):
Add a new ThreadableLoader option to avoid filtering the response.

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
Disable filtering of the response. This is an internal load, we
don't want to filter data that would be valuable later.

LayoutTests:

* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt: Added.
* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html: Added.
* http/tests/inspector/worker/resources/worker-blob-import-script.js: Added.
* http/tests/inspector/worker/resources/worker-blob-script.js: Added.
Ensure cross origin scripts imported by workers still get the correct Script URL.
Also this provides a test for worker started with a blob URL.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@210279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html [new file with mode: 0644]
LayoutTests/http/tests/inspector/worker/resources/worker-blob-import-script.js [new file with mode: 0644]
LayoutTests/http/tests/inspector/worker/resources/worker-blob-script.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchLoader.cpp
Source/WebCore/loader/DocumentThreadableLoader.cpp
Source/WebCore/loader/ThreadableLoader.cpp
Source/WebCore/loader/ThreadableLoader.h
Source/WebCore/loader/WorkerThreadableLoader.cpp
Source/WebCore/workers/WorkerScriptLoader.cpp