diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-25 21:38:20 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-25 21:38:20 +0000 |
commit | 1e1f7d57ce439e571ba0497059a9175873b8ce22 (patch) | |
tree | fbfb482087c7384a0f4dc777d1400415568e7c63 /webkit/appcache/appcache_request_handler.cc | |
parent | 144d381bffe572747715961f5380997db326806a (diff) | |
download | chromium_src-1e1f7d57ce439e571ba0497059a9175873b8ce22.zip chromium_src-1e1f7d57ce439e571ba0497059a9175873b8ce22.tar.gz chromium_src-1e1f7d57ce439e571ba0497059a9175873b8ce22.tar.bz2 |
Be a little more defensive when encoutering missing appcache entries, the handler that discovers a missing entry will not attempt to intercept anything else.
BUG=50657
TEST=none
Review URL: http://codereview.chromium.org/3177032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57395 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_request_handler.cc')
-rw-r--r-- | webkit/appcache/appcache_request_handler.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/webkit/appcache/appcache_request_handler.cc b/webkit/appcache/appcache_request_handler.cc index 79f8909..f193139 100644 --- a/webkit/appcache/appcache_request_handler.cc +++ b/webkit/appcache/appcache_request_handler.cc @@ -15,7 +15,7 @@ AppCacheRequestHandler::AppCacheRequestHandler(AppCacheHost* host, ResourceType::Type resource_type) : host_(host), resource_type_(resource_type), is_waiting_for_cache_selection_(false), found_cache_id_(0), - found_network_namespace_(false) { + found_network_namespace_(false), cache_entry_not_found_(false) { DCHECK(host_); host_->AddObserver(this); } @@ -42,7 +42,7 @@ void AppCacheRequestHandler::GetExtraResponseInfo( AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource( URLRequest* request) { - if (!host_ || !IsSchemeAndMethodSupported(request)) + if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) return NULL; // This method can get called multiple times over the life @@ -55,6 +55,8 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource( if (job_) { DCHECK(job_->is_delivering_network_response() || job_->cache_entry_not_found()); + if (job_->cache_entry_not_found()) + cache_entry_not_found_ = true; job_ = NULL; return NULL; } @@ -85,7 +87,7 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource( AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( URLRequest* request, const GURL& location) { - if (!host_ || !IsSchemeAndMethodSupported(request)) + if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) return NULL; if (is_main_resource()) return NULL; @@ -113,7 +115,7 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForRedirect( AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadFallbackForResponse( URLRequest* request) { - if (!host_ || !IsSchemeAndMethodSupported(request)) + if (!host_ || !IsSchemeAndMethodSupported(request) || cache_entry_not_found_) return NULL; if (!found_fallback_entry_.has_response_id()) return NULL; |