Changeset 289483 in webkit
- Timestamp:
- Feb 9, 2022 10:30:28 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 29 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/workers/baseurl/alpha/importScripts-in-sharedworker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/workers/baseurl/alpha/xhr-in-sharedworker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/location/redirect-sharedworker-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-redirected-sharedworker-origin-expected.txt (modified) (1 diff)
-
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/xhr/open-url-redirected-sharedworker-origin-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/DocumentThreadableLoader.cpp (modified) (1 diff)
-
Source/WebCore/loader/ThreadableLoaderClient.h (modified) (1 diff)
-
Source/WebCore/loader/ThreadableLoaderClientWrapper.h (modified) (1 diff)
-
Source/WebCore/loader/WorkerThreadableLoader.cpp (modified) (1 diff)
-
Source/WebCore/loader/WorkerThreadableLoader.h (modified) (1 diff)
-
Source/WebCore/workers/Worker.cpp (modified) (1 diff)
-
Source/WebCore/workers/WorkerFetchResult.h (modified) (5 diffs)
-
Source/WebCore/workers/WorkerScriptLoader.cpp (modified) (5 diffs)
-
Source/WebCore/workers/WorkerScriptLoader.h (modified) (4 diffs)
-
Source/WebCore/workers/service/ServiceWorkerContainer.cpp (modified) (2 diffs)
-
Source/WebCore/workers/service/ServiceWorkerContainer.h (modified) (1 diff)
-
Source/WebCore/workers/service/ServiceWorkerJob.cpp (modified) (2 diffs)
-
Source/WebCore/workers/service/ServiceWorkerJobClient.h (modified) (2 diffs)
-
Source/WebCore/workers/shared/SharedWorkerScriptLoader.cpp (modified) (1 diff)
-
Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp (modified) (2 diffs)
-
Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp (modified) (1 diff)
-
Source/WebKit/NetworkProcess/SharedWorker/WebSharedWorkerServerToContextConnection.cpp (modified) (1 diff)
-
Source/WebKit/WebProcess/Storage/WebSharedWorkerContextManagerConnection.cpp (modified) (2 diffs)
-
Source/WebKit/WebProcess/Storage/WebSharedWorkerContextManagerConnection.h (modified) (1 diff)
-
Source/WebKit/WebProcess/Storage/WebSharedWorkerContextManagerConnection.messages.in (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r289479 r289483 1 2022-02-09 Chris Dumez <cdumez@apple.com> 2 3 self.location.href is incorrect in shared workers in case of redirects 4 https://bugs.webkit.org/show_bug.cgi?id=236340 5 6 Reviewed by Geoffrey Garen. 7 8 Rebaseline WPT tests that are now passing. 9 10 * web-platform-tests/workers/baseurl/alpha/importScripts-in-sharedworker-expected.txt: 11 * web-platform-tests/workers/baseurl/alpha/xhr-in-sharedworker-expected.txt: 12 * web-platform-tests/workers/interfaces/WorkerGlobalScope/location/redirect-sharedworker-expected.txt: 13 1 14 2022-02-09 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/baseurl/alpha/importScripts-in-sharedworker-expected.txt
r286821 r289483 1 1 2 FAIL importScripts assert_equals: expected "gamma/script.js" but got "beta/script.js" 2 PASS importScripts 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/baseurl/alpha/xhr-in-sharedworker-expected.txt
r286821 r289483 1 1 2 FAIL xhr-worker assert_equals: expected "gamma\n" but got "beta\n" 2 PASS xhr-worker 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/location/redirect-sharedworker-expected.txt
r286821 r289483 1 1 2 FAIL redirect assert_equals: expected "/workers/interfaces/WorkerGlobalScope/location/redirect.js" but got "/common/redirect.py" 2 PASS redirect 3 3 -
trunk/LayoutTests/imported/w3c/web-platform-tests/xhr/open-url-redirected-sharedworker-origin-expected.txt
r289247 r289483 1 1 2 FAIL Referer header assert_equals: expected "Referer: http://localhost:8800/xhr/resources/workerxhr-origin-referrer.js\n" but got "Referer: http://localhost:8800/xhr/resources/redirect.py?location=workerxhr-origin-referrer.js\n" 2 PASS Referer header 3 3 FAIL Origin header assert_equals: expected "Origin: http://localhost:8800\n" but got "" 4 4 PASS Request URL test -
trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/xhr/open-url-redirected-sharedworker-origin-expected.txt
r289247 r289483 1 1 2 FAIL Referer header assert_equals: expected "Referer: http://localhost:8800/xhr/resources/workerxhr-origin-referrer.js\n" but got "Referer: http://localhost:8800/xhr/resources/redirect.py?location=workerxhr-origin-referrer.js\n" 2 PASS Referer header 3 3 PASS Origin header 4 4 PASS Request URL test -
trunk/Source/WebCore/ChangeLog
r289480 r289483 1 2022-02-09 Chris Dumez <cdumez@apple.com> 2 3 self.location.href is incorrect in shared workers in case of redirects 4 https://bugs.webkit.org/show_bug.cgi?id=236340 5 6 Reviewed by Geoffrey Garen. 7 8 self.location.href is incorrect in shared workers in case of redirects. It should be 9 the URL of the last request, not the first one. 10 11 No new tests, rebaselined existing tests. 12 13 * loader/DocumentThreadableLoader.cpp: 14 (WebCore::DocumentThreadableLoader::redirectReceived): 15 * loader/ThreadableLoaderClient.h: 16 (WebCore::ThreadableLoaderClient::redirectReceived): 17 * loader/ThreadableLoaderClientWrapper.h: 18 (WebCore::ThreadableLoaderClientWrapper::redirectReceived): 19 * loader/WorkerThreadableLoader.cpp: 20 (WebCore::WorkerThreadableLoader::MainThreadBridge::redirectReceived): 21 * loader/WorkerThreadableLoader.h: 22 * workers/Worker.cpp: 23 (WebCore::Worker::notifyFinished): 24 * workers/WorkerFetchResult.h: 25 (WebCore::WorkerFetchResult::isolatedCopy const): 26 (WebCore::workerFetchError): 27 (WebCore::WorkerFetchResult::encode const): 28 (WebCore::WorkerFetchResult::decode): 29 * workers/WorkerScriptLoader.cpp: 30 (WebCore::WorkerScriptLoader::loadSynchronously): 31 (WebCore::WorkerScriptLoader::loadAsynchronously): 32 (WebCore::WorkerScriptLoader::redirectReceived): 33 (WebCore::WorkerScriptLoader::fetchResult const): 34 * workers/WorkerScriptLoader.h: 35 (WebCore::WorkerScriptLoader::script const): 36 (WebCore::WorkerScriptLoader::lastRequestURL const): 37 (WebCore::WorkerScriptLoader::script): Deleted. 38 * workers/service/ServiceWorkerContainer.cpp: 39 (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): 40 * workers/service/ServiceWorkerContainer.h: 41 * workers/service/ServiceWorkerJob.cpp: 42 (WebCore::ServiceWorkerJob::notifyFinished): 43 * workers/service/ServiceWorkerJobClient.h: 44 * workers/shared/SharedWorkerScriptLoader.cpp: 45 (WebCore::SharedWorkerScriptLoader::notifyFinished): 46 * workers/shared/context/SharedWorkerThreadProxy.cpp: 47 (WebCore::generateWorkerParameters): 48 (WebCore::SharedWorkerThreadProxy::SharedWorkerThreadProxy): 49 * workers/shared/context/SharedWorkerThreadProxy.h: 50 1 51 2022-02-09 Philippe Normand <pnormand@igalia.com> 2 52 -
trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp
r288701 r289483 315 315 --m_options.maxRedirectCount; 316 316 317 if (m_client) 318 m_client->redirectReceived(request.url()); 319 317 320 // FIXME: We restrict this check to Fetch API for the moment, as this might disrupt WorkerScriptLoader. 318 321 // Reassess this check based on https://github.com/whatwg/fetch/issues/393 discussions. -
trunk/Source/WebCore/loader/ThreadableLoaderClient.h
r288088 r289483 46 46 virtual void didSendData(unsigned long long /*bytesSent*/, unsigned long long /*totalBytesToBeSent*/) { } 47 47 48 virtual void redirectReceived(const URL& /*redirectURL*/) { } 48 49 virtual void didReceiveResponse(ResourceLoaderIdentifier, const ResourceResponse&) { } 49 50 virtual void didReceiveData(const SharedBuffer&) { } -
trunk/Source/WebCore/loader/ThreadableLoaderClientWrapper.h
r288088 r289483 53 53 { 54 54 return m_done; 55 } 56 57 void redirectReceived(const URL& redirectURL) 58 { 59 if (m_client) 60 m_client->redirectReceived(redirectURL); 55 61 } 56 62 -
trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp
r288088 r289483 212 212 } 213 213 214 void WorkerThreadableLoader::MainThreadBridge::redirectReceived(const URL& redirectURL) 215 { 216 m_loaderProxy.postTaskForModeToWorkerOrWorkletGlobalScope([protectedWorkerClientWrapper = Ref { *m_workerClientWrapper }, redirectURL = redirectURL.isolatedCopy()] (ScriptExecutionContext& context) mutable { 217 ASSERT_UNUSED(context, context.isWorkerGlobalScope() || context.isWorkletGlobalScope()); 218 protectedWorkerClientWrapper->redirectReceived(redirectURL); 219 }, m_taskMode); 220 } 221 214 222 void WorkerThreadableLoader::MainThreadBridge::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) 215 223 { -
trunk/Source/WebCore/loader/WorkerThreadableLoader.h
r288088 r289483 104 104 105 105 // All executed on the main thread. 106 void redirectReceived(const URL& redirectURL) override; 106 107 void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override; 107 108 void didReceiveResponse(ResourceLoaderIdentifier, const ResourceResponse&) override; -
trunk/Source/WebCore/workers/Worker.cpp
r288701 r289483 214 214 referrerPolicy = *policy; 215 215 216 URL responseURL = m_scriptLoader->responseURL(); 217 if (!m_scriptLoader->isRedirected() && m_scriptLoader->responseSource() != ResourceResponse::Source::ServiceWorker) { 218 if (m_scriptLoader->url().hasFragmentIdentifier()) 219 responseURL.setFragmentIdentifier(m_scriptLoader->url().fragmentIdentifier()); 220 } 221 m_contextProxy.startWorkerGlobalScope(responseURL, m_options.name, context->userAgent(responseURL), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_scriptLoader->crossOriginEmbedderPolicy(), m_workerCreationTime, referrerPolicy, m_options.type, m_options.credentials, m_runtimeFlags); 216 m_contextProxy.startWorkerGlobalScope(m_scriptLoader->lastRequestURL(), m_options.name, context->userAgent(m_scriptLoader->lastRequestURL()), isOnline, m_scriptLoader->script(), contentSecurityPolicyResponseHeaders, m_shouldBypassMainWorldContentSecurityPolicy, m_scriptLoader->crossOriginEmbedderPolicy(), m_workerCreationTime, referrerPolicy, m_options.type, m_options.credentials, m_runtimeFlags); 222 217 InspectorInstrumentation::scriptImported(*context, m_scriptLoader->identifier(), m_scriptLoader->script().toString()); 223 218 } -
trunk/Source/WebCore/workers/WorkerFetchResult.h
r288938 r289483 36 36 struct WorkerFetchResult { 37 37 ScriptBuffer script; 38 URL lastRequestURL; // Last URL in case of redirects. 38 39 CertificateInfo certificateInfo; 39 40 ContentSecurityPolicyResponseHeaders contentSecurityPolicy; … … 42 43 ResourceError error; 43 44 44 WorkerFetchResult isolatedCopy() const { return { script.isolatedCopy(), certificateInfo.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), crossOriginEmbedderPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), error.isolatedCopy() }; }45 WorkerFetchResult isolatedCopy() const { return { script.isolatedCopy(), lastRequestURL.isolatedCopy(), certificateInfo.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), crossOriginEmbedderPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), error.isolatedCopy() }; } 45 46 46 47 template<class Encoder> void encode(Encoder&) const; … … 50 51 inline WorkerFetchResult workerFetchError(const ResourceError& error) 51 52 { 52 return { { }, { }, { }, { }, { }, error };53 return { { }, { }, { }, { }, { }, { }, error }; 53 54 } 54 55 … … 56 57 void WorkerFetchResult::encode(Encoder& encoder) const 57 58 { 58 encoder << script << contentSecurityPolicy << crossOriginEmbedderPolicy << referrerPolicy << error << certificateInfo;59 encoder << script << lastRequestURL << contentSecurityPolicy << crossOriginEmbedderPolicy << referrerPolicy << error << certificateInfo; 59 60 } 60 61 … … 63 64 { 64 65 if (!decoder.decode(result.script)) 66 return false; 67 if (!decoder.decode(result.lastRequestURL)) 65 68 return false; 66 69 if (!decoder.decode(result.contentSecurityPolicy)) -
trunk/Source/WebCore/workers/WorkerScriptLoader.cpp
r288088 r289483 38 38 #include "ServiceWorkerGlobalScope.h" 39 39 #include "TextResourceDecoder.h" 40 #include "WorkerFetchResult.h" 40 41 #include "WorkerGlobalScope.h" 41 42 #include "WorkerScriptLoaderClient.h" … … 58 59 59 60 m_url = url; 61 m_lastRequestURL = url; 60 62 m_destination = FetchOptions::Destination::Script; 61 63 m_isCOEPEnabled = scriptExecutionContext->settingsValues().crossOriginEmbedderPolicyEnabled; … … 117 119 m_client = &client; 118 120 m_url = scriptRequest.url(); 121 m_lastRequestURL = scriptRequest.url(); 119 122 m_destination = fetchOptions.destination; 120 123 m_isCOEPEnabled = scriptExecutionContext.settingsValues().crossOriginEmbedderPolicyEnabled; … … 177 180 178 181 return { }; 182 } 183 184 void WorkerScriptLoader::redirectReceived(const URL& redirectURL) 185 { 186 m_lastRequestURL = redirectURL; 179 187 } 180 188 … … 267 275 } 268 276 277 WorkerFetchResult WorkerScriptLoader::fetchResult() const 278 { 279 if (m_failed) 280 return workerFetchError(error()); 281 return { script(), lastRequestURL(), certificateInfo(), contentSecurityPolicy(), crossOriginEmbedderPolicy(), referrerPolicy(), { } }; 282 } 283 269 284 } // namespace WebCore -
trunk/Source/WebCore/workers/WorkerScriptLoader.h
r288088 r289483 50 50 class TextResourceDecoder; 51 51 class WorkerScriptLoaderClient; 52 struct WorkerFetchResult; 52 53 enum class CertificateInfoPolicy : uint8_t; 53 54 … … 65 66 void notifyError(); 66 67 67 const ScriptBuffer& script() { return m_script; }68 const ScriptBuffer& script() const { return m_script; } 68 69 const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy() const { return m_contentSecurityPolicy; } 69 70 const String& referrerPolicy() const { return m_referrerPolicy; } 70 71 const CrossOriginEmbedderPolicy& crossOriginEmbedderPolicy() const { return m_crossOriginEmbedderPolicy; } 71 72 const URL& url() const { return m_url; } 73 const URL& lastRequestURL() const { return m_lastRequestURL; } 72 74 const URL& responseURL() const; 73 75 ResourceResponse::Source responseSource() const { return m_responseSource; } … … 79 81 const ResourceError& error() const { return m_error; } 80 82 83 WorkerFetchResult fetchResult() const; 84 85 void redirectReceived(const URL& redirectURL) override; 81 86 void didReceiveResponse(ResourceLoaderIdentifier, const ResourceResponse&) override; 82 87 void didReceiveData(const SharedBuffer&) override; … … 104 109 ScriptBuffer m_script; 105 110 URL m_url; 111 URL m_lastRequestURL; 106 112 URL m_responseURL; 107 113 CertificateInfo m_certificateInfo; -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r288938 r289483 492 492 } 493 493 494 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const ScriptBuffer& script, const CertificateInfo& certificateInfo, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const CrossOriginEmbedderPolicy& coep, const String& referrerPolicy)494 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const WorkerFetchResult& fetchResult) 495 495 { 496 496 ASSERT(m_creationThread.ptr() == &Thread::current()); … … 498 498 CONTAINER_RELEASE_LOG("jobFinishedLoadingScript: Successfuly finished fetching script for job %" PRIu64, job.identifier().toUInt64()); 499 499 500 ensureSWClientConnection().finishFetchingScriptInServer(job.data().identifier(), job.data().registrationKey(), WorkerFetchResult { script, certificateInfo, contentSecurityPolicy, coep, referrerPolicy, { } });500 ensureSWClientConnection().finishFetchingScriptInServer(job.data().identifier(), job.data().registrationKey(), fetchResult); 501 501 } 502 502 -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h
r288974 r289483 119 119 void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) final; 120 120 void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) final; 121 void jobFinishedLoadingScript(ServiceWorkerJob&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const CrossOriginEmbedderPolicy&, const String& referrerPolicy) final;121 void jobFinishedLoadingScript(ServiceWorkerJob&, const WorkerFetchResult&) final; 122 122 void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Exception&&) final; 123 123 -
trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp
r282712 r289483 38 38 #include "ServiceWorkerJobData.h" 39 39 #include "ServiceWorkerRegistration.h" 40 #include "WorkerFetchResult.h" 40 41 #include "WorkerRunLoop.h" 41 42 … … 166 167 167 168 if (!scriptLoader->failed()) { 168 m_client.jobFinishedLoadingScript(*this, scriptLoader-> script(), scriptLoader->certificateInfo(), scriptLoader->contentSecurityPolicy(), scriptLoader->crossOriginEmbedderPolicy(), scriptLoader->referrerPolicy());169 m_client.jobFinishedLoadingScript(*this, scriptLoader->fetchResult()); 169 170 return; 170 171 } -
trunk/Source/WebCore/workers/service/ServiceWorkerJobClient.h
r286012 r289483 40 40 struct CrossOriginEmbedderPolicy; 41 41 struct ServiceWorkerRegistrationData; 42 struct WorkerFetchResult; 42 43 43 44 class ServiceWorkerJobClient { … … 51 52 virtual void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) = 0; 52 53 virtual void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) = 0; 53 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const ScriptBuffer&, const CertificateInfo&, const ContentSecurityPolicyResponseHeaders&, const CrossOriginEmbedderPolicy&, const String& referrerPolicy) = 0;54 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const WorkerFetchResult&) = 0; 54 55 virtual void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Exception&&) = 0; 55 56 }; -
trunk/Source/WebCore/workers/shared/SharedWorkerScriptLoader.cpp
r289247 r289483 59 59 void SharedWorkerScriptLoader::notifyFinished() 60 60 { 61 if (m_loader->failed()) 62 return m_completionHandler(workerFetchError(m_loader->error())); 63 64 if (auto* scriptExecutionContext = m_worker->scriptExecutionContext()) 61 if (auto* scriptExecutionContext = m_worker->scriptExecutionContext(); !m_loader->failed()) 65 62 InspectorInstrumentation::scriptImported(*scriptExecutionContext, m_loader->identifier(), m_loader->script().toString()); 66 m_completionHandler( { m_loader->script(), m_loader->certificateInfo(), m_loader->contentSecurityPolicy(), m_loader->crossOriginEmbedderPolicy(), m_loader->referrerPolicy(), { } }); // deletes this.63 m_completionHandler(m_loader->fetchResult()); // deletes this. 67 64 } 68 65 -
trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp
r289247 r289483 56 56 } 57 57 58 static WorkerParameters generateWorkerParameters(const URL& scriptURL, constWorkerFetchResult& workerFetchResult, WorkerOptions&& workerOptions, const String& userAgent, Document& document)58 static WorkerParameters generateWorkerParameters(const WorkerFetchResult& workerFetchResult, WorkerOptions&& workerOptions, const String& userAgent, Document& document) 59 59 { 60 60 return WorkerParameters { 61 scriptURL,61 workerFetchResult.lastRequestURL, 62 62 workerOptions.name, 63 63 "sharedworker:" + Inspector::IdentifiersFactory::createIdentifier(), … … 75 75 } 76 76 77 SharedWorkerThreadProxy::SharedWorkerThreadProxy(UniqueRef<Page>&& page, SharedWorkerIdentifier sharedWorkerIdentifier, const ClientOrigin& clientOrigin, const URL& scriptURL,WorkerFetchResult&& workerFetchResult, WorkerOptions&& workerOptions, const String& userAgent, CacheStorageProvider& cacheStorageProvider)77 SharedWorkerThreadProxy::SharedWorkerThreadProxy(UniqueRef<Page>&& page, SharedWorkerIdentifier sharedWorkerIdentifier, const ClientOrigin& clientOrigin, WorkerFetchResult&& workerFetchResult, WorkerOptions&& workerOptions, const String& userAgent, CacheStorageProvider& cacheStorageProvider) 78 78 : m_page(WTFMove(page)) 79 79 , m_document(*m_page->mainFrame().document()) 80 , m_workerThread(SharedWorkerThread::create(sharedWorkerIdentifier, generateWorkerParameters( scriptURL,workerFetchResult, WTFMove(workerOptions), userAgent, m_document), WTFMove(workerFetchResult.script), *this, *this, *this, WorkerThreadStartMode::Normal, clientOrigin.topOrigin.securityOrigin(), m_document->idbConnectionProxy(), m_document->socketProvider(), JSC::RuntimeFlags::createAllEnabled()))80 , m_workerThread(SharedWorkerThread::create(sharedWorkerIdentifier, generateWorkerParameters(workerFetchResult, WTFMove(workerOptions), userAgent, m_document), WTFMove(workerFetchResult.script), *this, *this, *this, WorkerThreadStartMode::Normal, clientOrigin.topOrigin.securityOrigin(), m_document->idbConnectionProxy(), m_document->socketProvider(), JSC::RuntimeFlags::createAllEnabled())) 81 81 , m_cacheStorageProvider(cacheStorageProvider) 82 82 { -
trunk/Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.h
r289247 r289483 55 55 56 56 private: 57 WEBCORE_EXPORT SharedWorkerThreadProxy(UniqueRef<Page>&&, SharedWorkerIdentifier, const ClientOrigin&, const URL& scriptURL,WorkerFetchResult&&, WorkerOptions&&, const String& userAgent, CacheStorageProvider&);57 WEBCORE_EXPORT SharedWorkerThreadProxy(UniqueRef<Page>&&, SharedWorkerIdentifier, const ClientOrigin&, WorkerFetchResult&&, WorkerOptions&&, const String& userAgent, CacheStorageProvider&); 58 58 59 59 // WorkerObjectProxy. -
trunk/Source/WebKit/ChangeLog
r289482 r289483 1 2022-02-09 Chris Dumez <cdumez@apple.com> 2 3 self.location.href is incorrect in shared workers in case of redirects 4 https://bugs.webkit.org/show_bug.cgi?id=236340 5 6 Reviewed by Geoffrey Garen. 7 8 self.location.href is incorrect in shared workers in case of redirects. It should be the URL of 9 the last request, not the first one. 10 11 * NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp: 12 (WebKit::ServiceWorkerSoftUpdateLoader::didFinishLoading): 13 * NetworkProcess/SharedWorker/WebSharedWorkerServerToContextConnection.cpp: 14 (WebKit::WebSharedWorkerServerToContextConnection::launchSharedWorker): 15 * WebProcess/Storage/WebSharedWorkerContextManagerConnection.cpp: 16 (WebKit::WebSharedWorkerContextManagerConnection::launchSharedWorker): 17 * WebProcess/Storage/WebSharedWorkerContextManagerConnection.h: 18 * WebProcess/Storage/WebSharedWorkerContextManagerConnection.messages.in: 19 1 20 2022-02-09 J Pascoe <j_pascoe@apple.com> 2 21 -
trunk/Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerSoftUpdateLoader.cpp
r289018 r289483 197 197 if (m_decoder) 198 198 m_script.append(m_decoder->flush()); 199 m_completionHandler({ ScriptBuffer { m_script.toString() }, m_ certificateInfo, m_contentSecurityPolicy, m_crossOriginEmbedderPolicy, m_referrerPolicy, { } });199 m_completionHandler({ ScriptBuffer { m_script.toString() }, m_jobData.scriptURL, m_certificateInfo, m_contentSecurityPolicy, m_crossOriginEmbedderPolicy, m_referrerPolicy, { } }); 200 200 didComplete(); 201 201 } -
trunk/Source/WebKit/NetworkProcess/SharedWorker/WebSharedWorkerServerToContextConnection.cpp
r289469 r289483 91 91 CONTEXT_CONNECTION_RELEASE_LOG("launchSharedWorker: sharedWorkerIdentifier=%" PRIu64, sharedWorker.identifier().toUInt64()); 92 92 sharedWorker.markAsRunning(); 93 send(Messages::WebSharedWorkerContextManagerConnection::LaunchSharedWorker { sharedWorker.origin(), sharedWorker.identifier(), sharedWorker. url(), sharedWorker.workerOptions(), sharedWorker.fetchResult() });93 send(Messages::WebSharedWorkerContextManagerConnection::LaunchSharedWorker { sharedWorker.origin(), sharedWorker.identifier(), sharedWorker.workerOptions(), sharedWorker.fetchResult() }); 94 94 for (auto& port : sharedWorker.sharedWorkerObjects().values()) 95 95 postConnectEvent(sharedWorker, port); -
trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerContextManagerConnection.cpp
r289449 r289483 90 90 } 91 91 92 void WebSharedWorkerContextManagerConnection::launchSharedWorker(WebCore::ClientOrigin&& origin, WebCore::SharedWorkerIdentifier sharedWorkerIdentifier, URL&& url,WebCore::WorkerOptions&& workerOptions, WebCore::WorkerFetchResult&& workerFetchResult)92 void WebSharedWorkerContextManagerConnection::launchSharedWorker(WebCore::ClientOrigin&& origin, WebCore::SharedWorkerIdentifier sharedWorkerIdentifier, WebCore::WorkerOptions&& workerOptions, WebCore::WorkerFetchResult&& workerFetchResult) 93 93 { 94 94 RELEASE_LOG(SharedWorker, "WebSharedWorkerContextManagerConnection::launchSharedWorker: sharedWorkerIdentifier=%" PRIu64, sharedWorkerIdentifier.toUInt64()); … … 111 111 page->settings().setStorageBlockingPolicy(static_cast<WebCore::StorageBlockingPolicy>(m_preferencesStore->getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey()))); 112 112 } 113 page->setupForRemoteWorker( url, origin.topOrigin, workerFetchResult.referrerPolicy);114 auto sharedWorkerThreadProxy = WebCore::SharedWorkerThreadProxy::create(WTFMove(page), sharedWorkerIdentifier, origin, url,WTFMove(workerFetchResult), WTFMove(workerOptions), m_userAgent, WebProcess::singleton().cacheStorageProvider());113 page->setupForRemoteWorker(workerFetchResult.lastRequestURL, origin.topOrigin, workerFetchResult.referrerPolicy); 114 auto sharedWorkerThreadProxy = WebCore::SharedWorkerThreadProxy::create(WTFMove(page), sharedWorkerIdentifier, origin, WTFMove(workerFetchResult), WTFMove(workerOptions), m_userAgent, WebProcess::singleton().cacheStorageProvider()); 115 115 116 116 WebCore::SharedWorkerContextManager::singleton().registerSharedWorkerThread(WTFMove(sharedWorkerThreadProxy)); -
trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerContextManagerConnection.h
r289247 r289483 59 59 private: 60 60 // IPC Messages. 61 void launchSharedWorker(WebCore::ClientOrigin&&, WebCore::SharedWorkerIdentifier, URL&&,WebCore::WorkerOptions&&, WebCore::WorkerFetchResult&&);61 void launchSharedWorker(WebCore::ClientOrigin&&, WebCore::SharedWorkerIdentifier, WebCore::WorkerOptions&&, WebCore::WorkerFetchResult&&); 62 62 void updatePreferencesStore(const WebPreferencesStore&); 63 63 void setUserAgent(String&& userAgent) { m_userAgent = WTFMove(userAgent); } -
trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerContextManagerConnection.messages.in
r289247 r289483 22 22 23 23 messages -> WebSharedWorkerContextManagerConnection NotRefCounted { 24 LaunchSharedWorker(struct WebCore::ClientOrigin origin, WebCore::SharedWorkerIdentifier sharedWorkerIdentifier, URL url,struct WebCore::WorkerOptions workerOptions, struct WebCore::WorkerFetchResult workerFetchResult)24 LaunchSharedWorker(struct WebCore::ClientOrigin origin, WebCore::SharedWorkerIdentifier sharedWorkerIdentifier, struct WebCore::WorkerOptions workerOptions, struct WebCore::WorkerFetchResult workerFetchResult) 25 25 PostConnectEvent(WebCore::SharedWorkerIdentifier sharedWorkerIdentifier, WebCore::TransferredMessagePort port, String sourceOrigin) 26 26 TerminateSharedWorker(WebCore::SharedWorkerIdentifier sharedWorkerIdentifier)
Note: See TracChangeset
for help on using the changeset viewer.