diff options
Diffstat (limited to 'webkit/appcache/mock_appcache_storage.cc')
-rw-r--r-- | webkit/appcache/mock_appcache_storage.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/webkit/appcache/mock_appcache_storage.cc b/webkit/appcache/mock_appcache_storage.cc index 20ecf8d..8560074 100644 --- a/webkit/appcache/mock_appcache_storage.cc +++ b/webkit/appcache/mock_appcache_storage.cc @@ -34,6 +34,7 @@ MockAppCacheStorage::MockAppCacheStorage(AppCacheService* service) 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 @@ void MockAppCacheStorage::MakeGroupObsolete( } 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 @@ struct FoundCandidate { 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 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest( 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 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest( 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 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest( 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 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest( 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 @@ void MockAppCacheStorage::ProcessFindResponseForMainRequest( 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( |