diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 03:50:42 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-06 03:50:42 +0000 |
commit | ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6 (patch) | |
tree | 87a1e45bb6e93e1140a8719681fb653464bcea5e /webkit/appcache/appcache_update_job.cc | |
parent | fd4882e6faab19e1de6d791acebfa3b34faf5701 (diff) | |
download | chromium_src-ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6.zip chromium_src-ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6.tar.gz chromium_src-ee3cd175f8592b2b1f2ccd14b071d56ca733a5c6.tar.bz2 |
Revert 35609 - AppCache quota tracking groundwork, store response sizes in the SQL database.
TEST=updated existing unittests
BUG=none
Review URL: http://codereview.chromium.org/523046
TBR=michaeln@chromium.org
Review URL: http://codereview.chromium.org/525059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35610 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_update_job.cc')
-rw-r--r-- | webkit/appcache/appcache_update_job.cc | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/webkit/appcache/appcache_update_job.cc b/webkit/appcache/appcache_update_job.cc index a1f4ec5..04c409e 100644 --- a/webkit/appcache/appcache_update_job.cc +++ b/webkit/appcache/appcache_update_job.cc @@ -539,10 +539,8 @@ void AppCacheUpdateJob::HandleUrlFetchCompleted(URLRequest* request) { static_cast<UpdateJobInfo*>(request->GetUserData(this)); DCHECK(info->response_writer_.get()); entry.set_response_id(info->response_writer_->response_id()); - entry.set_response_size(info->response_writer_->amount_written()); - if (!inprogress_cache_->AddOrModifyEntry(url, entry)) - service_->storage()->DoomResponse(manifest_url_, entry.response_id()); + inprogress_cache_->AddOrModifyEntry(url, entry); // Foreign entries will be detected during cache selection. // Note: 6.9.4, step 17.9 possible optimization: if resource is HTML or XML @@ -569,7 +567,6 @@ void AppCacheUpdateJob::HandleUrlFetchCompleted(URLRequest* request) { AppCacheEntry* copy = cache->GetEntry(url); if (copy) { entry.set_response_id(copy->response_id()); - entry.set_response_size(copy->response_size()); inprogress_cache_->AddOrModifyEntry(url, entry); } } @@ -610,12 +607,8 @@ void AppCacheUpdateJob::HandleMasterEntryFetchCompleted(URLRequest* request) { group_->newest_complete_cache(); DCHECK(info->response_writer_.get()); AppCacheEntry master_entry(AppCacheEntry::MASTER, - info->response_writer_->response_id(), - info->response_writer_->amount_written()); - if (!cache->AddOrModifyEntry(url, master_entry)) { - service_->storage()->DoomResponse( - manifest_url_, master_entry.response_id()); - } + info->response_writer_->response_id()); + cache->AddOrModifyEntry(url, master_entry); // In no-update case, associate host with the newest cache. if (!inprogress_cache_) { @@ -708,10 +701,8 @@ void AppCacheUpdateJob::OnManifestInfoWriteComplete(int result) { void AppCacheUpdateJob::OnManifestDataWriteComplete(int result) { if (result > 0) { AppCacheEntry entry(AppCacheEntry::MANIFEST, - manifest_response_writer_->response_id(), - manifest_response_writer_->amount_written()); - if (!inprogress_cache_->AddOrModifyEntry(manifest_url_, entry)) - service_->storage()->DoomResponse(manifest_url_, entry.response_id()); + manifest_response_writer_->response_id()); + inprogress_cache_->AddOrModifyEntry(manifest_url_, entry); CompleteInprogressCache(); } else { // Treat storage failure as if refetch of manifest failed. @@ -1105,16 +1096,10 @@ void AppCacheUpdateJob::OnResponseInfoLoaded( http_info->headers->EnumerateHeader(&iter, name, &value)) { LoadFromNewestCacheFailed(url); } else { - DCHECK(group_->newest_complete_cache()); - AppCacheEntry* copy_me = group_->newest_complete_cache()->GetEntry(url); - DCHECK(copy_me); - DCHECK(copy_me->response_id() == response_id); - AppCache::EntryMap::iterator it = url_file_list_.find(url); DCHECK(it != url_file_list_.end()); AppCacheEntry& entry = it->second; entry.set_response_id(response_id); - entry.set_response_size(copy_me->response_size()); inprogress_cache_->AddOrModifyEntry(url, entry); ++url_fetches_completed_; } |