OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |