Changeset 239659 in webkit
- Timestamp:
- Jan 5, 2019 12:51:14 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r239644 r239659 1 2019-01-05 Youenn Fablet <youenn@apple.com> 2 3 Service Worker fetch should obey its referrer policy 4 https://bugs.webkit.org/show_bug.cgi?id=193152 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/fetch/api/policies/referrer-origin-service-worker.https-expected.txt: 9 * web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt: 10 1 11 2019-01-04 Youenn Fablet <youenn@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/policies/referrer-origin-service-worker.https-expected.txt
r235025 r239659 1 1 2 2 PASS Fetch in service worker: referrer with no-referrer policy 3 FAIL Request's referrer is origin assert_equals: request's referrer is https://localhost:9443/ expected "https://localhost:9443/" but got "https://localhost:9443/fetch/api/policies/referrer-origin.js?pipe=sub" 4 FAIL Cross-origin referrer is overridden by client origin assert_equals: request's referrer is https://localhost:9443/ expected "https://localhost:9443/" but got "https://localhost:9443/fetch/api/policies/referrer-origin.js?pipe=sub" 3 PASS Request's referrer is origin 4 PASS Cross-origin referrer is overridden by client origin 5 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/referrer-policy-header.https-expected.txt
r238592 r239659 3 3 PASS Initialize global state (service worker registration) 4 4 FAIL Referrer for a main resource redirected with referrer-policy (origin) should only have origin. assert_equals: expected "https://localhost:9443/" but got "https://localhost:9443/service-workers/service-worker/referrer-policy-header.https.html" 5 FAIL Referrer for fetch requests initiated from a service worker with referrer-policy (origin) should only have origin. assert_equals: expected "finish" but got "failure:Referer for request-headers.py?url=request-headers.py must be https://localhost:9443/ but got https://localhost:9443/service-workers/service-worker/resources/fetch-rewrite-worker-referrer-policy.js" 5 PASS Referrer for fetch requests initiated from a service worker with referrer-policy (origin) should only have origin. 6 6 PASS Remove registration as a cleanup 7 7 -
trunk/Source/WebCore/ChangeLog
r239658 r239659 1 2019-01-05 Youenn Fablet <youenn@apple.com> 2 3 Service Worker fetch should obey its referrer policy 4 https://bugs.webkit.org/show_bug.cgi?id=193152 5 6 Reviewed by Chris Dumez. 7 8 Pass referrer policy retrieved when fetching the service worker script to the SWServer. 9 The SWServer then stores it persistently and sends it to the manager creating service workers. 10 This manager will then set the referrer policy on the dummy Document of the corresponding service worker. 11 12 Covered by rebased test. 13 14 * workers/WorkerScriptLoader.cpp: 15 (WebCore::WorkerScriptLoader::didReceiveResponse): 16 * workers/WorkerScriptLoader.h: 17 (WebCore::WorkerScriptLoader::referrerPolicy const): 18 * workers/service/SWClientConnection.cpp: 19 (WebCore::SWClientConnection::failedFetchingScript): 20 * workers/service/ServiceWorkerContainer.cpp: 21 (WebCore::ServiceWorkerContainer::jobFinishedLoadingScript): 22 * workers/service/ServiceWorkerContainer.h: 23 * workers/service/ServiceWorkerContextData.cpp: 24 (WebCore::ServiceWorkerContextData::isolatedCopy const): 25 * workers/service/ServiceWorkerContextData.h: 26 (WebCore::ServiceWorkerContextData::encode const): 27 (WebCore::ServiceWorkerContextData::decode): 28 * workers/service/ServiceWorkerFetchResult.h: 29 (WebCore::ServiceWorkerFetchResult::encode const): 30 (WebCore::ServiceWorkerFetchResult::decode): 31 * workers/service/ServiceWorkerJob.cpp: 32 (WebCore::ServiceWorkerJob::notifyFinished): 33 * workers/service/ServiceWorkerJobClient.h: 34 * workers/service/context/ServiceWorkerThreadProxy.cpp: 35 (WebCore::createPageForServiceWorker): 36 * workers/service/server/RegistrationDatabase.cpp: 37 (WebCore::recordsTableSchema): 38 (WebCore::RegistrationDatabase::doPushChanges): 39 (WebCore::RegistrationDatabase::importRecords): 40 * workers/service/server/SWServer.cpp: 41 (WebCore::SWServer::addRegistrationFromStore): 42 (WebCore::SWServer::updateWorker): 43 (WebCore::SWServer::installContextData): 44 * workers/service/server/SWServer.h: 45 * workers/service/server/SWServerJobQueue.cpp: 46 (WebCore::SWServerJobQueue::scriptFetchFinished): 47 * workers/service/server/SWServerWorker.cpp: 48 (WebCore::SWServerWorker::SWServerWorker): 49 (WebCore::SWServerWorker::contextData const): 50 * workers/service/server/SWServerWorker.h: 51 1 52 2019-01-04 Simon Fraser <simon.fraser@apple.com> 2 53 -
trunk/Source/WebCore/workers/WorkerScriptLoader.cpp
r239427 r239659 178 178 m_responseEncoding = response.textEncodingName(); 179 179 m_contentSecurityPolicy = ContentSecurityPolicyResponseHeaders { response }; 180 m_referrerPolicy = response.httpHeaderField(HTTPHeaderName::ReferrerPolicy); 180 181 if (m_client) 181 182 m_client->didReceiveResponse(identifier, response); -
trunk/Source/WebCore/workers/WorkerScriptLoader.h
r239427 r239659 62 62 String script(); 63 63 const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy() const { return m_contentSecurityPolicy; } 64 const String& referrerPolicy() const { return m_referrerPolicy; } 64 65 const URL& url() const { return m_url; } 65 66 const URL& responseURL() const; … … 95 96 FetchOptions::Destination m_destination; 96 97 ContentSecurityPolicyResponseHeaders m_contentSecurityPolicy; 98 String m_referrerPolicy; 97 99 unsigned long m_identifier { 0 }; 98 100 bool m_failed { false }; -
trunk/Source/WebCore/workers/service/SWClientConnection.cpp
r239427 r239659 60 60 ASSERT(isMainThread()); 61 61 62 finishFetchingScriptInServer({ { serverConnectionIdentifier(), jobIdentifier }, registrationKey, { }, { }, error });62 finishFetchingScriptInServer({ { serverConnectionIdentifier(), jobIdentifier }, registrationKey, { }, { }, { }, error }); 63 63 } 64 64 -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.cpp
r239427 r239659 520 520 } 521 521 522 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy )522 void ServiceWorkerContainer::jobFinishedLoadingScript(ServiceWorkerJob& job, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const String& referrerPolicy) 523 523 { 524 524 #ifndef NDEBUG … … 528 528 CONTAINER_RELEASE_LOG_IF_ALLOWED("jobFinishedLoadingScript: Successfuly finished fetching script for job %" PRIu64, job.identifier().toUInt64()); 529 529 530 callOnMainThread([connection = m_swConnection, jobDataIdentifier = job.data().identifier(), registrationKey = job.data().registrationKey().isolatedCopy(), script = script.isolatedCopy(), contentSecurityPolicy = contentSecurityPolicy.isolatedCopy() ] {531 connection->finishFetchingScriptInServer({ jobDataIdentifier, registrationKey, script, contentSecurityPolicy, { } });530 callOnMainThread([connection = m_swConnection, jobDataIdentifier = job.data().identifier(), registrationKey = job.data().registrationKey().isolatedCopy(), script = script.isolatedCopy(), contentSecurityPolicy = contentSecurityPolicy.isolatedCopy(), referrerPolicy = referrerPolicy.isolatedCopy()] { 531 connection->finishFetchingScriptInServer({ jobDataIdentifier, registrationKey, script, contentSecurityPolicy, referrerPolicy, { } }); 532 532 }); 533 533 } -
trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h
r239427 r239659 96 96 void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) final; 97 97 void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) final; 98 void jobFinishedLoadingScript(ServiceWorkerJob&, const String& script, const ContentSecurityPolicyResponseHeaders& ) final;98 void jobFinishedLoadingScript(ServiceWorkerJob&, const String& script, const ContentSecurityPolicyResponseHeaders&, const String& referrerPolicy) final; 99 99 void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Optional<Exception>&&) final; 100 100 -
trunk/Source/WebCore/workers/service/ServiceWorkerContextData.cpp
r232516 r239659 34 34 ServiceWorkerContextData ServiceWorkerContextData::isolatedCopy() const 35 35 { 36 return { jobDataIdentifier, registration.isolatedCopy(), serviceWorkerIdentifier, script.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), scriptURL.isolatedCopy(), workerType, sessionID, loadedFromDisk, crossThreadCopy(scriptResourceMap) };36 return { jobDataIdentifier, registration.isolatedCopy(), serviceWorkerIdentifier, script.isolatedCopy(), contentSecurityPolicy.isolatedCopy(), referrerPolicy.isolatedCopy(), scriptURL.isolatedCopy(), workerType, sessionID, loadedFromDisk, crossThreadCopy(scriptResourceMap) }; 37 37 } 38 38 -
trunk/Source/WebCore/workers/service/ServiceWorkerContextData.h
r239427 r239659 76 76 String script; 77 77 ContentSecurityPolicyResponseHeaders contentSecurityPolicy; 78 String referrerPolicy; 78 79 URL scriptURL; 79 80 WorkerType workerType; … … 91 92 void ServiceWorkerContextData::encode(Encoder& encoder) const 92 93 { 93 encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << contentSecurityPolicy << scriptURL << workerType << sessionID << loadedFromDisk;94 encoder << jobDataIdentifier << registration << serviceWorkerIdentifier << script << contentSecurityPolicy << referrerPolicy << scriptURL << workerType << sessionID << loadedFromDisk; 94 95 encoder << scriptResourceMap; 95 96 } … … 120 121 return WTF::nullopt; 121 122 123 String referrerPolicy; 124 if (!decoder.decode(referrerPolicy)) 125 return WTF::nullopt; 126 122 127 URL scriptURL; 123 128 if (!decoder.decode(scriptURL)) … … 140 145 return WTF::nullopt; 141 146 142 return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove( scriptURL), workerType, sessionID, loadedFromDisk, WTFMove(scriptResourceMap) }};147 return {{ WTFMove(*jobDataIdentifier), WTFMove(*registration), WTFMove(*serviceWorkerIdentifier), WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(referrerPolicy), WTFMove(scriptURL), workerType, sessionID, loadedFromDisk, WTFMove(scriptResourceMap) }}; 143 148 } 144 149 -
trunk/Source/WebCore/workers/service/ServiceWorkerFetchResult.h
r239427 r239659 40 40 String script; 41 41 ContentSecurityPolicyResponseHeaders contentSecurityPolicy; 42 String referrerPolicy; 42 43 ResourceError scriptError; 43 44 … … 49 50 void ServiceWorkerFetchResult::encode(Encoder& encoder) const 50 51 { 51 encoder << jobDataIdentifier << registrationKey << script << contentSecurityPolicy << scriptError;52 encoder << jobDataIdentifier << registrationKey << script << contentSecurityPolicy << referrerPolicy << scriptError; 52 53 } 53 54 … … 70 71 if (!decoder.decode(result.contentSecurityPolicy)) 71 72 return false; 73 if (!decoder.decode(result.referrerPolicy)) 74 return false; 72 75 if (!decoder.decode(result.scriptError)) 73 76 return false; -
trunk/Source/WebCore/workers/service/ServiceWorkerJob.cpp
r239427 r239659 147 147 148 148 if (!m_scriptLoader->failed()) 149 m_client->jobFinishedLoadingScript(*this, m_scriptLoader->script(), m_scriptLoader->contentSecurityPolicy() );149 m_client->jobFinishedLoadingScript(*this, m_scriptLoader->script(), m_scriptLoader->contentSecurityPolicy(), m_scriptLoader->referrerPolicy()); 150 150 else { 151 151 auto& error = m_scriptLoader->error(); -
trunk/Source/WebCore/workers/service/ServiceWorkerJobClient.h
r239427 r239659 50 50 virtual void jobResolvedWithUnregistrationResult(ServiceWorkerJob&, bool unregistrationResult) = 0; 51 51 virtual void startScriptFetchForJob(ServiceWorkerJob&, FetchOptions::Cache) = 0; 52 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const String& script, const ContentSecurityPolicyResponseHeaders& ) = 0;52 virtual void jobFinishedLoadingScript(ServiceWorkerJob&, const String& script, const ContentSecurityPolicyResponseHeaders&, const String& referrerPolicy) = 0; 53 53 virtual void jobFailedLoadingScript(ServiceWorkerJob&, const ResourceError&, Optional<Exception>&&) = 0; 54 54 -
trunk/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
r239427 r239659 70 70 document->setFirstPartyForCookies(data.scriptURL); 71 71 document->setDomainForCachePartition(origin->domainForCachePartition()); 72 73 if (auto policy = parseReferrerPolicy(data.referrerPolicy, ReferrerPolicySource::HTTPHeader)) 74 document->setReferrerPolicy(*policy); 75 72 76 mainFrame.setDocument(WTFMove(document)); 73 77 return page; -
trunk/Source/WebCore/workers/service/server/RegistrationDatabase.cpp
r239427 r239659 49 49 namespace WebCore { 50 50 51 static const uint64_t schemaVersion = 3;51 static const uint64_t schemaVersion = 4; 52 52 53 53 static const String recordsTableSchema(const String& tableName) 54 54 { 55 return makeString("CREATE TABLE ", tableName, " (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE, origin TEXT NOT NULL ON CONFLICT FAIL, scopeURL TEXT NOT NULL ON CONFLICT FAIL, topOrigin TEXT NOT NULL ON CONFLICT FAIL, lastUpdateCheckTime DOUBLE NOT NULL ON CONFLICT FAIL, updateViaCache TEXT NOT NULL ON CONFLICT FAIL, scriptURL TEXT NOT NULL ON CONFLICT FAIL, script TEXT NOT NULL ON CONFLICT FAIL, workerType TEXT NOT NULL ON CONFLICT FAIL, contentSecurityPolicy BLOB NOT NULL ON CONFLICT FAIL, scriptResourceMap BLOB NOT NULL ON CONFLICT FAIL)");55 return makeString("CREATE TABLE ", tableName, " (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE, origin TEXT NOT NULL ON CONFLICT FAIL, scopeURL TEXT NOT NULL ON CONFLICT FAIL, topOrigin TEXT NOT NULL ON CONFLICT FAIL, lastUpdateCheckTime DOUBLE NOT NULL ON CONFLICT FAIL, updateViaCache TEXT NOT NULL ON CONFLICT FAIL, scriptURL TEXT NOT NULL ON CONFLICT FAIL, script TEXT NOT NULL ON CONFLICT FAIL, workerType TEXT NOT NULL ON CONFLICT FAIL, contentSecurityPolicy BLOB NOT NULL ON CONFLICT FAIL, referrerPolicy TEXT NOT NULL ON CONFLICT FAIL, scriptResourceMap BLOB NOT NULL ON CONFLICT FAIL)"); 56 56 } 57 57 … … 306 306 transaction.begin(); 307 307 308 SQLiteStatement sql(*m_database, "INSERT INTO Records VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )"_s);308 SQLiteStatement sql(*m_database, "INSERT INTO Records VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"_s); 309 309 if (sql.prepare() != SQLITE_OK) { 310 310 RELEASE_LOG_ERROR(ServiceWorker, "Failed to prepare statement to store registration data into records table (%i) - %s", m_database->lastError(), m_database->lastErrorMsg()); … … 341 341 || sql.bindText(9, workerTypeToString(data.workerType)) != SQLITE_OK 342 342 || sql.bindBlob(10, cspEncoder.buffer(), cspEncoder.bufferSize()) != SQLITE_OK 343 || sql.bindBlob(11, scriptResourceMapEncoder.buffer(), scriptResourceMapEncoder.bufferSize()) != SQLITE_OK 343 || sql.bindText(11, data.referrerPolicy) != SQLITE_OK 344 || sql.bindBlob(12, scriptResourceMapEncoder.buffer(), scriptResourceMapEncoder.bufferSize()) != SQLITE_OK 344 345 || sql.step() != SQLITE_DONE) { 345 346 RELEASE_LOG_ERROR(ServiceWorker, "Failed to store registration data into records table (%i) - %s", m_database->lastError(), m_database->lastErrorMsg()); … … 381 382 continue; 382 383 384 auto referrerPolicy = sql.getColumnText(10); 385 383 386 Vector<uint8_t> scriptResourceMapData; 384 sql.getColumnBlobAsVector(1 0, scriptResourceMapData);387 sql.getColumnBlobAsVector(11, scriptResourceMapData); 385 388 HashMap<URL, ServiceWorkerContextData::ImportedScript> scriptResourceMap; 386 389 … … 401 404 auto serviceWorkerData = ServiceWorkerData { workerIdentifier, scriptURL, ServiceWorkerState::Activated, *workerType, registrationIdentifier }; 402 405 auto registration = ServiceWorkerRegistrationData { WTFMove(*key), registrationIdentifier, URL(originURL, scopePath), *updateViaCache, lastUpdateCheckTime, WTF::nullopt, WTF::nullopt, WTFMove(serviceWorkerData) }; 403 auto contextData = ServiceWorkerContextData { WTF::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove( scriptURL), *workerType, m_sessionID, true, WTFMove(scriptResourceMap) };406 auto contextData = ServiceWorkerContextData { WTF::nullopt, WTFMove(registration), workerIdentifier, WTFMove(script), WTFMove(contentSecurityPolicy), WTFMove(referrerPolicy), WTFMove(scriptURL), *workerType, m_sessionID, true, WTFMove(scriptResourceMap) }; 404 407 405 408 callOnMainThread([protectedThis = makeRef(*this), contextData = contextData.isolatedCopy()]() mutable { -
trunk/Source/WebCore/workers/service/server/SWServer.cpp
r239534 r239659 141 141 addRegistration(WTFMove(registration)); 142 142 143 auto worker = SWServerWorker::create(*this, *registrationPtr, data.scriptURL, data.script, data.contentSecurityPolicy, data.workerType, data.serviceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript> { data.scriptResourceMap });143 auto worker = SWServerWorker::create(*this, *registrationPtr, data.scriptURL, data.script, data.contentSecurityPolicy, WTFMove(data.referrerPolicy), data.workerType, data.serviceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript> { data.scriptResourceMap }); 144 144 registrationPtr->updateRegistrationState(ServiceWorkerRegistrationState::Active, worker.ptr()); 145 145 worker->setState(ServiceWorkerState::Activated); … … 503 503 } 504 504 505 void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, WorkerType type, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap)506 { 507 tryInstallContextData({ jobDataIdentifier, registration.data(), generateObjectIdentifier<ServiceWorkerIdentifierType>(), script, contentSecurityPolicy, url, type, sessionID(), false, WTFMove(scriptResourceMap) });505 void SWServer::updateWorker(Connection&, const ServiceWorkerJobDataIdentifier& jobDataIdentifier, SWServerRegistration& registration, const URL& url, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, const String& referrerPolicy, WorkerType type, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap) 506 { 507 tryInstallContextData({ jobDataIdentifier, registration.data(), generateObjectIdentifier<ServiceWorkerIdentifierType>(), script, contentSecurityPolicy, referrerPolicy, url, type, sessionID(), false, WTFMove(scriptResourceMap) }); 508 508 } 509 509 … … 550 550 RELEASE_ASSERT(registration); 551 551 552 auto worker = SWServerWorker::create(*this, *registration, data.scriptURL, data.script, data.contentSecurityPolicy, data.workerType, data.serviceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript> { data.scriptResourceMap });552 auto worker = SWServerWorker::create(*this, *registration, data.scriptURL, data.script, data.contentSecurityPolicy, String { data.referrerPolicy }, data.workerType, data.serviceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript> { data.scriptResourceMap }); 553 553 554 554 auto* connection = worker->contextConnection(); -
trunk/Source/WebCore/workers/service/server/SWServer.h
r239534 r239659 134 134 void startScriptFetch(const ServiceWorkerJobData&, FetchOptions::Cache); 135 135 136 void updateWorker(Connection&, const ServiceWorkerJobDataIdentifier&, SWServerRegistration&, const URL&, const String& script, const ContentSecurityPolicyResponseHeaders&, WorkerType, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&);136 void updateWorker(Connection&, const ServiceWorkerJobDataIdentifier&, SWServerRegistration&, const URL&, const String& script, const ContentSecurityPolicyResponseHeaders&, const String& referrerPolicy, WorkerType, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&); 137 137 void terminateWorker(SWServerWorker&); 138 138 void syncTerminateWorker(SWServerWorker&); -
trunk/Source/WebCore/workers/service/server/SWServerJobQueue.cpp
r233122 r239659 101 101 102 102 // FIXME: Support the proper worker type (classic vs module) 103 m_server.updateWorker(connection, job.identifier(), *registration, job.scriptURL, result.script, result.contentSecurityPolicy, WorkerType::Classic, { });103 m_server.updateWorker(connection, job.identifier(), *registration, job.scriptURL, result.script, result.contentSecurityPolicy, result.referrerPolicy, WorkerType::Classic, { }); 104 104 } 105 105 -
trunk/Source/WebCore/workers/service/server/SWServerWorker.cpp
r239534 r239659 46 46 47 47 // FIXME: Use r-value references for script and contentSecurityPolicy 48 SWServerWorker::SWServerWorker(SWServer& server, SWServerRegistration& registration, const URL& scriptURL, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, WorkerType type, ServiceWorkerIdentifier identifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap)48 SWServerWorker::SWServerWorker(SWServer& server, SWServerRegistration& registration, const URL& scriptURL, const String& script, const ContentSecurityPolicyResponseHeaders& contentSecurityPolicy, String&& referrerPolicy, WorkerType type, ServiceWorkerIdentifier identifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&& scriptResourceMap) 49 49 : m_server(server) 50 50 , m_registrationKey(registration.key()) … … 52 52 , m_script(script) 53 53 , m_contentSecurityPolicy(contentSecurityPolicy) 54 , m_referrerPolicy(WTFMove(referrerPolicy)) 54 55 , m_scriptResourceMap(WTFMove(scriptResourceMap)) 55 56 { … … 75 76 ASSERT(registration); 76 77 77 return { WTF::nullopt, registration->data(), m_data.identifier, m_script, m_contentSecurityPolicy, m_ data.scriptURL, m_data.type, m_server.sessionID(), false, m_scriptResourceMap };78 return { WTF::nullopt, registration->data(), m_data.identifier, m_script, m_contentSecurityPolicy, m_referrerPolicy, m_data.scriptURL, m_data.type, m_server.sessionID(), false, m_scriptResourceMap }; 78 79 } 79 80 -
trunk/Source/WebCore/workers/service/server/SWServerWorker.h
r239534 r239659 113 113 114 114 private: 115 SWServerWorker(SWServer&, SWServerRegistration&, const URL&, const String& script, const ContentSecurityPolicyResponseHeaders&, WorkerType, ServiceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&);115 SWServerWorker(SWServer&, SWServerRegistration&, const URL&, const String& script, const ContentSecurityPolicyResponseHeaders&, String&& referrerPolicy, WorkerType, ServiceWorkerIdentifier, HashMap<URL, ServiceWorkerContextData::ImportedScript>&&); 116 116 117 117 void callWhenActivatedHandler(bool success); … … 122 122 String m_script; 123 123 ContentSecurityPolicyResponseHeaders m_contentSecurityPolicy; 124 String m_referrerPolicy; 124 125 bool m_hasPendingEvents { false }; 125 126 State m_state { State::NotRunning };
Note: See TracChangeset
for help on using the changeset viewer.