diff options
author | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-04 23:20:25 +0000 |
---|---|---|
committer | michaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-04 23:20:25 +0000 |
commit | 0b28f3b07cf243d582fcc2ed4a59dceb3e3378ce (patch) | |
tree | 9029d0ad8fd76fba12c3a2398f124455fc770004 /webkit/appcache/appcache_update_job.cc | |
parent | ab2d6f997f12dbc5c182e1c1462df5daa8eaa748 (diff) | |
download | chromium_src-0b28f3b07cf243d582fcc2ed4a59dceb3e3378ce.zip chromium_src-0b28f3b07cf243d582fcc2ed4a59dceb3e3378ce.tar.gz chromium_src-0b28f3b07cf243d582fcc2ed4a59dceb3e3378ce.tar.bz2 |
When an update job doesn't complete successfully, doom all responses created by that job.
TEST=existing tests apply
BUG=none
Review URL: http://codereview.chromium.org/523039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_update_job.cc')
-rw-r--r-- | webkit/appcache/appcache_update_job.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc index fbe79ff..04c409e 100644 --- a/webkit/appcache/appcache_update_job.cc +++ b/webkit/appcache/appcache_update_job.cc @@ -265,6 +265,7 @@ void AppCacheUpdateJob::OnResponseStarted(URLRequest *request) { info->SetUpResponseWriter( service_->storage()->CreateResponseWriter(manifest_url_), this, request); + stored_response_ids_.push_back(info->response_writer_->response_id()); scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = new HttpResponseInfoIOBuffer( new net::HttpResponseInfo(request->response_info())); @@ -671,6 +672,7 @@ void AppCacheUpdateJob::HandleManifestRefetchCompleted(URLRequest* request) { } else { manifest_response_writer_.reset( service_->storage()->CreateResponseWriter(manifest_url_)); + stored_response_ids_.push_back(manifest_response_writer_->response_id()); scoped_refptr<HttpResponseInfoIOBuffer> io_buffer = new HttpResponseInfoIOBuffer(manifest_response_info_.release()); manifest_response_writer_->WriteInfo(io_buffer, @@ -1210,6 +1212,8 @@ void AppCacheUpdateJob::ClearPendingMasterEntries() { } void AppCacheUpdateJob::DiscardInprogressCache() { + service_->storage()->DoomResponses(manifest_url_, stored_response_ids_); + if (!inprogress_cache_) return; @@ -1217,9 +1221,6 @@ void AppCacheUpdateJob::DiscardInprogressCache() { while (!hosts.empty()) (*hosts.begin())->AssociateCache(NULL); - // TODO(jennb): Cleanup stored responses for entries in the cache? - // May not be necessary if handled automatically by storage layer. - inprogress_cache_ = NULL; } |