OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICE_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ |
6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ | 6 #define CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 | 165 |
166 // Each child process in chrome uses a distinct backend instance. | 166 // Each child process in chrome uses a distinct backend instance. |
167 // See chrome/browser/AppCacheDispatcherHost. | 167 // See chrome/browser/AppCacheDispatcherHost. |
168 void RegisterBackend(AppCacheBackendImpl* backend_impl); | 168 void RegisterBackend(AppCacheBackendImpl* backend_impl); |
169 void UnregisterBackend(AppCacheBackendImpl* backend_impl); | 169 void UnregisterBackend(AppCacheBackendImpl* backend_impl); |
170 AppCacheBackendImpl* GetBackend(int id) const { | 170 AppCacheBackendImpl* GetBackend(int id) const { |
171 BackendMap::const_iterator it = backends_.find(id); | 171 BackendMap::const_iterator it = backends_.find(id); |
172 return (it != backends_.end()) ? it->second : NULL; | 172 return (it != backends_.end()) ? it->second : NULL; |
173 } | 173 } |
174 | 174 |
| 175 void RegisterBackendForFrame(AppCacheBackendImpl* backend_impl); |
| 176 void UnregisterBackendForFrame(AppCacheBackendImpl* backend_impl); |
| 177 AppCacheBackendImpl* GetBackendForFrame(int id) const { |
| 178 BackendMap::const_iterator it = backends_for_frame_.find(id); |
| 179 return (it != backends_for_frame_.end()) ? it->second : NULL; |
| 180 } |
| 181 |
175 AppCacheStorage* storage() const { return storage_.get(); } | 182 AppCacheStorage* storage() const { return storage_.get(); } |
176 | 183 |
177 base::WeakPtr<AppCacheServiceImpl> AsWeakPtr() { | 184 base::WeakPtr<AppCacheServiceImpl> AsWeakPtr() { |
178 return weak_factory_.GetWeakPtr(); | 185 return weak_factory_.GetWeakPtr(); |
179 } | 186 } |
180 | 187 |
181 // Disables the exit-time deletion of session-only data. | 188 // Disables the exit-time deletion of session-only data. |
182 void set_force_keep_session_state() { force_keep_session_state_ = true; } | 189 void set_force_keep_session_state() { force_keep_session_state_ = true; } |
183 bool force_keep_session_state() const { return force_keep_session_state_; } | 190 bool force_keep_session_state() const { return force_keep_session_state_; } |
184 | 191 |
(...skipping 19 matching lines...) Expand all Loading... |
204 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; | 211 scoped_refptr<base::SingleThreadTaskRunner> db_thread_; |
205 scoped_refptr<base::SingleThreadTaskRunner> cache_thread_; | 212 scoped_refptr<base::SingleThreadTaskRunner> cache_thread_; |
206 AppCachePolicy* appcache_policy_; | 213 AppCachePolicy* appcache_policy_; |
207 AppCacheQuotaClient* quota_client_; | 214 AppCacheQuotaClient* quota_client_; |
208 AppCacheExecutableHandlerFactory* handler_factory_; | 215 AppCacheExecutableHandlerFactory* handler_factory_; |
209 std::unique_ptr<AppCacheStorage> storage_; | 216 std::unique_ptr<AppCacheStorage> storage_; |
210 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; | 217 scoped_refptr<storage::SpecialStoragePolicy> special_storage_policy_; |
211 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; | 218 scoped_refptr<storage::QuotaManagerProxy> quota_manager_proxy_; |
212 PendingAsyncHelpers pending_helpers_; | 219 PendingAsyncHelpers pending_helpers_; |
213 BackendMap backends_; // One 'backend' per child process. | 220 BackendMap backends_; // One 'backend' per child process. |
| 221 BackendMap backends_for_frame_; // One 'backend' per frame. |
| 222 |
214 // Context for use during cache updates. | 223 // Context for use during cache updates. |
215 net::URLRequestContext* request_context_; | 224 net::URLRequestContext* request_context_; |
216 // If true, nothing (not even session-only data) should be deleted on exit. | 225 // If true, nothing (not even session-only data) should be deleted on exit. |
217 bool force_keep_session_state_; | 226 bool force_keep_session_state_; |
218 base::Time last_reinit_time_; | 227 base::Time last_reinit_time_; |
219 base::TimeDelta next_reinit_delay_; | 228 base::TimeDelta next_reinit_delay_; |
220 base::OneShotTimer reinit_timer_; | 229 base::OneShotTimer reinit_timer_; |
221 base::ObserverList<Observer> observers_; | 230 base::ObserverList<Observer> observers_; |
222 | 231 |
223 private: | 232 private: |
224 base::WeakPtrFactory<AppCacheServiceImpl> weak_factory_; | 233 base::WeakPtrFactory<AppCacheServiceImpl> weak_factory_; |
225 | 234 |
226 DISALLOW_COPY_AND_ASSIGN(AppCacheServiceImpl); | 235 DISALLOW_COPY_AND_ASSIGN(AppCacheServiceImpl); |
227 }; | 236 }; |
228 | 237 |
229 } // namespace content | 238 } // namespace content |
230 | 239 |
231 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ | 240 #endif // CONTENT_BROWSER_APPCACHE_APPCACHE_SERVICE_IMPL_H_ |
OLD | NEW |