Unreviewed, rolling out r247314.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2019 21:04:05 +0000 (21:04 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Jul 2019 21:04:05 +0000 (21:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199721

Caused performance regression. (Requested by deanj on
#webkit).

Reverted changeset:

"Disable speculative loading if cache is not to be used for
the load"
https://bugs.webkit.org/show_bug.cgi?id=199644
https://trac.webkit.org/changeset/247314

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247362 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/wpt/fetch/disable-speculative-for-reload-expected.txt [deleted file]
LayoutTests/http/wpt/fetch/disable-speculative-for-reload.html [deleted file]
LayoutTests/http/wpt/fetch/resources/iframe-with-image.py [deleted file]
LayoutTests/http/wpt/fetch/resources/image-load-count.py [deleted file]
LayoutTests/http/wpt/fetch/resources/image-load.py [deleted file]
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cache/NetworkCache.cpp

index 4cfdc88..21f88e1 100644 (file)
@@ -1,3 +1,18 @@
+2019-07-11  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r247314.
+        https://bugs.webkit.org/show_bug.cgi?id=199721
+
+        Caused performance regression. (Requested by deanj on
+        #webkit).
+
+        Reverted changeset:
+
+        "Disable speculative loading if cache is not to be used for
+        the load"
+        https://bugs.webkit.org/show_bug.cgi?id=199644
+        https://trac.webkit.org/changeset/247314
+
 2019-07-11  Ryan Haddad  <ryanhaddad@apple.com>
 
         Add test expectations and baselines for iOS 13
diff --git a/LayoutTests/http/wpt/fetch/disable-speculative-for-reload-expected.txt b/LayoutTests/http/wpt/fetch/disable-speculative-for-reload-expected.txt
deleted file mode 100644 (file)
index fa6f9cc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-PASS Ensure image is not speculatively loaded after a reload 
-
diff --git a/LayoutTests/http/wpt/fetch/disable-speculative-for-reload.html b/LayoutTests/http/wpt/fetch/disable-speculative-for-reload.html
deleted file mode 100644 (file)
index 4a8d2a6..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-<script src="/resources/testharness.js"></script>
-<script src="/resources/testharnessreport.js"></script>
-<script src="/common/utils.js"></script>
-<script>
-function loadIFrame(src) {
-    return new Promise(function(resolve, reject) {
-        var iframe = document.createElement('iframe');
-        iframe.onload = function() { resolve(iframe); };
-
-        iframe.src = src;
-
-        document.documentElement.appendChild(iframe);
-    });
-}
-
-async function imageLoadCount(uuid)
-{
-    const response = await fetch('resources/image-load.py?uuid=' + uuid, { method: 'POST' });
-    return response.text();
-}
-
-async function navigateIFrame(iframe, uuid)
-{
-    const promise = new Promise(resolve => iframe.onload = resolve);
-    iframe.src = "resources/iframe-with-image.py?uuid=" + uuid;
-    await promise;
-    return imageLoadCount(uuid);
-}
-
-async function reloadIFrame(iframe, uuid)
-{
-    const promise = new Promise(resolve => iframe.onload = resolve);
-    iframe.contentWindow.location.reload();
-    await promise;
-    return imageLoadCount(uuid);
-}
-
-function resetIFrame(iframe)
-{
-    const promise = new Promise(resolve => { iframe.onload = resolve; });
-    iframe.src = "about:blank";
-    return promise;
-}
-
-promise_test(async (test) => {
-    const uuid = token();
-    const iframe = await loadIFrame("about:blank");
-
-    const token1 = await navigateIFrame(iframe, uuid);
-    await resetIFrame(iframe);
-    const token2 = await navigateIFrame(iframe, uuid);
-    const token3 = await reloadIFrame(iframe, uuid);
-
-    assert_equals(token1, "1", "navigating to");
-    assert_equals(token2, "2", "after new navigation");
-    assert_equals(token3, "3", "after reload");
-
-    iframe.remove();
-}, "Ensure image is not speculatively loaded after a reload");
-</script>
diff --git a/LayoutTests/http/wpt/fetch/resources/iframe-with-image.py b/LayoutTests/http/wpt/fetch/resources/iframe-with-image.py
deleted file mode 100644 (file)
index 7a0a40b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-ETAG = '"123abc"'
-
-
-def main(request, response):
-    test_id = request.GET.first("uuid")
-    response.status = (200, "OK")
-    response.headers.set("Content-Type", 'text/html')
-    return "<!doctype html><image src='image-load.py?uuid=" + test_id + "'></image>"
diff --git a/LayoutTests/http/wpt/fetch/resources/image-load-count.py b/LayoutTests/http/wpt/fetch/resources/image-load-count.py
deleted file mode 100644 (file)
index 2d0dbb7..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-def main(request, response):
-    test_id = request.GET.first("uuid")
-    stashed_count = request.server.stash.take(test_id)
-    if stashed_count is None:
-        stashed_count = test_id + " none"
-
-    request.server.stash.put(test_id, stashed_count)
-
-    response.status = (200, "OK")
-    response.headers.set("Content-Type", 'text/plain')
-    return str(stashed_count)
diff --git a/LayoutTests/http/wpt/fetch/resources/image-load.py b/LayoutTests/http/wpt/fetch/resources/image-load.py
deleted file mode 100644 (file)
index 3f5480d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-ETAG = '"123abc"'
-
-
-def main(request, response):
-    test_id = request.GET.first("uuid")
-
-    if request.method == "POST":
-        stashed_count = request.server.stash.take(test_id)
-        if stashed_count is None:
-            stashed_count = 0
-
-        request.server.stash.put(test_id, stashed_count)
-
-        response.status = (200, "OK")
-        response.headers.set("Content-Type", 'text/plain')
-        return str(stashed_count)
-
-    stashed_count = request.server.stash.take(test_id)
-    if stashed_count is not None:
-        stashed_count = stashed_count + 1
-    else:
-        stashed_count = 1
-    request.server.stash.put(test_id, stashed_count)
-
-    etag = request.headers.get("If-None-Match", None)
-    if etag == ETAG:
-        response.headers.set("X-HTTP-STATUS", 304)
-        response.status = (304, "Not Modified")
-        return ""
-
-    # cache miss, so respond with the actual content
-    response.status = (200, "OK")
-    response.headers.set("ETag", ETAG)
-    response.headers.set("Content-Type", 'image/png')
-    response.headers.set("Cache-Control", "max-age=0");
-    return 'myimagecontent'
index 02c4abf..8e61056 100644 (file)
@@ -1,3 +1,18 @@
+2019-07-11  Commit Queue  <commit-queue@webkit.org>
+
+        Unreviewed, rolling out r247314.
+        https://bugs.webkit.org/show_bug.cgi?id=199721
+
+        Caused performance regression. (Requested by deanj on
+        #webkit).
+
+        Reverted changeset:
+
+        "Disable speculative loading if cache is not to be used for
+        the load"
+        https://bugs.webkit.org/show_bug.cgi?id=199644
+        https://trac.webkit.org/changeset/247314
+
 2019-07-11  Dean Jackson  <dino@apple.com>
 
         CrashTracer: Regression : MobileSafari at UIKit: -[CALayerAccessibility__UIKit__QuartzCore setBounds:]
index 48263e9..20e0758 100644 (file)
@@ -270,29 +270,12 @@ static StoreDecision makeStoreDecision(const WebCore::ResourceRequest& originalR
 }
 
 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
-static bool cachePolicyValidForSpeculativeRevalidation(WebCore::ResourceRequestCachePolicy policy)
-{
-    switch (policy) {
-    case WebCore::ResourceRequestCachePolicy::ReturnCacheDataElseLoad:
-    case WebCore::ResourceRequestCachePolicy::ReturnCacheDataDontLoad:
-    case WebCore::ResourceRequestCachePolicy::ReloadIgnoringCacheData:
-        return false;
-    case WebCore::ResourceRequestCachePolicy::UseProtocolCachePolicy:
-    case WebCore::ResourceRequestCachePolicy::RefreshAnyCacheData:
-        return true;
-    case WebCore::ResourceRequestCachePolicy::DoNotUseAnyCache:
-        ASSERT_NOT_REACHED();
-        return false;
-    }
-    return false;
-}
-
 static bool inline canRequestUseSpeculativeRevalidation(const ResourceRequest& request)
 {
     if (request.isConditional())
         return false;
 
-    if (cachePolicyValidForSpeculativeRevalidation(request.cachePolicy()))
+    if (cachePolicyAllowsExpired(request.cachePolicy()))
         return false;
 
     return request.requester() != ResourceRequest::Requester::XHR && request.requester() != ResourceRequest::Requester::Fetch;