| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 AppCacheGroup* group, AppCache* newest_cache, Delegate* delegate); | 42 AppCacheGroup* group, AppCache* newest_cache, Delegate* delegate); |
| 43 virtual void FindResponseForMainRequest( | 43 virtual void FindResponseForMainRequest( |
| 44 const GURL& url, const GURL& preferred_manifest_url, Delegate* delegate); | 44 const GURL& url, const GURL& preferred_manifest_url, Delegate* delegate); |
| 45 virtual void FindResponseForSubRequest( | 45 virtual void FindResponseForSubRequest( |
| 46 AppCache* cache, const GURL& url, | 46 AppCache* cache, const GURL& url, |
| 47 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, | 47 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, |
| 48 bool* found_network_namespace); | 48 bool* found_network_namespace); |
| 49 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id); | 49 virtual void MarkEntryAsForeign(const GURL& entry_url, int64 cache_id); |
| 50 virtual void MakeGroupObsolete(AppCacheGroup* group, Delegate* delegate); | 50 virtual void MakeGroupObsolete(AppCacheGroup* group, Delegate* delegate); |
| 51 virtual AppCacheResponseReader* CreateResponseReader( | 51 virtual AppCacheResponseReader* CreateResponseReader( |
| 52 const GURL& manifest_url, int64 response_id); | 52 const GURL& manifest_url, int64 group_id, int64 response_id); |
| 53 virtual AppCacheResponseWriter* CreateResponseWriter( | 53 virtual AppCacheResponseWriter* CreateResponseWriter( |
| 54 const GURL& manifest_url); | 54 const GURL& manifest_url, int64 group_id); |
| 55 virtual void DoomResponses( | 55 virtual void DoomResponses( |
| 56 const GURL& manifest_url, const std::vector<int64>& response_ids); | 56 const GURL& manifest_url, const std::vector<int64>& response_ids); |
| 57 virtual void DeleteResponses( | 57 virtual void DeleteResponses( |
| 58 const GURL& manifest_url, const std::vector<int64>& response_ids); | 58 const GURL& manifest_url, const std::vector<int64>& response_ids); |
| 59 virtual void PurgeMemory(); | 59 virtual void PurgeMemory(); |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 friend class AppCacheStorageImplTest; | 62 friend class AppCacheStorageImplTest; |
| 63 | 63 |
| 64 // The AppCacheStorageImpl class methods and datamembers may only be | 64 // The AppCacheStorageImpl class methods and datamembers may only be |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 const GURL& url, | 114 const GURL& url, |
| 115 const AppCacheEntry& found_entry, | 115 const AppCacheEntry& found_entry, |
| 116 scoped_refptr<AppCacheGroup> group, | 116 scoped_refptr<AppCacheGroup> group, |
| 117 scoped_refptr<AppCache> newest_cache, | 117 scoped_refptr<AppCache> newest_cache, |
| 118 scoped_refptr<DelegateReference> delegate_ref); | 118 scoped_refptr<DelegateReference> delegate_ref); |
| 119 | 119 |
| 120 void CallOnMainResponseFound( | 120 void CallOnMainResponseFound( |
| 121 DelegateReferenceVector* delegates, | 121 DelegateReferenceVector* delegates, |
| 122 const GURL& url, const AppCacheEntry& entry, | 122 const GURL& url, const AppCacheEntry& entry, |
| 123 const GURL& fallback_url, const AppCacheEntry& fallback_entry, | 123 const GURL& fallback_url, const AppCacheEntry& fallback_entry, |
| 124 int64 cache_id, const GURL& manifest_url); | 124 int64 cache_id, int64 group_id, const GURL& manifest_url); |
| 125 | 125 |
| 126 APPCACHE_EXPORT AppCacheDiskCache* disk_cache(); | 126 APPCACHE_EXPORT AppCacheDiskCache* disk_cache(); |
| 127 | 127 |
| 128 // The directory in which we place files in the file system. | 128 // The directory in which we place files in the file system. |
| 129 FilePath cache_directory_; | 129 FilePath cache_directory_; |
| 130 bool is_incognito_; | 130 bool is_incognito_; |
| 131 | 131 |
| 132 // This class operates primarily on the IO thread, but schedules | 132 // This class operates primarily on the IO thread, but schedules |
| 133 // its DatabaseTasks on the db thread. Separately, the disk_cache uses | 133 // its DatabaseTasks on the db thread. Separately, the disk_cache uses |
| 134 // the cache_thread. | 134 // the cache_thread. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 153 net::OldCompletionCallbackImpl<AppCacheStorageImpl> doom_callback_; | 153 net::OldCompletionCallbackImpl<AppCacheStorageImpl> doom_callback_; |
| 154 net::OldCompletionCallbackImpl<AppCacheStorageImpl> init_callback_; | 154 net::OldCompletionCallbackImpl<AppCacheStorageImpl> init_callback_; |
| 155 | 155 |
| 156 // Created on the IO thread, but only used on the DB thread. | 156 // Created on the IO thread, but only used on the DB thread. |
| 157 AppCacheDatabase* database_; | 157 AppCacheDatabase* database_; |
| 158 | 158 |
| 159 // Set if we discover a fatal error like a corrupt SQL database or | 159 // Set if we discover a fatal error like a corrupt SQL database or |
| 160 // disk cache and cannot continue. | 160 // disk cache and cannot continue. |
| 161 bool is_disabled_; | 161 bool is_disabled_; |
| 162 | 162 |
| 163 // TODO(michaeln): use a disk_cache per group (manifest or group_id). | |
| 164 scoped_ptr<AppCacheDiskCache> disk_cache_; | 163 scoped_ptr<AppCacheDiskCache> disk_cache_; |
| 165 | 164 |
| 166 // Used to short-circuit certain operations without having to schedule | 165 // Used to short-circuit certain operations without having to schedule |
| 167 // any tasks on the background database thread. | 166 // any tasks on the background database thread. |
| 168 std::deque<base::Closure> pending_simple_tasks_; | 167 std::deque<base::Closure> pending_simple_tasks_; |
| 169 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; | 168 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; |
| 170 | 169 |
| 171 friend class ChromeAppCacheServiceTest; | 170 friend class ChromeAppCacheServiceTest; |
| 172 }; | 171 }; |
| 173 | 172 |
| 174 } // namespace appcache | 173 } // namespace appcache |
| 175 | 174 |
| 176 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 175 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| OLD | NEW |