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

Side by Side Diff: webkit/appcache/appcache_storage_impl.h

Issue 6077005: Refactored app cache clear on exit code to happen in the object owning the files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed the nits. Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
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
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:
michaeln 2011/01/07 19:56:52 oh wait... why have these new protected data membe
pastarmovj 2011/01/10 11:02:01 Sorry forgot to move this back to private I was ex
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
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
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_
OLDNEW
« chrome/browser/appcache/chrome_appcache_service_unittest.cc ('K') | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698