| 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 CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 6 #define CONTENT_BROWSER_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 23 matching lines...) Expand all Loading... |
| 34 virtual ~AppCacheStorageImpl(); | 34 virtual ~AppCacheStorageImpl(); |
| 35 | 35 |
| 36 void Initialize( | 36 void Initialize( |
| 37 const base::FilePath& cache_directory, | 37 const base::FilePath& cache_directory, |
| 38 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, | 38 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, |
| 39 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread); | 39 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread); |
| 40 void Disable(); | 40 void Disable(); |
| 41 bool is_disabled() const { return is_disabled_; } | 41 bool is_disabled() const { return is_disabled_; } |
| 42 | 42 |
| 43 // AppCacheStorage methods, see the base class for doc comments. | 43 // AppCacheStorage methods, see the base class for doc comments. |
| 44 virtual void GetAllInfo(Delegate* delegate) OVERRIDE; | 44 virtual void GetAllInfo(Delegate* delegate) override; |
| 45 virtual void LoadCache(int64 id, Delegate* delegate) OVERRIDE; | 45 virtual void LoadCache(int64 id, Delegate* delegate) override; |
| 46 virtual void LoadOrCreateGroup(const GURL& manifest_url, | 46 virtual void LoadOrCreateGroup(const GURL& manifest_url, |
| 47 Delegate* delegate) OVERRIDE; | 47 Delegate* delegate) override; |
| 48 virtual void StoreGroupAndNewestCache(AppCacheGroup* group, | 48 virtual void StoreGroupAndNewestCache(AppCacheGroup* group, |
| 49 AppCache* newest_cache, | 49 AppCache* newest_cache, |
| 50 Delegate* delegate) OVERRIDE; | 50 Delegate* delegate) override; |
| 51 virtual void FindResponseForMainRequest(const GURL& url, | 51 virtual void FindResponseForMainRequest(const GURL& url, |
| 52 const GURL& preferred_manifest_url, | 52 const GURL& preferred_manifest_url, |
| 53 Delegate* delegate) OVERRIDE; | 53 Delegate* delegate) override; |
| 54 virtual void FindResponseForSubRequest( | 54 virtual void FindResponseForSubRequest( |
| 55 AppCache* cache, const GURL& url, | 55 AppCache* cache, const GURL& url, |
| 56 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, | 56 AppCacheEntry* found_entry, AppCacheEntry* found_fallback_entry, |
| 57 bool* found_network_namespace) OVERRIDE; | 57 bool* found_network_namespace) override; |
| 58 virtual void MarkEntryAsForeign(const GURL& entry_url, | 58 virtual void MarkEntryAsForeign(const GURL& entry_url, |
| 59 int64 cache_id) OVERRIDE; | 59 int64 cache_id) override; |
| 60 virtual void MakeGroupObsolete(AppCacheGroup* group, | 60 virtual void MakeGroupObsolete(AppCacheGroup* group, |
| 61 Delegate* delegate, | 61 Delegate* delegate, |
| 62 int response_code) OVERRIDE; | 62 int response_code) override; |
| 63 virtual AppCacheResponseReader* CreateResponseReader( | 63 virtual AppCacheResponseReader* CreateResponseReader( |
| 64 const GURL& manifest_url, int64 group_id, int64 response_id) OVERRIDE; | 64 const GURL& manifest_url, int64 group_id, int64 response_id) override; |
| 65 virtual AppCacheResponseWriter* CreateResponseWriter( | 65 virtual AppCacheResponseWriter* CreateResponseWriter( |
| 66 const GURL& manifest_url, int64 group_id) OVERRIDE; | 66 const GURL& manifest_url, int64 group_id) override; |
| 67 virtual void DoomResponses(const GURL& manifest_url, | 67 virtual void DoomResponses(const GURL& manifest_url, |
| 68 const std::vector<int64>& response_ids) OVERRIDE; | 68 const std::vector<int64>& response_ids) override; |
| 69 virtual void DeleteResponses(const GURL& manifest_url, | 69 virtual void DeleteResponses(const GURL& manifest_url, |
| 70 const std::vector<int64>& response_ids) OVERRIDE; | 70 const std::vector<int64>& response_ids) override; |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 // The AppCacheStorageImpl class methods and datamembers may only be | 73 // The AppCacheStorageImpl class methods and datamembers may only be |
| 74 // accessed on the IO thread. This class manufactures seperate DatabaseTasks | 74 // accessed on the IO thread. This class manufactures seperate DatabaseTasks |
| 75 // which access the DB on a seperate background thread. | 75 // which access the DB on a seperate background thread. |
| 76 class DatabaseTask; | 76 class DatabaseTask; |
| 77 class InitTask; | 77 class InitTask; |
| 78 class DisableDatabaseTask; | 78 class DisableDatabaseTask; |
| 79 class GetAllInfoTask; | 79 class GetAllInfoTask; |
| 80 class StoreOrLoadTask; | 80 class StoreOrLoadTask; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 std::deque<base::Closure> pending_simple_tasks_; | 174 std::deque<base::Closure> pending_simple_tasks_; |
| 175 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; | 175 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; |
| 176 | 176 |
| 177 friend class content::AppCacheStorageImplTest; | 177 friend class content::AppCacheStorageImplTest; |
| 178 friend class content::ChromeAppCacheServiceTest; | 178 friend class content::ChromeAppCacheServiceTest; |
| 179 }; | 179 }; |
| 180 | 180 |
| 181 } // namespace content | 181 } // namespace content |
| 182 | 182 |
| 183 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 183 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ |
| OLD | NEW |