| 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 #ifndef WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 5 #ifndef WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| 6 #define WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 6 #define WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 explicit AppCacheStorageImpl(AppCacheService* service); | 24 explicit AppCacheStorageImpl(AppCacheService* service); |
| 25 virtual ~AppCacheStorageImpl(); | 25 virtual ~AppCacheStorageImpl(); |
| 26 | 26 |
| 27 void Initialize(const FilePath& cache_directory, | 27 void Initialize(const FilePath& cache_directory, |
| 28 base::MessageLoopProxy* cache_thread); | 28 base::MessageLoopProxy* cache_thread); |
| 29 void Disable(); | 29 void Disable(); |
| 30 bool is_disabled() const { return is_disabled_; } | 30 bool is_disabled() const { return is_disabled_; } |
| 31 | 31 |
| 32 // AppCacheStorage methods, see the base class for doc comments. | 32 // AppCacheStorage methods, see the base class for doc comments. |
| 33 virtual void GetAllInfo(Delegate* delegate); | 33 virtual void GetAllInfo(Delegate* delegate); |
| 34 virtual void SyncGetAllInfo(Delegate* delegate); |
| 34 virtual void LoadCache(int64 id, Delegate* delegate); | 35 virtual void LoadCache(int64 id, Delegate* delegate); |
| 35 virtual void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate); | 36 virtual void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate); |
| 37 virtual void SyncLoadOrCreateGroup(const GURL& manifest_url, |
| 38 Delegate* delegate); |
| 36 virtual void StoreGroupAndNewestCache( | 39 virtual void StoreGroupAndNewestCache( |
| 37 AppCacheGroup* group, AppCache* newest_cache, Delegate* delegate); | 40 AppCacheGroup* group, AppCache* newest_cache, Delegate* delegate); |
| 38 virtual void FindResponseForMainRequest( | 41 virtual void FindResponseForMainRequest( |
| 39 const GURL& url, const GURL& preferred_manifest_url, Delegate* delegate); | 42 const GURL& url, const GURL& preferred_manifest_url, Delegate* delegate); |
| 40 virtual void FindResponseForSubRequest( | 43 virtual void FindResponseForSubRequest( |
| 41 AppCache* cache, const GURL& url, | 44 AppCache* cache, const GURL& url, |
| 42 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, | 45 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, |
| 43 bool* found_network_namespace); | 46 bool* found_network_namespace); |
| 44 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id); | 47 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id); |
| 45 virtual void MakeGroupObsolete(AppCacheGroup* group, Delegate* delegate); | 48 virtual void MakeGroupObsolete(AppCacheGroup* group, Delegate* delegate); |
| 49 virtual void SyncMakeGroupObsolete(AppCacheGroup* group, Delegate* delegate); |
| 46 virtual AppCacheResponseReader* CreateResponseReader( | 50 virtual AppCacheResponseReader* CreateResponseReader( |
| 47 const GURL& manifest_url, int64 response_id); | 51 const GURL& manifest_url, int64 response_id); |
| 48 virtual AppCacheResponseWriter* CreateResponseWriter( | 52 virtual AppCacheResponseWriter* CreateResponseWriter( |
| 49 const GURL& manifest_url); | 53 const GURL& manifest_url); |
| 50 virtual void DoomResponses( | 54 virtual void DoomResponses( |
| 51 const GURL& manifest_url, const std::vector<int64>& response_ids); | 55 const GURL& manifest_url, const std::vector<int64>& response_ids); |
| 52 virtual void DeleteResponses( | 56 virtual void DeleteResponses( |
| 53 const GURL& manifest_url, const std::vector<int64>& response_ids); | 57 const GURL& manifest_url, const std::vector<int64>& response_ids); |
| 54 virtual void PurgeMemory(); | 58 virtual void PurgeMemory(); |
| 55 | 59 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // disk cache and cannot continue. | 154 // disk cache and cannot continue. |
| 151 bool is_disabled_; | 155 bool is_disabled_; |
| 152 | 156 |
| 153 // TODO(michaeln): use a disk_cache per group (manifest or group_id). | 157 // TODO(michaeln): use a disk_cache per group (manifest or group_id). |
| 154 scoped_ptr<AppCacheDiskCache> disk_cache_; | 158 scoped_ptr<AppCacheDiskCache> disk_cache_; |
| 155 | 159 |
| 156 // Used to short-circuit certain operations without having to schedule | 160 // Used to short-circuit certain operations without having to schedule |
| 157 // any tasks on the background database thread. | 161 // any tasks on the background database thread. |
| 158 std::deque<Task*> pending_simple_tasks_; | 162 std::deque<Task*> pending_simple_tasks_; |
| 159 ScopedRunnableMethodFactory<AppCacheStorageImpl> method_factory_; | 163 ScopedRunnableMethodFactory<AppCacheStorageImpl> method_factory_; |
| 160 | |
| 161 FRIEND_TEST_ALL_PREFIXES(ChromeAppCacheServiceTest, KeepOnDestruction); | |
| 162 FRIEND_TEST_ALL_PREFIXES(ChromeAppCacheServiceTest, RemoveOnDestruction); | |
| 163 }; | 164 }; |
| 164 | 165 |
| 165 } // namespace appcache | 166 } // namespace appcache |
| 166 | 167 |
| 167 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 168 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| OLD | NEW |