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

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

Issue 7210006: AppCaches which belong to hosted apps are not protected from deletion (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: More cleanup. Created 9 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 | Annotate | Revision Log
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 WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ 5 #ifndef WEBKIT_APPCACHE_APPCACHE_SERVICE_H_
6 #define WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ 6 #define WEBKIT_APPCACHE_APPCACHE_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // See chrome/browser/AppCacheDispatcherHost. 125 // See chrome/browser/AppCacheDispatcherHost.
126 void RegisterBackend(AppCacheBackendImpl* backend_impl); 126 void RegisterBackend(AppCacheBackendImpl* backend_impl);
127 void UnregisterBackend(AppCacheBackendImpl* backend_impl); 127 void UnregisterBackend(AppCacheBackendImpl* backend_impl);
128 AppCacheBackendImpl* GetBackend(int id) const { 128 AppCacheBackendImpl* GetBackend(int id) const {
129 BackendMap::const_iterator it = backends_.find(id); 129 BackendMap::const_iterator it = backends_.find(id);
130 return (it != backends_.end()) ? it->second : NULL; 130 return (it != backends_.end()) ? it->second : NULL;
131 } 131 }
132 132
133 AppCacheStorage* storage() const { return storage_.get(); } 133 AppCacheStorage* storage() const { return storage_.get(); }
134 134
135 bool clear_local_state_on_exit() const { return clear_local_state_on_exit_; }
136 void set_clear_local_state_on_exit(bool clear_local_state_on_exit) {
137 clear_local_state_on_exit_ = clear_local_state_on_exit; }
138
135 protected: 139 protected:
136 friend class AppCacheStorageImplTest; 140 friend class AppCacheStorageImplTest;
137 friend class AppCacheServiceTest; 141 friend class AppCacheServiceTest;
138 142
139 class AsyncHelper; 143 class AsyncHelper;
140 class CanHandleOfflineHelper; 144 class CanHandleOfflineHelper;
141 class DeleteHelper; 145 class DeleteHelper;
142 class DeleteOriginHelper; 146 class DeleteOriginHelper;
143 class GetInfoHelper; 147 class GetInfoHelper;
144 148
145 typedef std::set<AsyncHelper*> PendingAsyncHelpers; 149 typedef std::set<AsyncHelper*> PendingAsyncHelpers;
146 typedef std::map<int, AppCacheBackendImpl*> BackendMap; 150 typedef std::map<int, AppCacheBackendImpl*> BackendMap;
147 151
148 AppCachePolicy* appcache_policy_; 152 AppCachePolicy* appcache_policy_;
149 AppCacheQuotaClient* quota_client_; 153 AppCacheQuotaClient* quota_client_;
150 scoped_ptr<AppCacheStorage> storage_; 154 scoped_ptr<AppCacheStorage> storage_;
151 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; 155 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_;
152 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; 156 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
153 PendingAsyncHelpers pending_helpers_; 157 PendingAsyncHelpers pending_helpers_;
154 BackendMap backends_; // One 'backend' per child process. 158 BackendMap backends_; // One 'backend' per child process.
155 // Context for use during cache updates. 159 // Context for use during cache updates.
156 net::URLRequestContext* request_context_; 160 net::URLRequestContext* request_context_;
161 bool clear_local_state_on_exit_;
157 162
158 DISALLOW_COPY_AND_ASSIGN(AppCacheService); 163 DISALLOW_COPY_AND_ASSIGN(AppCacheService);
159 }; 164 };
160 165
161 } // namespace appcache 166 } // namespace appcache
162 167
163 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ 168 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698