WebKit Bugzilla
Attachment 369504 Details for
Bug 197371
: Store prefetch redirects in the prefetch cache
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197371-20190509204426.patch (text/plain), 6.03 KB, created by
Rob Buis
on 2019-05-09 11:44:26 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Rob Buis
Created:
2019-05-09 11:44:26 PDT
Size:
6.03 KB
patch
obsolete
>Subversion Revision: 245147 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8e056e6bb57702068e8d6bdc4d594f18d7cbbffd..b4e10b58a178ce175254e391927a1984db175963 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,15 @@ >+2019-05-09 Rob Buis <rbuis@igalia.com> >+ >+ Store prefetch redirects in the prefetch cache >+ https://bugs.webkit.org/show_bug.cgi?id=197371 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Store prefetch redirects in the prefetch cache and add a test for it. >+ >+ * NetworkProcess/NetworkResourceLoader.cpp: >+ (WebKit::NetworkResourceLoader::didFinishWithRedirectResponse): >+ > 2019-05-09 Daniel Bates <dabates@apple.com> > > [iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key (hardware or software keyboard) >diff --git a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >index 4510e9268a22c205c8c6b035a7b0fcfe478e06e2..74ce7c7eca76f6d304a8ccae38f05c94b10a8895 100644 >--- a/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >@@ -690,6 +690,10 @@ void NetworkResourceLoader::didFinishWithRedirectResponse(ResourceResponse&& red > networkLoadMetrics.responseBodyDecodedSize = 0; > send(Messages::WebResourceLoader::DidFinishResourceLoad { networkLoadMetrics }); > >+ if (isCrossOriginPrefetch()) { >+ if (auto session = m_connection->networkProcess().networkSession(sessionID())) >+ session->prefetchCache().store(m_networkLoad->currentRequest().url(), WTFMove(m_response), WTFMove(m_bufferedDataForCache)); >+ } > cleanup(LoadResult::Success); > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b303f73a11f4e5e0b4c7ac4d5298ffd22fbcd855..14af9e3e8387fb8e99c6716484ec731baf4395df 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-09 Rob Buis <rbuis@igalia.com> >+ >+ Add tests for prefetch redirects >+ https://bugs.webkit.org/show_bug.cgi?id=197371 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a test to verify prefetch redirections are cached in the prefetch >+ cache and reused when navigating. >+ >+ * http/tests/cache/link-prefetch-main-resource-redirect-expected.txt: Added. >+ * http/tests/cache/link-prefetch-main-resource-redirect.html: Added. >+ * http/tests/cache/resources/prefetched-main-resource-redirect.php: Added. >+ * platform/mac-wk1/TestExpectations: >+ * platform/win/TestExpectations: >+ > 2019-05-09 Daniel Bates <dabates@apple.com> > > [iOS] Unable to commit search on MSN.com, qq.com, or sina.com.cn using enter key (hardware or software keyboard) >diff --git a/LayoutTests/http/tests/cache/link-prefetch-main-resource-redirect-expected.txt b/LayoutTests/http/tests/cache/link-prefetch-main-resource-redirect-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..7ef22e9a431ad0272713b71fdc8794016c8ef12f >--- /dev/null >+++ b/LayoutTests/http/tests/cache/link-prefetch-main-resource-redirect-expected.txt >@@ -0,0 +1 @@ >+PASS >diff --git a/LayoutTests/http/tests/cache/link-prefetch-main-resource-redirect.html b/LayoutTests/http/tests/cache/link-prefetch-main-resource-redirect.html >new file mode 100644 >index 0000000000000000000000000000000000000000..6182a728f2d80daa1a949e6f002e0c3b97582743 >--- /dev/null >+++ b/LayoutTests/http/tests/cache/link-prefetch-main-resource-redirect.html >@@ -0,0 +1,16 @@ >+<html> >+<script> >+if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+} >+ >+function loadAfterPrefetch() >+{ >+ window.location.assign('http://localhost:8000/cache/resources/prefetched-main-resource-redirect.php'); >+} >+</script> >+<body> >+<link rel="prefetch" href="http://localhost:8000/cache/resources/prefetched-main-resource-redirect.php" onload="loadAfterPrefetch()"> >+</body> >+</html> >diff --git a/LayoutTests/http/tests/cache/resources/prefetched-main-resource-redirect.php b/LayoutTests/http/tests/cache/resources/prefetched-main-resource-redirect.php >new file mode 100644 >index 0000000000000000000000000000000000000000..873ac8f1a3f39544cfdd4772627e1137a5168708 >--- /dev/null >+++ b/LayoutTests/http/tests/cache/resources/prefetched-main-resource-redirect.php >@@ -0,0 +1,27 @@ >+<?php >+if ($_SERVER["HTTP_PURPOSE"] == "prefetch") { >+ header('HTTP/1.1 ' . 200); >+} else { >+ header('HTTP/1.1 ' . 302); >+ header('Location: ' . 'prefetched-main-resource.php'); >+} >+header('Cache-Control: max-age=3600'); >+?> >+<!DOCTYPE html> >+<html> >+<body> >+<script> >+ >+if (window.testRunner) >+ testRunner.notifyDone(); >+ >+</script> >+<?php >+if ($_SERVER["HTTP_PURPOSE"] == "prefetch") { >+ print('PASS'); >+} else { >+ print('FAIL'); >+} >+?> >+</body> >+</html> >diff --git a/LayoutTests/platform/mac-wk1/TestExpectations b/LayoutTests/platform/mac-wk1/TestExpectations >index 53658806710303b211507e8dae926eaa6843d844..89a8cca7024911f662f4113db0eafd535f33e237 100644 >--- a/LayoutTests/platform/mac-wk1/TestExpectations >+++ b/LayoutTests/platform/mac-wk1/TestExpectations >@@ -705,3 +705,5 @@ webkit.org/b/196915 [ Debug ] inspector/timeline/timeline-recording.html [ Pass > > webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource.html [ Skip ] > webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource-iframe.html [ Skip ] >+ >+webkit.org/b/197371 http/tests/cache/link-prefetch-main-resource-redirect.html [ Skip ] >diff --git a/LayoutTests/platform/win/TestExpectations b/LayoutTests/platform/win/TestExpectations >index 48e025b79290b1d79e72bb8840b055ddf0b447be..c1b5cb7d3a8b3421213ce249d9739b76efcbb124 100644 >--- a/LayoutTests/platform/win/TestExpectations >+++ b/LayoutTests/platform/win/TestExpectations >@@ -4400,3 +4400,5 @@ webkit.org/b/197310 fast/harness/render-tree-as-text-options.html [ Failure ] > > webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource.html [ Skip ] > webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource-iframe.html [ Skip ] >+ >+webkit.org/b/197371 http/tests/cache/link-prefetch-main-resource-redirect.html [ Skip ]
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197371
:
368556
|
368559
|
368560
|
368565
|
368566
|
368568
|
369382
|
369384
|
369386
|
369387
|
369388
|
369418
|
369504
|
369733
|
371728
|
371854
|
372194