Don't include substitute data URLs in global history redirect chains
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2009 18:37:16 +0000 (18:37 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Mar 2009 18:37:16 +0000 (18:37 +0000)
WebCore:

        Don't include substitute data URLs in global history redirect chains

        <rdar://6690169>

        Reviewed by Darin Adler.

        This might be testable if:
          - support were added to DRT for providing substitute data on failed
            loads
          - support were added to DRT for dumping redirect chains

        I tried doing the above and was still unable to make a test.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::updateHistoryForStandardLoad):
        (WebCore::FrameLoader::updateHistoryForRedirectWithLockedBackForwardList):
        Call updateGlobalHistoryRedirectLinks only if the load succeeded
        (i.e., there is no unreachableURL). Previous the FrameLoaderClient
        implementations were unconditionally calling
        updateGlobalHistoryRedirectLinks from within updateGlobalHistory.

WebKit/mac:

        Don't include substitute data URLs in global history redirect chains

        <rdar://6690169>

        Reviewed by Darin Adler.

        * WebCoreSupport/WebFrameLoaderClient.mm:
        (WebFrameLoaderClient::updateGlobalHistory): Don't call
        updateGlobalHistoryRedirectLinks. FrameLoader calls this for us now.
        (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
        Added an assertion to help catch cases where we might be adding a
        substitute data URL into a redirect chain.

WebKit/win:

        Don't include substitute data URLs in global history redirect chains

        <rdar://6690169>

        Reviewed by Darin Adler.

        * WebCoreSupport/WebFrameLoaderClient.cpp:
        (WebFrameLoaderClient::updateGlobalHistory): Don't call
        updateGlobalHistoryRedirectLinks. FrameLoader calls this for us now.
        (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
        Added an assertion to help catch cases where we might be adding a
        substitute data URL into a redirect chain.

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

WebCore/ChangeLog
WebCore/loader/FrameLoader.cpp
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp

index 67c6d1e..d1633ab 100644 (file)
@@ -1,3 +1,26 @@
+2009-03-27  Adam Roben  <aroben@apple.com>
+
+        Don't include substitute data URLs in global history redirect chains
+
+        <rdar://6690169>
+
+        Reviewed by Darin Adler.
+
+        This might be testable if:
+          - support were added to DRT for providing substitute data on failed
+            loads
+          - support were added to DRT for dumping redirect chains
+
+        I tried doing the above and was still unable to make a test.
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::updateHistoryForStandardLoad):
+        (WebCore::FrameLoader::updateHistoryForRedirectWithLockedBackForwardList):
+        Call updateGlobalHistoryRedirectLinks only if the load succeeded
+        (i.e., there is no unreachableURL). Previous the FrameLoaderClient
+        implementations were unconditionally calling
+        updateGlobalHistoryRedirectLinks from within updateGlobalHistory.
+
 2009-03-27  Peter Kasting  <pkasting@google.com>
 
         Reviewed by Eric Seidel.
index edd04b0..8eb69fb 100644 (file)
@@ -4724,6 +4724,8 @@ void FrameLoader::updateHistoryForStandardLoad()
             if (!needPrivacy) {
                 m_client->updateGlobalHistory();
                 m_documentLoader->setDidCreateGlobalHistoryEntry(true);
+                if (m_documentLoader->unreachableURL().isEmpty())
+                    m_client->updateGlobalHistoryRedirectLinks();
             }
             if (Page* page = m_frame->page())
                 page->setGlobalHistoryItem(needPrivacy ? 0 : page->backForwardList()->currentItem());
@@ -4814,6 +4816,8 @@ void FrameLoader::updateHistoryForRedirectWithLockedBackForwardList()
                 if (!needPrivacy) {
                     m_client->updateGlobalHistory();
                     m_documentLoader->setDidCreateGlobalHistoryEntry(true);
+                    if (m_documentLoader->unreachableURL().isEmpty())
+                        m_client->updateGlobalHistoryRedirectLinks();
                 }
                 if (Page* page = m_frame->page())
                     page->setGlobalHistoryItem(needPrivacy ? 0 : page->backForwardList()->currentItem());
index 985dd5f..36efa69 100644 (file)
@@ -1,3 +1,18 @@
+2009-03-27  Adam Roben  <aroben@apple.com>
+
+        Don't include substitute data URLs in global history redirect chains
+
+        <rdar://6690169>
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::updateGlobalHistory): Don't call
+        updateGlobalHistoryRedirectLinks. FrameLoader calls this for us now.
+        (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
+        Added an assertion to help catch cases where we might be adding a
+        substitute data URL into a redirect chain.
+
 2009-03-27  Darin Adler  <darin@apple.com>
 
         Reviewed by Adam Roben.
index 95ac174..76c69f6 100644 (file)
@@ -792,13 +792,12 @@ void WebFrameLoaderClient::updateGlobalHistory()
                                           withTitle:loader->title()
                                              method:loader->originalRequestCopy().httpMethod()
                                          wasFailure:loader->urlForHistoryReflectsFailure()];
-
-    updateGlobalHistoryRedirectLinks();
 }
 
 void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
 {
     DocumentLoader* loader = core(m_webFrame.get())->loader()->documentLoader();
+    ASSERT(loader->unreachableURL().isEmpty());
 
     if (!loader->clientRedirectSourceForHistory().isNull()) {
         if (WebHistoryItem *item = [[WebHistory optionalSharedHistory] _itemForURLString:loader->clientRedirectSourceForHistory()])
index 5f89f66..2eb4c28 100644 (file)
@@ -1,3 +1,18 @@
+2009-03-27  Adam Roben  <aroben@apple.com>
+
+        Don't include substitute data URLs in global history redirect chains
+
+        <rdar://6690169>
+
+        Reviewed by Darin Adler.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebFrameLoaderClient::updateGlobalHistory): Don't call
+        updateGlobalHistoryRedirectLinks. FrameLoader calls this for us now.
+        (WebFrameLoaderClient::updateGlobalHistoryRedirectLinks):
+        Added an assertion to help catch cases where we might be adding a
+        substitute data URL into a redirect chain.
+
 2009-03-26  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Adam Roben.
index c307660..68157f4 100644 (file)
@@ -482,7 +482,6 @@ void WebFrameLoaderClient::updateGlobalHistory()
 
     DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
     history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure());
-    updateGlobalHistoryRedirectLinks();
 }
 
 void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
@@ -492,6 +491,7 @@ void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks()
         return;
 
     DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader();
+    ASSERT(loader->unreachableURL().isEmpty());
 
     if (!loader->clientRedirectSourceForHistory().isNull()) {
         if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) {