Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Unified Diff: webkit/appcache/mock_appcache_storage.cc

Issue 8343018: More groundwork for flat file based response storage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/appcache/mock_appcache_storage.h ('k') | webkit/appcache/mock_appcache_storage_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/mock_appcache_storage.cc
===================================================================
--- webkit/appcache/mock_appcache_storage.cc (revision 106339)
+++ webkit/appcache/mock_appcache_storage.cc (working copy)
@@ -34,6 +34,7 @@
simulate_find_main_resource_(false),
simulate_find_sub_resource_(false),
simulated_found_cache_id_(kNoCacheId),
+ simulated_found_group_id_(0),
simulated_found_network_namespace_(false) {
last_cache_id_ = 0;
last_group_id_ = 0;
@@ -146,15 +147,15 @@
}
AppCacheResponseReader* MockAppCacheStorage::CreateResponseReader(
- const GURL& manifest_url, int64 response_id) {
+ const GURL& manifest_url, int64 group_id, int64 response_id) {
if (simulated_reader_.get())
return simulated_reader_.release();
- return new AppCacheResponseReader(response_id, disk_cache());
+ return new AppCacheResponseReader(response_id, group_id, disk_cache());
}
AppCacheResponseWriter* MockAppCacheStorage::CreateResponseWriter(
- const GURL& manifest_url) {
- return new AppCacheResponseWriter(NewResponseId(), disk_cache());
+ const GURL& manifest_url, int64 group_id) {
+ return new AppCacheResponseWriter(NewResponseId(), group_id, disk_cache());
}
void MockAppCacheStorage::DoomResponses(
@@ -232,10 +233,12 @@
GURL url;
AppCacheEntry entry;
int64 cache_id;
+ int64 group_id;
GURL manifest_url;
bool is_cache_in_use;
- FoundCandidate() : cache_id(kNoCacheId), is_cache_in_use(false) {}
+ FoundCandidate()
+ : cache_id(kNoCacheId), group_id(0), is_cache_in_use(false) {}
};
} // namespace
@@ -248,7 +251,8 @@
delegate_ref->delegate->OnMainResponseFound(
url, simulated_found_entry_,
simulated_found_fallback_url_, simulated_found_fallback_entry_,
- simulated_found_cache_id_, simulated_found_manifest_url_);
+ simulated_found_cache_id_, simulated_found_group_id_,
+ simulated_found_manifest_url_);
}
return;
}
@@ -305,6 +309,7 @@
found_candidate.url = url;
found_candidate.entry = found_entry;
found_candidate.cache_id = cache->cache_id();
+ found_candidate.group_id = group->group_id();
found_candidate.manifest_url = group->manifest_url();
found_candidate.is_cache_in_use = is_in_use;
if (is_in_use)
@@ -337,6 +342,7 @@
cache->GetFallbackEntryUrl(found_fallback_namespace);
found_fallback_candidate.entry = found_fallback_entry;
found_fallback_candidate.cache_id = cache->cache_id();
+ found_fallback_candidate.group_id = group->group_id();
found_fallback_candidate.manifest_url = group->manifest_url();
found_fallback_candidate.is_cache_in_use = is_in_use;
found_fallback_candidate_namespace = found_fallback_namespace;
@@ -348,7 +354,8 @@
if (found_candidate.entry.has_response_id()) {
delegate_ref->delegate->OnMainResponseFound(
url, found_candidate.entry, GURL(), AppCacheEntry(),
- found_candidate.cache_id, found_candidate.manifest_url);
+ found_candidate.cache_id, found_candidate.group_id,
+ found_candidate.manifest_url);
return;
}
@@ -359,13 +366,14 @@
found_fallback_candidate.url,
found_fallback_candidate.entry,
found_fallback_candidate.cache_id,
+ found_fallback_candidate.group_id,
found_fallback_candidate.manifest_url);
return;
}
// Didn't find anything.
delegate_ref->delegate->OnMainResponseFound(
- url, AppCacheEntry(), GURL(), AppCacheEntry(), kNoCacheId, GURL());
+ url, AppCacheEntry(), GURL(), AppCacheEntry(), kNoCacheId, 0, GURL());
}
void MockAppCacheStorage::ProcessMakeGroupObsolete(
« no previous file with comments | « webkit/appcache/mock_appcache_storage.h ('k') | webkit/appcache/mock_appcache_storage_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698