| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "webkit/appcache/mock_appcache_storage.h" | 5 #include "webkit/appcache/mock_appcache_storage.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| 11 #include "webkit/appcache/appcache.h" | 11 #include "webkit/appcache/appcache.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 if (found_fallback_candidate.entry.has_response_id()) { | 328 if (found_fallback_candidate.entry.has_response_id()) { |
| 329 delegate_ref->delegate->OnMainResponseFound( | 329 delegate_ref->delegate->OnMainResponseFound( |
| 330 url, AppCacheEntry(), found_fallback_candidate.entry, | 330 url, AppCacheEntry(), found_fallback_candidate.entry, |
| 331 found_fallback_candidate.cache_id, | 331 found_fallback_candidate.cache_id, |
| 332 found_fallback_candidate.manifest_url); | 332 found_fallback_candidate.manifest_url); |
| 333 return; | 333 return; |
| 334 } | 334 } |
| 335 | 335 |
| 336 // Didn't find anything. | 336 // Didn't find anything. |
| 337 delegate_ref->delegate->OnMainResponseFound( | 337 delegate_ref->delegate->OnMainResponseFound( |
| 338 url, AppCacheEntry(), AppCacheEntry(), | 338 url, AppCacheEntry(), AppCacheEntry(), kNoCacheId, GURL()); |
| 339 kNoCacheId, GURL::EmptyGURL()); | |
| 340 } | 339 } |
| 341 | 340 |
| 342 void MockAppCacheStorage::ProcessMakeGroupObsolete( | 341 void MockAppCacheStorage::ProcessMakeGroupObsolete( |
| 343 scoped_refptr<AppCacheGroup> group, | 342 scoped_refptr<AppCacheGroup> group, |
| 344 scoped_refptr<DelegateReference> delegate_ref) { | 343 scoped_refptr<DelegateReference> delegate_ref) { |
| 345 if (simulate_make_group_obsolete_failure_) { | 344 if (simulate_make_group_obsolete_failure_) { |
| 346 if (delegate_ref->delegate) | 345 if (delegate_ref->delegate) |
| 347 delegate_ref->delegate->OnGroupMadeObsolete(group, false); | 346 delegate_ref->delegate->OnGroupMadeObsolete(group, false); |
| 348 return; | 347 return; |
| 349 } | 348 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { | 449 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { |
| 451 if (!cache) | 450 if (!cache) |
| 452 return true; | 451 return true; |
| 453 | 452 |
| 454 // If the 'stored' ref is the only ref, real storage will have to load from | 453 // If the 'stored' ref is the only ref, real storage will have to load from |
| 455 // the database. | 454 // the database. |
| 456 return IsCacheStored(cache) && cache->HasOneRef(); | 455 return IsCacheStored(cache) && cache->HasOneRef(); |
| 457 } | 456 } |
| 458 | 457 |
| 459 } // namespace appcache | 458 } // namespace appcache |
| OLD | NEW |