| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util.h" |
| 11 #include "webkit/appcache/appcache.h" | 11 #include "webkit/appcache/appcache.h" |
| 12 #include "webkit/appcache/appcache_entry.h" | 12 #include "webkit/appcache/appcache_entry.h" |
| 13 #include "webkit/appcache/appcache_group.h" | 13 #include "webkit/appcache/appcache_group.h" |
| 14 #include "webkit/appcache/appcache_response.h" | 14 #include "webkit/appcache/appcache_response.h" |
| 15 #include "webkit/appcache/appcache_service.h" | 15 #include "webkit/appcache/appcache_service.h" |
| 16 | 16 |
| 17 // This is a quick and easy 'mock' implementation of the storage interface | 17 // This is a quick and easy 'mock' implementation of the storage interface |
| 18 // that doesn't put anything to disk. | 18 // that doesn't put anything to disk. |
| 19 // | 19 // |
| 20 // We simply add an extra reference to objects when they're put in storage, | 20 // We simply add an extra reference to objects when they're put in storage, |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { | 481 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { |
| 482 if (!cache) | 482 if (!cache) |
| 483 return true; | 483 return true; |
| 484 | 484 |
| 485 // If the 'stored' ref is the only ref, real storage will have to load from | 485 // If the 'stored' ref is the only ref, real storage will have to load from |
| 486 // the database. | 486 // the database. |
| 487 return IsCacheStored(cache) && cache->HasOneRef(); | 487 return IsCacheStored(cache) && cache->HasOneRef(); |
| 488 } | 488 } |
| 489 | 489 |
| 490 } // namespace appcache | 490 } // namespace appcache |
| OLD | NEW |