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

Side by Side Diff: content/browser/appcache/mock_appcache_storage.cc

Issue 2902653002: Get main frame and subframe AppCache loads to work. (Closed)
Patch Set: Address review comments Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/appcache/mock_appcache_storage.h" 5 #include "content/browser/appcache/mock_appcache_storage.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 const std::vector<int64_t>& response_ids) { 194 const std::vector<int64_t>& response_ids) {
195 // We don't bother with actually removing responses from the disk-cache, 195 // We don't bother with actually removing responses from the disk-cache,
196 // just keep track of which ids have been doomed or deleted 196 // just keep track of which ids have been doomed or deleted
197 std::vector<int64_t>::const_iterator it = response_ids.begin(); 197 std::vector<int64_t>::const_iterator it = response_ids.begin();
198 while (it != response_ids.end()) { 198 while (it != response_ids.end()) {
199 doomed_response_ids_.insert(*it); 199 doomed_response_ids_.insert(*it);
200 ++it; 200 ++it;
201 } 201 }
202 } 202 }
203 203
204 bool MockAppCacheStorage::IsInitialized() {
205 return false;
206 }
207
204 void MockAppCacheStorage::ProcessGetAllInfo( 208 void MockAppCacheStorage::ProcessGetAllInfo(
205 scoped_refptr<DelegateReference> delegate_ref) { 209 scoped_refptr<DelegateReference> delegate_ref) {
206 if (delegate_ref->delegate) 210 if (delegate_ref->delegate)
207 delegate_ref->delegate->OnAllInfo(simulated_appcache_info_.get()); 211 delegate_ref->delegate->OnAllInfo(simulated_appcache_info_.get());
208 } 212 }
209 213
210 void MockAppCacheStorage::ProcessLoadCache( 214 void MockAppCacheStorage::ProcessLoadCache(
211 int64_t id, 215 int64_t id,
212 scoped_refptr<DelegateReference> delegate_ref) { 216 scoped_refptr<DelegateReference> delegate_ref) {
213 AppCache* cache = working_set_.GetCache(id); 217 AppCache* cache = working_set_.GetCache(id);
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { 559 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) {
556 if (!cache) 560 if (!cache)
557 return true; 561 return true;
558 562
559 // If the 'stored' ref is the only ref, real storage will have to load from 563 // If the 'stored' ref is the only ref, real storage will have to load from
560 // the database. 564 // the database.
561 return IsCacheStored(cache) && cache->HasOneRef(); 565 return IsCacheStored(cache) && cache->HasOneRef();
562 } 566 }
563 567
564 } // namespace content 568 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/mock_appcache_storage.h ('k') | content/browser/loader/navigation_url_loader_network_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698