diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-29 03:37:22 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-29 03:37:22 +0000 |
commit | 833a4baa2ccf968616d72361a74852c57f911d96 (patch) | |
tree | 07ccc3df12e7800ef381dd14ca2bda4e8760aa81 /webkit/appcache/appcache.cc | |
parent | 5ac84ca4f92eea80f31b5c7a58e41e35657a69ab (diff) | |
download | chromium_src-833a4baa2ccf968616d72361a74852c57f911d96.zip chromium_src-833a4baa2ccf968616d72361a74852c57f911d96.tar.gz chromium_src-833a4baa2ccf968616d72361a74852c57f911d96.tar.bz2 |
Revert 35328 - AppCacheDatabase and SQL based AppCacheStorageImpl.
Still nothing is being written to disk with this CL,
inmemory SQLite and DiskCaches are being utilized.
Responses are not yet being removed from the DiskCasche
when the should be. Once that's done (in the next CL), we'll
start saving things on disk.
BUG=none
TEST=appcache_database_unittest.cc, appcache_storage_impl_unittest.cc
Review URL: http://codereview.chromium.org/501033
TBR=michaeln@chromium.org
Review URL: http://codereview.chromium.org/519018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache.cc')
-rw-r--r-- | webkit/appcache/appcache.cc | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/webkit/appcache/appcache.cc b/webkit/appcache/appcache.cc index ec00cc4..38d3228 100644 --- a/webkit/appcache/appcache.cc +++ b/webkit/appcache/appcache.cc @@ -79,84 +79,6 @@ void AppCache::InitializeWithManifest(Manifest* manifest) { SortByLength); } -void AppCache::InitializeWithDatabaseRecords( - const AppCacheDatabase::CacheRecord& cache_record, - const std::vector<AppCacheDatabase::EntryRecord>& entries, - const std::vector<AppCacheDatabase::FallbackNameSpaceRecord>& fallbacks, - const std::vector<AppCacheDatabase::OnlineWhiteListRecord>& whitelists) { - DCHECK(cache_id_ == cache_record.cache_id); - online_whitelist_all_ = cache_record.online_wildcard; - update_time_ = cache_record.update_time; - - for (size_t i = 0; i < entries.size(); ++i) { - const AppCacheDatabase::EntryRecord& entry = entries.at(i); - AddEntry(entry.url, AppCacheEntry(entry.flags, entry.response_id)); - } - - for (size_t i = 0; i < fallbacks.size(); ++i) { - const AppCacheDatabase::FallbackNameSpaceRecord& fallback = fallbacks.at(i); - fallback_namespaces_.push_back( - FallbackNamespace(fallback.namespace_url, fallback.fallback_entry_url)); - } - - // Sort the fallback namespaces by url string length, longest to shortest, - // since longer matches trump when matching a url to a namespace. - std::sort(fallback_namespaces_.begin(), fallback_namespaces_.end(), - SortByLength); - - if (!online_whitelist_all_) { - for (size_t i = 0; i < whitelists.size(); ++i) { - online_whitelist_namespaces_.push_back(whitelists.at(i).namespace_url); - } - } -} - -void AppCache::ToDatabaseRecords( - const AppCacheGroup* group, - AppCacheDatabase::CacheRecord* cache_record, - std::vector<AppCacheDatabase::EntryRecord>* entries, - std::vector<AppCacheDatabase::FallbackNameSpaceRecord>* fallbacks, - std::vector<AppCacheDatabase::OnlineWhiteListRecord>* whitelists) { - DCHECK(group && cache_record && entries && fallbacks && whitelists); - DCHECK(entries->empty() && fallbacks->empty() && whitelists->empty()); - - cache_record->cache_id = cache_id_; - cache_record->group_id = group->group_id(); - cache_record->online_wildcard = online_whitelist_all_; - cache_record->update_time = update_time_; - - for (EntryMap::const_iterator iter = entries_.begin(); - iter != entries_.end(); ++iter) { - entries->push_back(AppCacheDatabase::EntryRecord()); - AppCacheDatabase::EntryRecord& record = entries->back(); - record.url = iter->first; - record.cache_id = cache_id_; - record.flags = iter->second.types(); - record.response_id = iter->second.response_id(); - } - - GURL origin = group->manifest_url().GetOrigin(); - - for (size_t i = 0; i < fallback_namespaces_.size(); ++i) { - fallbacks->push_back(AppCacheDatabase::FallbackNameSpaceRecord()); - AppCacheDatabase::FallbackNameSpaceRecord& record = fallbacks->back(); - record.cache_id = cache_id_; - record.origin = origin; - record.namespace_url = fallback_namespaces_[i].first; - record.fallback_entry_url = fallback_namespaces_[i].second; - } - - if (!online_whitelist_all_) { - for (size_t i = 0; i < online_whitelist_namespaces_.size(); ++i) { - whitelists->push_back(AppCacheDatabase::OnlineWhiteListRecord()); - AppCacheDatabase::OnlineWhiteListRecord& record = whitelists->back(); - record.cache_id = cache_id_; - record.namespace_url = online_whitelist_namespaces_[i]; - } - } -} - - bool AppCache::FindResponseForRequest(const GURL& url, AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, GURL* found_fallback_namespace, bool* found_network_namespace) { |