2010-10-28 Michael Nordman <michaeln@google.com>
authormichaeln@google.com <michaeln@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Oct 2010 21:06:00 +0000 (21:06 +0000)
committermichaeln@google.com <michaeln@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Oct 2010 21:06:00 +0000 (21:06 +0000)
        Reviewed by ap.

        [Chrome] Fix an appcache regression introduced in r69226
        https://bugs.webkit.org/show_bug.cgi?id=48592
        Provide a noop method body ApplicationCacheHost::maybeLoadMainResourceForRedirect.

        * src/ApplicationCacheHost.cpp:
        (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
2010-10-28  Michael Nordman  <michaeln@google.com>

        Reviewed by ap.

        [Chrome] Fix an appcache regression introduced in r69226
        https://bugs.webkit.org/show_bug.cgi?id=48592
        Define a new ApplicationCacheHost method for the specific case of main resource redirect handling.

        Tests: the existing layout test applies

        * loader/MainResourceLoader.cpp: use the newly introduced method
        (WebCore::MainResourceLoader::willSendRequest):
        * loader/appcache/ApplicationCacheHost.cpp:
        (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
        * loader/appcache/ApplicationCacheHost.h:

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

WebCore/ChangeLog
WebCore/loader/MainResourceLoader.cpp
WebCore/loader/appcache/ApplicationCacheHost.cpp
WebCore/loader/appcache/ApplicationCacheHost.h
WebKit/chromium/ChangeLog
WebKit/chromium/src/ApplicationCacheHost.cpp

index 5424d32..5f4b5ee 100644 (file)
@@ -1,3 +1,19 @@
+2010-10-28  Michael Nordman  <michaeln@google.com>
+
+        Reviewed by ap.
+
+        [Chrome] Fix an appcache regression introduced in r69226
+        https://bugs.webkit.org/show_bug.cgi?id=48592
+        Define a new ApplicationCacheHost method for the specific case of main resource redirect handling.
+
+        Tests: the existing layout test applies
+
+        * loader/MainResourceLoader.cpp: use the newly introduced method
+        (WebCore::MainResourceLoader::willSendRequest):
+        * loader/appcache/ApplicationCacheHost.cpp:
+        (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
+        * loader/appcache/ApplicationCacheHost.h:
+
 2010-10-29  Eric Carlson  <eric.carlson@apple.com>
 
         Reviewed by Adam Roben.
index af30a11..7e5eb90 100644 (file)
@@ -202,9 +202,8 @@ void MainResourceLoader::willSendRequest(ResourceRequest& newRequest, const Reso
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
     if (!redirectResponse.isNull()) {
         // We checked application cache for initial URL, now we need to check it for redirected one.
-        ASSERT(documentLoader()->applicationCacheHost()->status() == ApplicationCacheHost::UNCACHED);
         ASSERT(!m_substituteData.isValid());
-        documentLoader()->applicationCacheHost()->maybeLoadMainResource(newRequest, m_substituteData);
+        documentLoader()->applicationCacheHost()->maybeLoadMainResourceForRedirect(newRequest, m_substituteData);
     }
 #endif
 
index f613729..d5707cf 100644 (file)
@@ -91,6 +91,12 @@ void ApplicationCacheHost::maybeLoadMainResource(ResourceRequest& request, Subst
     }
 }
 
+void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest& request, SubstituteData& substituteData)
+{
+    ASSERT(status() == UNCACHED);
+    maybeLoadMainResource(request, substituteData);
+}
+
 bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest& request, const ResourceResponse& r)
 {
     if (r.httpStatusCode() / 100 == 4 || r.httpStatusCode() / 100 == 5) {
index 667205d..8ac5357 100644 (file)
@@ -122,6 +122,7 @@ namespace WebCore {
         void selectCacheWithManifest(const KURL& manifestURL);
 
         void maybeLoadMainResource(ResourceRequest&, SubstituteData&);
+        void maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&);
         bool maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse&);
         bool maybeLoadFallbackForMainError(const ResourceRequest&, const ResourceError&);
         void mainResourceDataReceived(const char* data, int length, long long lengthReceived, bool allAtOnce);
index f9b6ea6..54a3fc5 100644 (file)
@@ -1,3 +1,14 @@
+2010-10-28  Michael Nordman  <michaeln@google.com>
+
+        Reviewed by ap.
+
+        [Chrome] Fix an appcache regression introduced in r69226
+        https://bugs.webkit.org/show_bug.cgi?id=48592
+        Provide a noop method body ApplicationCacheHost::maybeLoadMainResourceForRedirect.
+
+        * src/ApplicationCacheHost.cpp:
+        (WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
+
 2010-10-29  Aaron Colwell  <acolwell@chromium.org>
 
         Reviewed by James Robinson.
index f1b1a91..a6e66c6 100644 (file)
@@ -113,6 +113,11 @@ void ApplicationCacheHost::selectCacheWithManifest(const KURL& manifestURL)
     }
 }
 
+void ApplicationCacheHost::maybeLoadMainResourceForRedirect(ResourceRequest&, SubstituteData&)
+{
+    // N/A to the chromium port
+}
+
 bool ApplicationCacheHost::maybeLoadFallbackForMainResponse(const ResourceRequest&, const ResourceResponse& response)
 {
     if (m_internal) {