Title: [195399] branches/safari-601.1.46-branch

Diff

Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (195398 => 195399)


--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2016-01-21 04:47:23 UTC (rev 195398)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2016-01-21 07:11:18 UTC (rev 195399)
@@ -1,3 +1,20 @@
+2016-01-20  Babak Shafiei  <[email protected]>
+
+        Merge r195162.
+
+    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-20  Matthew Hanson  <[email protected]>
 
         Merge r195158. rdar://problem/24208157

Copied: branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/resources/server-redirect-result.html (from rev 195162, trunk/LayoutTests/http/tests/loading/resources/server-redirect-result.html) (0 => 195399)


--- branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/resources/server-redirect-result.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/resources/server-redirect-result.html	2016-01-21 07:11:18 UTC (rev 195399)
@@ -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

Copied: branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/resources/server-redirect.php (from rev 195162, trunk/LayoutTests/http/tests/loading/resources/server-redirect.php) (0 => 195399)


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

Copied: branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt (from rev 195162, trunk/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt) (0 => 195399)


--- branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching-expected.txt	2016-01-21 07:11:18 UTC (rev 195399)
@@ -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.
+
+

Copied: branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html (from rev 195162, trunk/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html) (0 => 195399)


--- branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/http/tests/loading/server-redirect-for-provisional-load-caching.html	2016-01-21 07:11:18 UTC (rev 195399)
@@ -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.1.46-branch/Source/WebCore/ChangeLog (195398 => 195399)


--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2016-01-21 04:47:23 UTC (rev 195398)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog	2016-01-21 07:11:18 UTC (rev 195399)
@@ -1,3 +1,24 @@
+2016-01-20  Babak Shafiei  <[email protected]>
+
+        Merge r195162.
+
+    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-20  Timothy Hatcher  <[email protected]>
 
         <rdar://problem/24242600> CrashTracer: com.apple.WebKit.WebContent at …pector::CSSFrontendDispatcher::mediaQueryResultChanged + 316

Modified: branches/safari-601.1.46-branch/Source/WebCore/loader/DocumentLoader.cpp (195398 => 195399)


--- branches/safari-601.1.46-branch/Source/WebCore/loader/DocumentLoader.cpp	2016-01-21 04:47:23 UTC (rev 195398)
+++ branches/safari-601.1.46-branch/Source/WebCore/loader/DocumentLoader.cpp	2016-01-21 07:11:18 UTC (rev 195399)
@@ -663,6 +663,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.1.46-branch/Source/WebCore/loader/cache/CachedRawResource.h (195398 => 195399)


--- branches/safari-601.1.46-branch/Source/WebCore/loader/cache/CachedRawResource.h	2016-01-21 04:47:23 UTC (rev 195398)
+++ branches/safari-601.1.46-branch/Source/WebCore/loader/cache/CachedRawResource.h	2016-01-21 07:11:18 UTC (rev 195399)
@@ -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