summaryrefslogtreecommitdiffstats
path: root/webkit/appcache
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/appcache')
-rw-r--r--webkit/appcache/appcache_request_handler.cc3
-rw-r--r--webkit/appcache/appcache_url_request_job.cc13
-rw-r--r--webkit/appcache/appcache_url_request_job.h6
3 files changed, 17 insertions, 5 deletions
diff --git a/webkit/appcache/appcache_request_handler.cc b/webkit/appcache/appcache_request_handler.cc
index 432534b..79f8909 100644
--- a/webkit/appcache/appcache_request_handler.cc
+++ b/webkit/appcache/appcache_request_handler.cc
@@ -53,7 +53,8 @@ AppCacheURLRequestJob* AppCacheRequestHandler::MaybeLoadResource(
// which will call thru to our interception layer again.
// This time thru, we return NULL so the request hits the wire.
if (job_) {
- DCHECK(job_->is_delivering_network_response());
+ DCHECK(job_->is_delivering_network_response() ||
+ job_->cache_entry_not_found());
job_ = NULL;
return NULL;
}
diff --git a/webkit/appcache/appcache_url_request_job.cc b/webkit/appcache/appcache_url_request_job.cc
index b4be06a..50549e5 100644
--- a/webkit/appcache/appcache_url_request_job.cc
+++ b/webkit/appcache/appcache_url_request_job.cc
@@ -23,8 +23,8 @@ AppCacheURLRequestJob::AppCacheURLRequestJob(
: URLRequestJob(request), storage_(storage),
has_been_started_(false), has_been_killed_(false),
delivery_type_(AWAITING_DELIVERY_ORDERS),
- cache_id_(kNoCacheId),
- is_fallback_(false),
+ cache_id_(kNoCacheId), is_fallback_(false),
+ cache_entry_not_found_(false),
ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_(
this, &AppCacheURLRequestJob::OnReadComplete)) {
DCHECK(storage_);
@@ -122,8 +122,13 @@ void AppCacheURLRequestJob::OnResponseInfoLoaded(
NotifyHeadersComplete();
} else {
- NotifyStartError(
- URLRequestStatus(URLRequestStatus::FAILED, net::ERR_FAILED));
+ // A resource that is expected to be in the appcache is missing.
+ // See http://code.google.com/p/chromium/issues/detail?id=50657
+ // Instead of failing the request, we restart the request. The retry
+ // attempt will fallthru to the network instead of trying to load
+ // from the appcache.
+ cache_entry_not_found_ = true;
+ NotifyRestartRequired();
}
storage_ = NULL; // no longer needed
}
diff --git a/webkit/appcache/appcache_url_request_job.h b/webkit/appcache/appcache_url_request_job.h
index 5e7dce2..8593ca1 100644
--- a/webkit/appcache/appcache_url_request_job.h
+++ b/webkit/appcache/appcache_url_request_job.h
@@ -69,6 +69,11 @@ class AppCacheURLRequestJob : public URLRequestJob,
return has_been_killed_;
}
+ // Returns true if the cache entry was not found in the disk cache.
+ bool cache_entry_not_found() const {
+ return cache_entry_not_found_;
+ }
+
private:
friend class AppCacheRequestHandlerTest;
friend class AppCacheURLRequestJobTest;
@@ -132,6 +137,7 @@ class AppCacheURLRequestJob : public URLRequestJob,
int64 cache_id_;
AppCacheEntry entry_;
bool is_fallback_;
+ bool cache_entry_not_found_;
scoped_refptr<AppCacheResponseInfo> info_;
net::HttpByteRange range_requested_;
scoped_ptr<net::HttpResponseInfo> range_response_info_;