Changeset 286656 in webkit
- Timestamp:
- Dec 8, 2021 8:27:03 AM (7 months ago)
- Location:
- trunk
- Files:
-
- 8 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/service-workers/cross-site-navigation-same-cookie-lax.https-expected.txt (added)
-
LayoutTests/http/wpt/service-workers/cross-site-navigation-same-cookie-lax.https.html (added)
-
LayoutTests/http/wpt/service-workers/resources/get-cookie.py (added)
-
LayoutTests/http/wpt/service-workers/resources/get-document-cookie.py (added)
-
LayoutTests/http/wpt/service-workers/resources/set-cookie-lax.py (added)
-
LayoutTests/http/wpt/service-workers/same-cookie-lax-worker.js (added)
-
LayoutTests/http/wpt/service-workers/same-cookie-lax.https-expected.txt (added)
-
LayoutTests/http/wpt/service-workers/same-cookie-lax.https.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/loader/FrameLoader.cpp (modified) (2 diffs)
-
Source/WebCore/loader/FrameLoader.h (modified) (1 diff)
-
Source/WebCore/loader/cache/CachedResource.cpp (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r286655 r286656 1 2021-12-08 Youenn Fablet <youenn@apple.com> 2 3 Same-site lax cookies not sent by fetch event handler after page reload 4 https://bugs.webkit.org/show_bug.cgi?id=226386 5 <rdar://problem/78878853> 6 7 Reviewed by Chris Dumez. 8 9 * http/wpt/service-workers/cross-site-navigation-same-cookie-lax.https-expected.txt: Added. 10 * http/wpt/service-workers/cross-site-navigation-same-cookie-lax.https.html: Added. 11 * http/wpt/service-workers/resources/get-cookie.py: Added. 12 * http/wpt/service-workers/resources/get-document-cookie.py: Added. 13 * http/wpt/service-workers/resources/set-cookie-lax.py: Added. 14 * http/wpt/service-workers/same-cookie-lax-worker.js: Added. 15 * http/wpt/service-workers/same-cookie-lax.https-expected.txt: Added. 16 * http/wpt/service-workers/same-cookie-lax.https.html: Added. 17 1 18 2021-12-08 Youenn Fablet <youenn@apple.com> 2 19 -
trunk/Source/WebCore/ChangeLog
r286655 r286656 1 2021-12-08 Youenn Fablet <youenn@apple.com> 2 3 Same-site lax cookies not sent by fetch event handler after page reload 4 https://bugs.webkit.org/show_bug.cgi?id=226386 5 <rdar://problem/78878853> 6 7 Reviewed by Chris Dumez. 8 9 When a service worker fetches a navigation request exposed from the fetch event, we need to keep isTopSite intact as 10 the service worker does not really have the information of which frame is actually loaded and whether it is a main frame or not. 11 12 Tests: http/wpt/service-workers/cross-site-navigation-same-cookie-lax.https.html 13 http/wpt/service-workers/same-cookie-lax.https.html 14 15 * loader/cache/CachedResource.cpp: 16 1 17 2021-12-08 Youenn Fablet <youenn@apple.com> 2 18 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r285320 r286656 2900 2900 } 2901 2901 2902 void FrameLoader::updateRequestAndAddExtraFields(ResourceRequest& request, IsMainResource mainResource, FrameLoadType loadType, ShouldUpdateAppInitiatedValue shouldUpdate) 2903 { 2902 void FrameLoader::updateRequestAndAddExtraFields(ResourceRequest& request, IsMainResource mainResource, FrameLoadType loadType, ShouldUpdateAppInitiatedValue shouldUpdate, IsServiceWorkerNavigationLoad isServiceWorkerNavigationLoad) 2903 { 2904 ASSERT(isServiceWorkerNavigationLoad == IsServiceWorkerNavigationLoad::No || mainResource != IsMainResource::Yes); 2905 2904 2906 // If the request came from a previous process due to process-swap-on-navigation then we should not modify the request. 2905 2907 if (m_currentLoadContinuingState == LoadContinuingState::ContinuingWithRequest) … … 2929 2931 addSameSiteInfoToRequestIfNeeded(request, initiator); 2930 2932 } 2931 request.setIsTopSite(isMainFrameMainResource); 2933 2934 // In case of service worker navigation load, we inherit isTopSite from the FetchEvent request directly. 2935 if (isServiceWorkerNavigationLoad == IsServiceWorkerNavigationLoad::No) 2936 request.setIsTopSite(isMainFrameMainResource); 2932 2937 2933 2938 Page* page = frame().page(); -
trunk/Source/WebCore/loader/FrameLoader.h
r285320 r286656 318 318 bool alwaysAllowLocalWebarchive() const { return m_alwaysAllowLocalWebarchive; } 319 319 320 enum class IsServiceWorkerNavigationLoad : bool { No, Yes }; 320 321 // For subresource requests the FrameLoadType parameter has no effect and can be skipped. 321 void updateRequestAndAddExtraFields(ResourceRequest&, IsMainResource, FrameLoadType = FrameLoadType::Standard, ShouldUpdateAppInitiatedValue = ShouldUpdateAppInitiatedValue::Yes );322 void updateRequestAndAddExtraFields(ResourceRequest&, IsMainResource, FrameLoadType = FrameLoadType::Standard, ShouldUpdateAppInitiatedValue = ShouldUpdateAppInitiatedValue::Yes, IsServiceWorkerNavigationLoad = IsServiceWorkerNavigationLoad::No); 322 323 323 324 void scheduleRefreshIfNeeded(Document&, const String& content, IsMetaRefresh); -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r286419 r286656 242 242 // Navigation algorithm is setting up the request before sending it to CachedResourceLoader?CachedResource. 243 243 // So no need for extra fields for MainResource. 244 if (type() != Type::MainResource) 245 frameLoader.updateRequestAndAddExtraFields(m_resourceRequest, IsMainResource::No); 244 if (type() != Type::MainResource) { 245 bool isServiceWorkerNavigationLoad = type() != Type::SVGDocumentResource && m_options.serviceWorkersMode == ServiceWorkersMode::None && (m_options.destination == FetchOptions::Destination::Document || m_options.destination == FetchOptions::Destination::Iframe); 246 frameLoader.updateRequestAndAddExtraFields(m_resourceRequest, IsMainResource::No, FrameLoadType::Standard, ShouldUpdateAppInitiatedValue::Yes, isServiceWorkerNavigationLoad ? FrameLoader::IsServiceWorkerNavigationLoad::Yes : FrameLoader::IsServiceWorkerNavigationLoad::No); 247 } 246 248 247 249 // FIXME: It's unfortunate that the cache layer and below get to know anything about fragment identifiers. -
trunk/Source/WebKit/ChangeLog
r286650 r286656 1 2021-12-08 Youenn Fablet <youenn@apple.com> 2 3 Same-site lax cookies not sent by fetch event handler after page reload 4 https://bugs.webkit.org/show_bug.cgi?id=226386 5 <rdar://problem/78878853> 6 7 Reviewed by Chris Dumez. 8 9 StorageBlockingPolicy handling is not covered by generated code so explicit update StorageBlockingPolicy setting from preference store. 10 This impacts the computation of cookie/cache partitioning. 11 12 * WebProcess/Storage/WebSWContextManagerConnection.cpp: 13 1 14 2021-12-08 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
r286455 r286656 168 168 auto lastNavigationWasAppInitiated = contextData.lastNavigationWasAppInitiated; 169 169 auto page = makeUniqueRef<Page>(WTFMove(pageConfiguration)); 170 if (m_preferencesStore) 170 if (m_preferencesStore) { 171 171 WebPage::updateSettingsGenerated(*m_preferencesStore, page->settings()); 172 page->settings().setStorageBlockingPolicy(static_cast<StorageBlockingPolicy>(m_preferencesStore->getUInt32ValueForKey(WebPreferencesKey::storageBlockingPolicyKey()))); 173 } 172 174 ServiceWorkerThreadProxy::setupPageForServiceWorker(page.get(), contextData); 173 175 auto serviceWorkerThreadProxy = ServiceWorkerThreadProxy::create(WTFMove(page), WTFMove(contextData), WTFMove(workerData), WTFMove(effectiveUserAgent), workerThreadMode, WebProcess::singleton().cacheStorageProvider());
Note: See TracChangeset
for help on using the changeset viewer.