Title: [195717] branches/safari-601-branch

Diff

Modified: branches/safari-601-branch/LayoutTests/ChangeLog (195716 => 195717)


--- branches/safari-601-branch/LayoutTests/ChangeLog	2016-01-28 01:34:16 UTC (rev 195716)
+++ branches/safari-601-branch/LayoutTests/ChangeLog	2016-01-28 01:34:20 UTC (rev 195717)
@@ -1,5 +1,22 @@
 2016-01-27  Matthew Hanson  <[email protected]>
 
+        Merge r195162. rdar://problem/24302736
+
+    2016-01-15  Jiewen Tan  <[email protected]>
+
+            FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache
+            https://bugs.webkit.org/show_bug.cgi?id=152520
+            <rdar://problem/23305737>
+
+            Reviewed by Andy Estes.
+
+            * http/tests/loading/resources/server-redirect-result.html: Added.
+            * http/tests/loading/resources/server-redirect.php: Added.
+            * http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt: Added.
+            * http/tests/loading/server-redirect-for-provisional-load-caching.html: Added.
+
+2016-01-27  Matthew Hanson  <[email protected]>
+
         Merge r195075. rdar://problem/24302727
 
     2016-01-14  Daniel Bates  <[email protected]>

Added: branches/safari-601-branch/LayoutTests/http/tests/loading/resources/server-redirect-result.html (0 => 195717)


--- branches/safari-601-branch/LayoutTests/http/tests/loading/resources/server-redirect-result.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/loading/resources/server-redirect-result.html	2016-01-28 01:34:20 UTC (rev 195717)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<script>
+if (parent.count == 0) {
+	parent.count = 1;
+	window.location = "server-redirect.php";
+}
+else if (parent.count == 1) {
+	if (parent.window.testRunner)
+		testRunner.notifyDone();
+}
+</script>
\ No newline at end of file

Added: branches/safari-601-branch/LayoutTests/http/tests/loading/resources/server-redirect.php (0 => 195717)


--- branches/safari-601-branch/LayoutTests/http/tests/loading/resources/server-redirect.php	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/loading/resources/server-redirect.php	2016-01-28 01:34:20 UTC (rev 195717)
@@ -0,0 +1,4 @@
+<?php
+header("Location: server-redirect-result.html", true, 301);
+exit();
+?>
\ No newline at end of file

Added: branches/safari-601-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt (0 => 195717)


--- branches/safari-601-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt	2016-01-28 01:34:20 UTC (rev 195717)
@@ -0,0 +1,29 @@
+main frame - didStartProvisionalLoadForFrame
+main frame - didCommitLoadForFrame
+frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
+http://127.0.0.1:8000/loading/resources/server-redirect.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/server-redirect.php, main document URL http://127.0.0.1:8000/loading/server-redirect-for-provisional-load-caching.html, http method GET> redirectResponse (null)
+main frame - didFinishDocumentLoadForFrame
+http://127.0.0.1:8000/loading/server-redirect-for-provisional-load-caching.html - didFinishLoading
+http://127.0.0.1:8000/loading/resources/server-redirect.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/server-redirect-result.html, main document URL http://127.0.0.1:8000/loading/server-redirect-for-provisional-load-caching.html, http method GET> redirectResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/server-redirect.php, http status code 301>
+frame "<!--framePath //<!--frame0-->-->" - didReceiveServerRedirectForProvisionalLoadForFrame
+http://127.0.0.1:8000/loading/resources/server-redirect.php - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/server-redirect-result.html, http status code 200>
+frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
+frame "<!--framePath //<!--frame0-->-->" - willPerformClientRedirectToURL: http://127.0.0.1:8000/loading/resources/server-redirect.php 
+frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
+main frame - didFinishLoadForFrame
+http://127.0.0.1:8000/loading/resources/server-redirect.php - didFinishLoading
+frame "<!--framePath //<!--frame0-->-->" - didStartProvisionalLoadForFrame
+http://127.0.0.1:8000/loading/resources/server-redirect.php - willSendRequest <NSURLRequest URL http://127.0.0.1:8000/loading/resources/server-redirect.php, main document URL http://127.0.0.1:8000/loading/server-redirect-for-provisional-load-caching.html, http method GET> redirectResponse (null)
+frame "<!--framePath //<!--frame0-->-->" - didReceiveServerRedirectForProvisionalLoadForFrame
+http://127.0.0.1:8000/loading/resources/server-redirect.php - didReceiveResponse <NSURLResponse http://127.0.0.1:8000/loading/resources/server-redirect-result.html, http status code 200>
+frame "<!--framePath //<!--frame0-->-->" - didCancelClientRedirectForFrame
+frame "<!--framePath //<!--frame0-->-->" - didCommitLoadForFrame
+http://127.0.0.1:8000/loading/resources/server-redirect.php - didFinishLoading
+frame "<!--framePath //<!--frame0-->-->" - didFinishDocumentLoadForFrame
+frame "<!--framePath //<!--frame0-->-->" - didHandleOnloadEventsForFrame
+frame "<!--framePath //<!--frame0-->-->" - didFinishLoadForFrame
+Test passes if the second redirection which is loaded from the cache dispatches didReceiveServerRedirectForProvisionalLoadForFrame.
+
+

Added: branches/safari-601-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html (0 => 195717)


--- branches/safari-601-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html	                        (rev 0)
+++ branches/safari-601-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html	2016-01-28 01:34:20 UTC (rev 195717)
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+var count = 0;
+
+if (window.testRunner) {
+	testRunner.dumpAsText();
+	testRunner.dumpResourceLoadCallbacks();
+	testRunner.waitUntilDone();
+}
+</script>
+</head>
+<p>Test passes if the second redirection which is loaded from the cache dispatches didReceiveServerRedirectForProvisionalLoadForFrame.</p>
+<iframe src=""
+</html>
\ No newline at end of file

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (195716 => 195717)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2016-01-28 01:34:16 UTC (rev 195716)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2016-01-28 01:34:20 UTC (rev 195717)
@@ -1,5 +1,26 @@
 2016-01-27  Matthew Hanson  <[email protected]>
 
+        Merge r195162. rdar://problem/24302736
+
+    2016-01-15  Jiewen Tan  <[email protected]>
+
+            FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache
+            https://bugs.webkit.org/show_bug.cgi?id=152520
+            <rdar://problem/23305737>
+
+            Reviewed by Andy Estes.
+
+            Test: http/tests/loading/server-redirect-for-provisional-load-caching.html
+
+            * loader/DocumentLoader.cpp:
+            (WebCore::DocumentLoader::responseReceived):
+            Dispatch message to notify client that a cached resource was redirected. So,
+            client can make proper actions to treat server side redirection.
+            * loader/cache/CachedRawResource.h:
+            Add a method to tell whether the cached resource was redirected.
+
+2016-01-27  Matthew Hanson  <[email protected]>
+
         Merge r195132. rdar://problem/24154292
 
     2016-01-15  Dave Hyatt  <[email protected]>

Modified: branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp (195716 => 195717)


--- branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp	2016-01-28 01:34:16 UTC (rev 195716)
+++ branches/safari-601-branch/Source/WebCore/loader/DocumentLoader.cpp	2016-01-28 01:34:20 UTC (rev 195717)
@@ -661,6 +661,10 @@
     m_response = response;
 
     if (m_identifierForLoadWithoutResourceLoader) {
+        if (m_mainResource && m_mainResource->wasRedirected()) {
+            ASSERT(m_mainResource->status() == CachedResource::Status::Cached);
+            frameLoader()->client().dispatchDidReceiveServerRedirectForProvisionalLoad();
+        }
         addResponse(m_response);
         frameLoader()->notifier().dispatchDidReceiveResponse(this, m_identifierForLoadWithoutResourceLoader, m_response, 0);
     }

Modified: branches/safari-601-branch/Source/WebCore/loader/cache/CachedRawResource.h (195716 => 195717)


--- branches/safari-601-branch/Source/WebCore/loader/cache/CachedRawResource.h	2016-01-28 01:34:16 UTC (rev 195716)
+++ branches/safari-601-branch/Source/WebCore/loader/cache/CachedRawResource.h	2016-01-28 01:34:20 UTC (rev 195717)
@@ -46,6 +46,8 @@
 
     void clear();
 
+    bool wasRedirected() const { return !m_redirectChain.isEmpty(); };
+
 private:
     virtual void didAddClient(CachedResourceClient*) override;
     virtual void addDataBuffer(SharedBuffer&) override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to