| 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 class ChromeAppCacheServiceTest; | 24 class ChromeAppCacheServiceTest; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace appcache { | 27 namespace appcache { |
| 28 | 28 |
| 29 class AppCacheStorageImpl : public AppCacheStorage { | 29 class AppCacheStorageImpl : public AppCacheStorage { |
| 30 public: | 30 public: |
| 31 explicit AppCacheStorageImpl(AppCacheService* service); | 31 explicit AppCacheStorageImpl(AppCacheService* service); |
| 32 virtual ~AppCacheStorageImpl(); | 32 virtual ~AppCacheStorageImpl(); |
| 33 | 33 |
| 34 void Initialize(const FilePath& cache_directory, | 34 void Initialize(const base::FilePath& cache_directory, |
| 35 base::MessageLoopProxy* db_thread, | 35 base::MessageLoopProxy* db_thread, |
| 36 base::MessageLoopProxy* cache_thread); | 36 base::MessageLoopProxy* cache_thread); |
| 37 void Disable(); | 37 void Disable(); |
| 38 bool is_disabled() const { return is_disabled_; } | 38 bool is_disabled() const { return is_disabled_; } |
| 39 | 39 |
| 40 // AppCacheStorage methods, see the base class for doc comments. | 40 // AppCacheStorage methods, see the base class for doc comments. |
| 41 virtual void GetAllInfo(Delegate* delegate) OVERRIDE; | 41 virtual void GetAllInfo(Delegate* delegate) OVERRIDE; |
| 42 virtual void LoadCache(int64 id, Delegate* delegate) OVERRIDE; | 42 virtual void LoadCache(int64 id, Delegate* delegate) OVERRIDE; |
| 43 virtual void LoadOrCreateGroup(const GURL& manifest_url, | 43 virtual void LoadOrCreateGroup(const GURL& manifest_url, |
| 44 Delegate* delegate) OVERRIDE; | 44 Delegate* delegate) OVERRIDE; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 127 |
| 128 void CallOnMainResponseFound( | 128 void CallOnMainResponseFound( |
| 129 DelegateReferenceVector* delegates, | 129 DelegateReferenceVector* delegates, |
| 130 const GURL& url, const AppCacheEntry& entry, | 130 const GURL& url, const AppCacheEntry& entry, |
| 131 const GURL& namespace_entry_url, const AppCacheEntry& fallback_entry, | 131 const GURL& namespace_entry_url, const AppCacheEntry& fallback_entry, |
| 132 int64 cache_id, int64 group_id, const GURL& manifest_url); | 132 int64 cache_id, int64 group_id, const GURL& manifest_url); |
| 133 | 133 |
| 134 WEBKIT_STORAGE_EXPORT AppCacheDiskCache* disk_cache(); | 134 WEBKIT_STORAGE_EXPORT AppCacheDiskCache* disk_cache(); |
| 135 | 135 |
| 136 // The directory in which we place files in the file system. | 136 // The directory in which we place files in the file system. |
| 137 FilePath cache_directory_; | 137 base::FilePath cache_directory_; |
| 138 bool is_incognito_; | 138 bool is_incognito_; |
| 139 | 139 |
| 140 // This class operates primarily on the IO thread, but schedules | 140 // This class operates primarily on the IO thread, but schedules |
| 141 // its DatabaseTasks on the db thread. Separately, the disk_cache uses | 141 // its DatabaseTasks on the db thread. Separately, the disk_cache uses |
| 142 // the cache_thread. | 142 // the cache_thread. |
| 143 scoped_refptr<base::MessageLoopProxy> db_thread_; | 143 scoped_refptr<base::MessageLoopProxy> db_thread_; |
| 144 scoped_refptr<base::MessageLoopProxy> cache_thread_; | 144 scoped_refptr<base::MessageLoopProxy> cache_thread_; |
| 145 | 145 |
| 146 // Structures to keep track of DatabaseTasks that are in-flight. | 146 // Structures to keep track of DatabaseTasks that are in-flight. |
| 147 DatabaseTaskQueue scheduled_database_tasks_; | 147 DatabaseTaskQueue scheduled_database_tasks_; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 170 // any tasks on the background database thread. | 170 // any tasks on the background database thread. |
| 171 std::deque<base::Closure> pending_simple_tasks_; | 171 std::deque<base::Closure> pending_simple_tasks_; |
| 172 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; | 172 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; |
| 173 | 173 |
| 174 friend class content::ChromeAppCacheServiceTest; | 174 friend class content::ChromeAppCacheServiceTest; |
| 175 }; | 175 }; |
| 176 | 176 |
| 177 } // namespace appcache | 177 } // namespace appcache |
| 178 | 178 |
| 179 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 179 #endif // WEBKIT_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| OLD | NEW |