Changeset 268872 in webkit
- Timestamp:
- Oct 22, 2020, 11:06:44 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 9 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/webaudio/audioworklet-addModule-cors.sub.https-expected.txt (added)
-
LayoutTests/http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html (added)
-
LayoutTests/http/wpt/webaudio/resources/dummy-worklet.py (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/fetch/FetchRequest.idl (modified) (1 diff)
-
Source/WebCore/loader/FetchOptions.h (modified) (4 diffs)
-
Source/WebCore/workers/WorkerScriptLoader.cpp (modified) (1 diff)
-
Source/WebCore/worklets/WorkletGlobalScope.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp (modified) (1 diff)
-
Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268866 r268872 1 2020-10-22 Youenn Fablet <youenn@apple.com> 2 3 Introduce worklet destinations and allow to fetch modules with CORS based on destination 4 https://bugs.webkit.org/show_bug.cgi?id=218019 5 <rdar://problem/70526201> 6 7 Reviewed by Chris Dumez. 8 9 * http/wpt/webaudio/audioworklet-addModule-cors.sub.https-expected.txt: Added. 10 * http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html: Added. 11 * http/wpt/webaudio/resources/dummy-worklet.py: Added. 12 (main): 13 (DummyProcessor): 14 1 15 2020-10-22 Aditya Keerthi <akeerthi@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r268869 r268872 1 2020-10-22 Youenn Fablet <youenn@apple.com> 2 3 Introduce worklet destinations and allow to fetch modules with CORS based on destination 4 https://bugs.webkit.org/show_bug.cgi?id=218019 5 <rdar://problem/70526201> 6 7 Reviewed by Chris Dumez. 8 9 Add support for audioworklet and paintworklet fetch destinations. 10 In case of those destinations, use cors mode instead of same-origin mode when fetching worklet top level module. 11 12 Test: http/wpt/webaudio/audioworklet-addModule-cors.sub.https.html 13 14 * Modules/fetch/FetchRequest.idl: 15 * loader/FetchOptions.h: 16 (WebCore::isScriptLikeDestination): 17 * workers/WorkerScriptLoader.cpp: 18 (WebCore::WorkerScriptLoader::loadAsynchronously): 19 * worklets/WorkletGlobalScope.cpp: 20 (WebCore::WorkletGlobalScope::processNextScriptFetchJobIfNeeded): 21 1 22 2020-10-22 Don Olmstead <don.olmstead@sony.com> 2 23 -
trunk/Source/WebCore/Modules/fetch/FetchRequest.idl
r267953 r268872 27 27 */ 28 28 29 enum FetchRequestDestination { "", "audio", " document", "embed", "font", "image", "manifest", "object", "report", "script", "serviceworker", "sharedworker", "style", "track", "video", "worker", "xslt" };29 enum FetchRequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "image", "manifest", "object", "paintworklet", "report", "script", "serviceworker", "sharedworker", "style", "track", "video", "worker", "xslt" }; 30 30 31 31 typedef (FetchRequest or USVString) RequestInfo; -
trunk/Source/WebCore/loader/FetchOptions.h
r260078 r268872 37 37 38 38 struct FetchOptions { 39 enum class Destination : uint8_t { EmptyString, Audio, Document, Embed, Font, Image, Manifest, Object, Report, Script, Serviceworker, Sharedworker, Style, Track, Video, Worker, Xslt };39 enum class Destination : uint8_t { EmptyString, Audio, Audioworklet, Document, Embed, Font, Image, Manifest, Object, Paintworklet, Report, Script, Serviceworker, Sharedworker, Style, Track, Video, Worker, Xslt }; 40 40 enum class Mode : uint8_t { Navigate, SameOrigin, NoCors, Cors }; 41 41 enum class Credentials : uint8_t { Omit, SameOrigin, Include }; … … 92 92 inline bool isScriptLikeDestination(FetchOptions::Destination destination) 93 93 { 94 return destination == FetchOptions::Destination::Script 94 return destination == FetchOptions::Destination::Audioworklet 95 || destination == FetchOptions::Destination::Paintworklet 96 || destination == FetchOptions::Destination::Script 95 97 || destination == FetchOptions::Destination::Serviceworker 96 98 || destination == FetchOptions::Destination::Worker; … … 106 108 WebCore::FetchOptions::Destination::EmptyString, 107 109 WebCore::FetchOptions::Destination::Audio, 110 WebCore::FetchOptions::Destination::Audioworklet, 108 111 WebCore::FetchOptions::Destination::Document, 109 112 WebCore::FetchOptions::Destination::Embed, … … 112 115 WebCore::FetchOptions::Destination::Manifest, 113 116 WebCore::FetchOptions::Destination::Object, 117 WebCore::FetchOptions::Destination::Paintworklet, 114 118 WebCore::FetchOptions::Destination::Report, 115 119 WebCore::FetchOptions::Destination::Script, -
trunk/Source/WebCore/workers/WorkerScriptLoader.cpp
r264724 r268872 120 120 return; 121 121 122 // Only used for loading worker scripts in classic mode. 122 // https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-single-module-script 123 ASSERT(fetchOptions.mode == FetchOptions::Mode::SameOrigin || (fetchOptions.destination != FetchOptions::Destination::Serviceworker && fetchOptions.destination != FetchOptions::Destination::Worker)); 124 125 ThreadableLoaderOptions options { WTFMove(fetchOptions) }; 123 126 // FIXME: We should add an option to set credential mode. 124 ASSERT(fetchOptions.mode == FetchOptions::Mode::SameOrigin);125 126 ThreadableLoaderOptions options { WTFMove(fetchOptions) };127 127 options.credentials = FetchOptions::Credentials::SameOrigin; 128 128 options.sendLoadCallbacks = SendCallbackPolicy::SendCallbacks; -
trunk/Source/WebCore/worklets/WorkletGlobalScope.cpp
r268822 r268872 172 172 173 173 FetchOptions fetchOptions; 174 fetchOptions.mode = FetchOptions::Mode:: SameOrigin;174 fetchOptions.mode = FetchOptions::Mode::Cors; 175 175 fetchOptions.cache = FetchOptions::Cache::Default; 176 176 fetchOptions.redirect = FetchOptions::Redirect::Follow; 177 fetchOptions.destination = FetchOptions::Destination::Worker;178 177 fetchOptions.credentials = scriptFetchJob.credentials; 178 #if ENABLE(WEB_AUDIO) 179 if (isAudioWorkletGlobalScope()) 180 fetchOptions.destination = FetchOptions::Destination::Audioworklet; 181 #endif 182 #if ENABLE(CSS_PAINTING_API) 183 if (isPaintWorkletGlobalScope()) 184 fetchOptions.destination = FetchOptions::Destination::Paintworklet; 185 #endif 179 186 180 187 auto contentSecurityPolicyEnforcement = shouldBypassMainWorldContentSecurityPolicy() ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceChildSrcDirective; -
trunk/Source/WebKit/ChangeLog
r268867 r268872 1 2020-10-22 Youenn Fablet <youenn@apple.com> 2 3 Introduce worklet destinations and allow to fetch modules with CORS based on destination 4 https://bugs.webkit.org/show_bug.cgi?id=218019 5 <rdar://problem/70526201> 6 7 Reviewed by Chris Dumez. 8 9 Add support to new fetch destinations in enumerations. 10 11 * NetworkProcess/NetworkLoadChecker.cpp: 12 (WebKit::NetworkLoadChecker::isAllowedByContentSecurityPolicy): 13 * NetworkProcess/NetworkResourceLoader.cpp: 14 (WebKit::NetworkResourceLoader::resourceLoadInfo): 15 1 16 2020-10-22 Nitzan Uziely <linkgoron@gmail.com> 2 17 -
trunk/Source/WebKit/NetworkProcess/NetworkLoadChecker.cpp
r260707 r268872 309 309 auto redirectResponseReceived = isRedirected() ? ContentSecurityPolicy::RedirectResponseReceived::Yes : ContentSecurityPolicy::RedirectResponseReceived::No; 310 310 switch (m_options.destination) { 311 case FetchOptions::Destination::Audioworklet: 312 case FetchOptions::Destination::Paintworklet: 311 313 case FetchOptions::Destination::Worker: 312 314 case FetchOptions::Destination::Serviceworker: -
trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
r268017 r268872 381 381 case WebCore::FetchOptions::Destination::Audio: 382 382 return ResourceLoadInfo::Type::Media; 383 case WebCore::FetchOptions::Destination::Audioworklet: 384 return ResourceLoadInfo::Type::Other; 383 385 case WebCore::FetchOptions::Destination::Document: 384 386 return ResourceLoadInfo::Type::Document; … … 393 395 case WebCore::FetchOptions::Destination::Object: 394 396 return ResourceLoadInfo::Type::Object; 397 case WebCore::FetchOptions::Destination::Paintworklet: 398 return ResourceLoadInfo::Type::Other; 395 399 case WebCore::FetchOptions::Destination::Report: 396 400 return ResourceLoadInfo::Type::CSPReport;
Note:
See TracChangeset
for help on using the changeset viewer.