| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/thread_task_runner_handle.h" | 15 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "content/browser/appcache/appcache.h" | 16 #include "content/browser/appcache/appcache.h" |
| 17 #include "content/browser/appcache/appcache_entry.h" | 17 #include "content/browser/appcache/appcache_entry.h" |
| 18 #include "content/browser/appcache/appcache_group.h" | 18 #include "content/browser/appcache/appcache_group.h" |
| 19 #include "content/browser/appcache/appcache_response.h" | 19 #include "content/browser/appcache/appcache_response.h" |
| 20 #include "content/browser/appcache/appcache_service_impl.h" | 20 #include "content/browser/appcache/appcache_service_impl.h" |
| 21 | 21 |
| 22 // This is a quick and easy 'mock' implementation of the storage interface | 22 // This is a quick and easy 'mock' implementation of the storage interface |
| 23 // that doesn't put anything to disk. | 23 // that doesn't put anything to disk. |
| 24 // | 24 // |
| 25 // We simply add an extra reference to objects when they're put in storage, | 25 // We simply add an extra reference to objects when they're put in storage, |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { | 555 bool MockAppCacheStorage::ShouldCacheLoadAppearAsync(const AppCache* cache) { |
| 556 if (!cache) | 556 if (!cache) |
| 557 return true; | 557 return true; |
| 558 | 558 |
| 559 // If the 'stored' ref is the only ref, real storage will have to load from | 559 // If the 'stored' ref is the only ref, real storage will have to load from |
| 560 // the database. | 560 // the database. |
| 561 return IsCacheStored(cache) && cache->HasOneRef(); | 561 return IsCacheStored(cache) && cache->HasOneRef(); |
| 562 } | 562 } |
| 563 | 563 |
| 564 } // namespace content | 564 } // namespace content |
| OLD | NEW |