Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: content/browser/appcache/appcache_storage_impl.h

Issue 2940023002: TaskScheduler: migrate appcache database over to use it. (Closed)
Patch Set: comments + rebase Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 20 matching lines...) Expand all
31 class AppCacheStorageImplTest; 31 class AppCacheStorageImplTest;
32 class ChromeAppCacheServiceTest; 32 class ChromeAppCacheServiceTest;
33 33
34 class AppCacheStorageImpl : public AppCacheStorage { 34 class AppCacheStorageImpl : public AppCacheStorage {
35 public: 35 public:
36 explicit AppCacheStorageImpl(AppCacheServiceImpl* service); 36 explicit AppCacheStorageImpl(AppCacheServiceImpl* service);
37 ~AppCacheStorageImpl() override; 37 ~AppCacheStorageImpl() override;
38 38
39 void Initialize( 39 void Initialize(
40 const base::FilePath& cache_directory, 40 const base::FilePath& cache_directory,
41 const scoped_refptr<base::SingleThreadTaskRunner>& db_thread, 41 const scoped_refptr<base::SequencedTaskRunner>& db_task_runner,
42 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread); 42 const scoped_refptr<base::SingleThreadTaskRunner>& cache_thread);
43 void Disable(); 43 void Disable();
44 bool is_disabled() const { return is_disabled_; } 44 bool is_disabled() const { return is_disabled_; }
45 45
46 // AppCacheStorage methods, see the base class for doc comments. 46 // AppCacheStorage methods, see the base class for doc comments.
47 void GetAllInfo(Delegate* delegate) override; 47 void GetAllInfo(Delegate* delegate) override;
48 void LoadCache(int64_t id, Delegate* delegate) override; 48 void LoadCache(int64_t id, Delegate* delegate) override;
49 void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate) override; 49 void LoadOrCreateGroup(const GURL& manifest_url, Delegate* delegate) override;
50 void StoreGroupAndNewestCache(AppCacheGroup* group, 50 void StoreGroupAndNewestCache(AppCacheGroup* group,
51 AppCache* newest_cache, 51 AppCache* newest_cache,
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Don't call this when |is_disabled_| is true. 149 // Don't call this when |is_disabled_| is true.
150 CONTENT_EXPORT AppCacheDiskCache* disk_cache(); 150 CONTENT_EXPORT AppCacheDiskCache* disk_cache();
151 151
152 // The directory in which we place files in the file system. 152 // The directory in which we place files in the file system.
153 base::FilePath cache_directory_; 153 base::FilePath cache_directory_;
154 bool is_incognito_; 154 bool is_incognito_;
155 155
156 // This class operates primarily on the IO thread, but schedules 156 // This class operates primarily on the IO thread, but schedules
157 // its DatabaseTasks on the db thread. Separately, the disk_cache uses 157 // its DatabaseTasks on the db thread. Separately, the disk_cache uses
158 // the cache thread. 158 // the cache thread.
159 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; 159 scoped_refptr<base::SequencedTaskRunner> db_task_runner_;
160 scoped_refptr<base::SingleThreadTaskRunner> cache_thread_; 160 scoped_refptr<base::SingleThreadTaskRunner> cache_thread_;
161 161
162 // Structures to keep track of DatabaseTasks that are in-flight. 162 // Structures to keep track of DatabaseTasks that are in-flight.
163 DatabaseTaskQueue scheduled_database_tasks_; 163 DatabaseTaskQueue scheduled_database_tasks_;
164 PendingCacheLoads pending_cache_loads_; 164 PendingCacheLoads pending_cache_loads_;
165 PendingGroupLoads pending_group_loads_; 165 PendingGroupLoads pending_group_loads_;
166 PendingForeignMarkings pending_foreign_markings_; 166 PendingForeignMarkings pending_foreign_markings_;
167 PendingQuotaQueries pending_quota_queries_; 167 PendingQuotaQueries pending_quota_queries_;
168 168
169 // Structures to keep track of lazy response deletion. 169 // Structures to keep track of lazy response deletion.
(...skipping 18 matching lines...) Expand all
188 std::deque<base::Closure> pending_simple_tasks_; 188 std::deque<base::Closure> pending_simple_tasks_;
189 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_; 189 base::WeakPtrFactory<AppCacheStorageImpl> weak_factory_;
190 190
191 friend class content::AppCacheStorageImplTest; 191 friend class content::AppCacheStorageImplTest;
192 friend class content::ChromeAppCacheServiceTest; 192 friend class content::ChromeAppCacheServiceTest;
193 }; 193 };
194 194
195 } // namespace content 195 } // namespace content
196 196
197 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_ 197 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_STORAGE_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_service_unittest.cc ('k') | content/browser/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698