| 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_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 
| 6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 6 #define WEBKIT_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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 60       const GURL& manifest_url, int64 group_id, int64 response_id) OVERRIDE; | 60       const GURL& manifest_url, int64 group_id, int64 response_id) OVERRIDE; | 
| 61   virtual AppCacheResponseWriter* CreateResponseWriter( | 61   virtual AppCacheResponseWriter* CreateResponseWriter( | 
| 62       const GURL& manifest_url, int64 group_id) OVERRIDE; | 62       const GURL& manifest_url, int64 group_id) OVERRIDE; | 
| 63   virtual void DoomResponses(const GURL& manifest_url, | 63   virtual void DoomResponses(const GURL& manifest_url, | 
| 64                              const std::vector<int64>& response_ids) OVERRIDE; | 64                              const std::vector<int64>& response_ids) OVERRIDE; | 
| 65   virtual void DeleteResponses(const GURL& manifest_url, | 65   virtual void DeleteResponses(const GURL& manifest_url, | 
| 66                                const std::vector<int64>& response_ids) OVERRIDE; | 66                                const std::vector<int64>& response_ids) OVERRIDE; | 
| 67   virtual void PurgeMemory() OVERRIDE; | 67   virtual void PurgeMemory() OVERRIDE; | 
| 68 | 68 | 
| 69  private: | 69  private: | 
| 70   friend class AppCacheStorageImplTest; |  | 
| 71 |  | 
| 72   // The AppCacheStorageImpl class methods and datamembers may only be | 70   // The AppCacheStorageImpl class methods and datamembers may only be | 
| 73   // accessed on the IO thread. This class manufactures seperate DatabaseTasks | 71   // accessed on the IO thread. This class manufactures seperate DatabaseTasks | 
| 74   // which access the DB on a seperate background thread. | 72   // which access the DB on a seperate background thread. | 
| 75   class DatabaseTask; | 73   class DatabaseTask; | 
| 76   class InitTask; | 74   class InitTask; | 
| 77   class CloseConnectionTask; | 75   class CloseConnectionTask; | 
| 78   class DisableDatabaseTask; | 76   class DisableDatabaseTask; | 
| 79   class GetAllInfoTask; | 77   class GetAllInfoTask; | 
| 80   class StoreOrLoadTask; | 78   class StoreOrLoadTask; | 
| 81   class CacheLoadTask; | 79   class CacheLoadTask; | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 107   void ScheduleSimpleTask(const base::Closure& task); | 105   void ScheduleSimpleTask(const base::Closure& task); | 
| 108   void RunOnePendingSimpleTask(); | 106   void RunOnePendingSimpleTask(); | 
| 109 | 107 | 
| 110   void DelayedStartDeletingUnusedResponses(); | 108   void DelayedStartDeletingUnusedResponses(); | 
| 111   void StartDeletingResponses(const std::vector<int64>& response_ids); | 109   void StartDeletingResponses(const std::vector<int64>& response_ids); | 
| 112   void ScheduleDeleteOneResponse(); | 110   void ScheduleDeleteOneResponse(); | 
| 113   void DeleteOneResponse(); | 111   void DeleteOneResponse(); | 
| 114 | 112 | 
| 115   void OnDeletedOneResponse(int rv); | 113   void OnDeletedOneResponse(int rv); | 
| 116   void OnDiskCacheInitialized(int rv); | 114   void OnDiskCacheInitialized(int rv); | 
| 117   void CallReinitialize(); | 115   void DeleteAndStartOver(); | 
|  | 116   void DeleteAndStartOverPart2(); | 
|  | 117   void CallScheduleReinitialize(); | 
| 118 | 118 | 
| 119   // Sometimes we can respond without having to query the database. | 119   // Sometimes we can respond without having to query the database. | 
| 120   bool FindResponseForMainRequestInGroup( | 120   bool FindResponseForMainRequestInGroup( | 
| 121       AppCacheGroup* group,  const GURL& url, Delegate* delegate); | 121       AppCacheGroup* group,  const GURL& url, Delegate* delegate); | 
| 122   void DeliverShortCircuitedFindMainResponse( | 122   void DeliverShortCircuitedFindMainResponse( | 
| 123       const GURL& url, | 123       const GURL& url, | 
| 124       const AppCacheEntry& found_entry, | 124       const AppCacheEntry& found_entry, | 
| 125       scoped_refptr<AppCacheGroup> group, | 125       scoped_refptr<AppCacheGroup> group, | 
| 126       scoped_refptr<AppCache> newest_cache, | 126       scoped_refptr<AppCache> newest_cache, | 
| 127       scoped_refptr<DelegateReference> delegate_ref); | 127       scoped_refptr<DelegateReference> delegate_ref); | 
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 165   // disk cache and cannot continue. | 165   // disk cache and cannot continue. | 
| 166   bool is_disabled_; | 166   bool is_disabled_; | 
| 167 | 167 | 
| 168   scoped_ptr<AppCacheDiskCache> disk_cache_; | 168   scoped_ptr<AppCacheDiskCache> disk_cache_; | 
| 169 | 169 | 
| 170   // Used to short-circuit certain operations without having to schedule | 170   // Used to short-circuit certain operations without having to schedule | 
| 171   // any tasks on the background database thread. | 171   // any tasks on the background database thread. | 
| 172   std::deque<base::Closure> pending_simple_tasks_; | 172   std::deque<base::Closure> pending_simple_tasks_; | 
| 173   base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; | 173   base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; | 
| 174 | 174 | 
|  | 175   friend class AppCacheStorageImplTest; | 
| 175   friend class content::ChromeAppCacheServiceTest; | 176   friend class content::ChromeAppCacheServiceTest; | 
| 176 }; | 177 }; | 
| 177 | 178 | 
| 178 }  // namespace appcache | 179 }  // namespace appcache | 
| 179 | 180 | 
| 180 #endif  // WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 181 #endif  // WEBKIT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ | 
| OLD | NEW | 
|---|