| OLD | NEW |
| 1 // Copyright (c) 2010 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> |
| 11 #include <vector> | 11 #include <vector> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 virtual AppCacheResponseReader* CreateResponseReader( | 45 virtual AppCacheResponseReader* CreateResponseReader( |
| 46 const GURL& manifest_url, int64 response_id); | 46 const GURL& manifest_url, int64 response_id); |
| 47 virtual AppCacheResponseWriter* CreateResponseWriter( | 47 virtual AppCacheResponseWriter* CreateResponseWriter( |
| 48 const GURL& manifest_url); | 48 const GURL& manifest_url); |
| 49 virtual void DoomResponses( | 49 virtual void DoomResponses( |
| 50 const GURL& manifest_url, const std::vector<int64>& response_ids); | 50 const GURL& manifest_url, const std::vector<int64>& response_ids); |
| 51 virtual void DeleteResponses( | 51 virtual void DeleteResponses( |
| 52 const GURL& manifest_url, const std::vector<int64>& response_ids); | 52 const GURL& manifest_url, const std::vector<int64>& response_ids); |
| 53 virtual void PurgeMemory(); | 53 virtual void PurgeMemory(); |
| 54 | 54 |
| 55 protected: |
| 56 AppCacheDiskCache* disk_cache(); |
| 57 // Used by the ChromeAppCacheService unit tests. |
| 58 AppCacheDatabase* database() { return database_; } |
| 59 |
| 60 FRIEND_TEST_ALL_PREFIXES(ChromeAppCacheServiceTest, KeepOnDestruction); |
| 61 FRIEND_TEST_ALL_PREFIXES(ChromeAppCacheServiceTest, RemoveOnDestruction); |
| 62 |
| 55 private: | 63 private: |
| 56 friend class AppCacheStorageImplTest; | 64 friend class AppCacheStorageImplTest; |
| 57 | 65 |
| 58 // The AppCacheStorageImpl class methods and datamembers may only be | 66 // The AppCacheStorageImpl class methods and datamembers may only be |
| 59 // accessed on the IO thread. This class manufactures seperate DatabaseTasks | 67 // accessed on the IO thread. This class manufactures seperate DatabaseTasks |
| 60 // which access the DB on a seperate background thread. | 68 // which access the DB on a seperate background thread. |
| 61 class DatabaseTask; | 69 class DatabaseTask; |
| 62 class InitTask; | 70 class InitTask; |
| 63 class CloseConnectionTask; | 71 class CloseConnectionTask; |
| 64 class DisableDatabaseTask; | 72 class DisableDatabaseTask; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const GURL& url, AppCacheEntry found_entry, | 113 const GURL& url, AppCacheEntry found_entry, |
| 106 scoped_refptr<AppCacheGroup> group, scoped_refptr<AppCache> newest_cache, | 114 scoped_refptr<AppCacheGroup> group, scoped_refptr<AppCache> newest_cache, |
| 107 scoped_refptr<DelegateReference> delegate_ref); | 115 scoped_refptr<DelegateReference> delegate_ref); |
| 108 | 116 |
| 109 void CheckPolicyAndCallOnMainResponseFound( | 117 void CheckPolicyAndCallOnMainResponseFound( |
| 110 DelegateReferenceVector* delegates, | 118 DelegateReferenceVector* delegates, |
| 111 const GURL& url, const AppCacheEntry& entry, | 119 const GURL& url, const AppCacheEntry& entry, |
| 112 const GURL& fallback_url, const AppCacheEntry& fallback_entry, | 120 const GURL& fallback_url, const AppCacheEntry& fallback_entry, |
| 113 int64 cache_id, const GURL& manifest_url); | 121 int64 cache_id, const GURL& manifest_url); |
| 114 | 122 |
| 115 AppCacheDiskCache* disk_cache(); | |
| 116 | |
| 117 // The directory in which we place files in the file system. | 123 // The directory in which we place files in the file system. |
| 118 FilePath cache_directory_; | 124 FilePath cache_directory_; |
| 119 scoped_refptr<base::MessageLoopProxy> cache_thread_; | 125 scoped_refptr<base::MessageLoopProxy> cache_thread_; |
| 120 bool is_incognito_; | 126 bool is_incognito_; |
| 121 | 127 |
| 122 // Structures to keep track of DatabaseTasks that are in-flight. | 128 // Structures to keep track of DatabaseTasks that are in-flight. |
| 123 DatabaseTaskQueue scheduled_database_tasks_; | 129 DatabaseTaskQueue scheduled_database_tasks_; |
| 124 PendingCacheLoads pending_cache_loads_; | 130 PendingCacheLoads pending_cache_loads_; |
| 125 PendingGroupLoads pending_group_loads_; | 131 PendingGroupLoads pending_group_loads_; |
| 126 PendingForeignMarkings pending_foreign_markings_; | 132 PendingForeignMarkings pending_foreign_markings_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 149 // Used to short-circuit certain operations without having to schedule | 155 // Used to short-circuit certain operations without having to schedule |
| 150 // any tasks on the background database thread. | 156 // any tasks on the background database thread. |
| 151 std::set<GURL> origins_with_groups_; | 157 std::set<GURL> origins_with_groups_; |
| 152 std::deque<Task*> pending_simple_tasks_; | 158 std::deque<Task*> pending_simple_tasks_; |
| 153 ScopedRunnableMethodFactory<AppCacheStorageImpl> method_factory_; | 159 ScopedRunnableMethodFactory<AppCacheStorageImpl> method_factory_; |
| 154 }; | 160 }; |
| 155 | 161 |
| 156 } // namespace appcache | 162 } // namespace appcache |
| 157 | 163 |
| 158 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 164 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| OLD | NEW |