diff options
Diffstat (limited to 'WebCore/loader/ResourceLoader.cpp')
-rw-r--r-- | WebCore/loader/ResourceLoader.cpp | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/WebCore/loader/ResourceLoader.cpp b/WebCore/loader/ResourceLoader.cpp index 4f55981..5ad181b 100644 --- a/WebCore/loader/ResourceLoader.cpp +++ b/WebCore/loader/ResourceLoader.cpp @@ -30,6 +30,7 @@ #include "config.h" #include "ResourceLoader.h" +#include "ApplicationCacheHost.h" #include "DocumentLoader.h" #include "Frame.h" #include "FrameLoader.h" @@ -121,7 +122,7 @@ bool ResourceLoader::load(const ResourceRequest& r) #endif #if ENABLE(OFFLINE_WEB_APPLICATIONS) - if (m_documentLoader->scheduleApplicationCacheLoad(this, clientRequest, r.url())) + if (m_documentLoader->applicationCacheHost()->maybeLoadResource(this, clientRequest, r.url())) return true; #endif @@ -192,17 +193,6 @@ void ResourceLoader::clearResourceData() m_resourceData->clear(); } -#if ENABLE(OFFLINE_WEB_APPLICATIONS) -bool ResourceLoader::scheduleLoadFallbackResourceFromApplicationCache(ApplicationCache* cache) -{ - if (documentLoader()->scheduleLoadFallbackResourceFromApplicationCache(this, m_request, cache)) { - handle()->cancel(); - return true; - } - return false; -} -#endif - void ResourceLoader::willSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse) { // Protect this in this delegate method since the additional processing can do @@ -384,10 +374,8 @@ ResourceError ResourceLoader::cannotShowURLError() void ResourceLoader::willSendRequest(ResourceHandle*, ResourceRequest& request, const ResourceResponse& redirectResponse) { #if ENABLE(OFFLINE_WEB_APPLICATIONS) - if (!redirectResponse.isNull() && !protocolHostAndPortAreEqual(request.url(), redirectResponse.url())) { - if (scheduleLoadFallbackResourceFromApplicationCache()) - return; - } + if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForRedirect(this, request, redirectResponse)) + return; #endif willSendRequest(request, redirectResponse); } @@ -400,10 +388,8 @@ void ResourceLoader::didSendData(ResourceHandle*, unsigned long long bytesSent, void ResourceLoader::didReceiveResponse(ResourceHandle*, const ResourceResponse& response) { #if ENABLE(OFFLINE_WEB_APPLICATIONS) - if (response.httpStatusCode() / 100 == 4 || response.httpStatusCode() / 100 == 5) { - if (scheduleLoadFallbackResourceFromApplicationCache()) - return; - } + if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForResponse(this, response)) + return; #endif didReceiveResponse(response); } @@ -421,10 +407,8 @@ void ResourceLoader::didFinishLoading(ResourceHandle*) void ResourceLoader::didFail(ResourceHandle*, const ResourceError& error) { #if ENABLE(OFFLINE_WEB_APPLICATIONS) - if (!error.isCancellation()) { - if (documentLoader()->scheduleLoadFallbackResourceFromApplicationCache(this, m_request)) - return; - } + if (documentLoader()->applicationCacheHost()->maybeLoadFallbackForError(this, error)) + return; #endif didFail(error); } |