Title: [226188] trunk
Revision
226188
Author
cdu...@apple.com
Date
2017-12-20 10:30:06 -0800 (Wed, 20 Dec 2017)

Log Message

Do not reuse resource for memory cache if selected service worker differs
https://bugs.webkit.org/show_bug.cgi?id=181042

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that it is consistently passing.

* web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:

Source/WebCore:

No new tests, rebaselined existing test.

* loader/cache/CachedResource.h:
(WebCore::CachedResource::options const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):

LayoutTests:

Drop test from flaky list now that it is consistently passing.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226187 => 226188)


--- trunk/LayoutTests/ChangeLog	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/LayoutTests/ChangeLog	2017-12-20 18:30:06 UTC (rev 226188)
@@ -1,3 +1,14 @@
+2017-12-20  Chris Dumez  <cdu...@apple.com>
+
+        Do not reuse resource for memory cache if selected service worker differs
+        https://bugs.webkit.org/show_bug.cgi?id=181042
+
+        Reviewed by Youenn Fablet.
+
+        Drop test from flaky list now that it is consistently passing.
+
+        * TestExpectations:
+
 2017-12-20  Matt Lewis  <jlew...@apple.com>
 
         Marked svg/animations/smil-leak-element-instances-noBaseValRef.svg as flaky on macOS WK1.

Modified: trunk/LayoutTests/TestExpectations (226187 => 226188)


--- trunk/LayoutTests/TestExpectations	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/LayoutTests/TestExpectations	2017-12-20 18:30:06 UTC (rev 226188)
@@ -180,7 +180,6 @@
 imported/w3c/web-platform-tests/service-workers/service-worker/registration-service-worker-attributes.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/service-workers/service-worker/service-worker-csp-connect.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/service-workers/service-worker/uncontrolled-page.https.html [ Pass Failure ]
-imported/w3c/web-platform-tests/service-workers/service-worker/unregister-controller.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/service-workers/service-worker/websocket.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/service-workers/service-worker/windowclient-navigate.https.html [ Pass Failure ]
 imported/w3c/web-platform-tests/streams/readable-byte-streams/detached-buffers.serviceworker.https.html [ Pass Failure ]

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (226187 => 226188)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2017-12-20 18:30:06 UTC (rev 226188)
@@ -1,3 +1,14 @@
+2017-12-20  Chris Dumez  <cdu...@apple.com>
+
+        Do not reuse resource for memory cache if selected service worker differs
+        https://bugs.webkit.org/show_bug.cgi?id=181042
+
+        Reviewed by Youenn Fablet.
+
+        Rebaseline WPT test now that it is consistently passing.
+
+        * web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt:
+
 2017-12-19  Chris Dumez  <cdu...@apple.com>
 
         [Fetch] Extracting a body of type Blob should not set Content-Type to the empty string

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt (226187 => 226188)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-controller.https-expected.txt	2017-12-20 18:30:06 UTC (rev 226188)
@@ -1,6 +1,6 @@
 
 
 PASS Unregister does not affect existing controller 
-FAIL Unregister prevents control of subsequent navigations assert_unreached: unexpected rejection: assert_equals: requests should not be intercepted expected "a simple text file\n" but got "intercepted by service worker" Reached unreachable code
+PASS Unregister prevents control of subsequent navigations 
 PASS Unregister prevents new controllee even if registration is still in use 
 

Modified: trunk/Source/WebCore/ChangeLog (226187 => 226188)


--- trunk/Source/WebCore/ChangeLog	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/Source/WebCore/ChangeLog	2017-12-20 18:30:06 UTC (rev 226188)
@@ -1,3 +1,17 @@
+2017-12-20  Chris Dumez  <cdu...@apple.com>
+
+        Do not reuse resource for memory cache if selected service worker differs
+        https://bugs.webkit.org/show_bug.cgi?id=181042
+
+        Reviewed by Youenn Fablet.
+
+        No new tests, rebaselined existing test.
+
+        * loader/cache/CachedResource.h:
+        (WebCore::CachedResource::options const):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
+
 2017-12-20  Youenn Fablet  <you...@apple.com>
 
         Do not search for service worker registration in case of non HTTP navigation loads

Modified: trunk/Source/WebCore/loader/cache/CachedResource.h (226187 => 226188)


--- trunk/Source/WebCore/loader/cache/CachedResource.h	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/Source/WebCore/loader/cache/CachedResource.h	2017-12-20 18:30:06 UTC (rev 226188)
@@ -234,7 +234,7 @@
     DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBufferingPolicy; }
 
     bool allowsCaching() const { return m_options.cachingPolicy == CachingPolicy::AllowCaching; }
-    const FetchOptions& options() const { return m_options; }
+    const ResourceLoaderOptions& options() const { return m_options; }
 
     virtual void destroyDecodedData() { }
 

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (226187 => 226188)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2017-12-20 18:08:51 UTC (rev 226187)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2017-12-20 18:30:06 UTC (rev 226188)
@@ -1024,6 +1024,14 @@
     if (request.cachePolicy() == RefreshAnyCacheData)
         return Reload;
 
+#if ENABLE(SERVICE_WORKER)
+    // FIXME: We should validate/specify this behavior.
+    if (cachedResourceRequest.options().serviceWorkerIdentifier != existingResource->options().serviceWorkerIdentifier) {
+        LOG(ResourceLoading, "CachedResourceLoader::determineRevalidationPolicy reloading because selected service worker differs");
+        return Reload;
+    }
+#endif
+
     // We already have a preload going for this URL.
     if (forPreload == ForPreload::Yes && existingResource->isPreloaded())
         return Use;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to