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_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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 BackendMap::const_iterator it = backends_.find(id); | 137 BackendMap::const_iterator it = backends_.find(id); |
138 return (it != backends_.end()) ? it->second : NULL; | 138 return (it != backends_.end()) ? it->second : NULL; |
139 } | 139 } |
140 | 140 |
141 AppCacheStorage* storage() const { return storage_.get(); } | 141 AppCacheStorage* storage() const { return storage_.get(); } |
142 | 142 |
143 bool clear_local_state_on_exit() const { return clear_local_state_on_exit_; } | 143 bool clear_local_state_on_exit() const { return clear_local_state_on_exit_; } |
144 void set_clear_local_state_on_exit(bool clear_local_state_on_exit) { | 144 void set_clear_local_state_on_exit(bool clear_local_state_on_exit) { |
145 clear_local_state_on_exit_ = clear_local_state_on_exit; } | 145 clear_local_state_on_exit_ = clear_local_state_on_exit; } |
146 | 146 |
147 bool save_session_state() const { return save_session_state_; } | |
148 // If |save_session_state| is true, disables the exit-time deletion for all | |
149 // data (also session-only data). | |
150 void set_save_session_state(bool save_session_state) { | |
michaeln
2011/12/07 20:49:15
indent is off
marja
2011/12/08 08:30:12
Done.
| |
151 save_session_state_ = save_session_state; | |
152 } | |
153 | |
147 protected: | 154 protected: |
148 friend class AppCacheStorageImplTest; | 155 friend class AppCacheStorageImplTest; |
149 friend class AppCacheServiceTest; | 156 friend class AppCacheServiceTest; |
150 | 157 |
151 class AsyncHelper; | 158 class AsyncHelper; |
152 class NewAsyncHelper; | 159 class NewAsyncHelper; |
153 class CanHandleOfflineHelper; | 160 class CanHandleOfflineHelper; |
154 class DeleteHelper; | 161 class DeleteHelper; |
155 class DeleteOriginHelper; | 162 class DeleteOriginHelper; |
156 class GetInfoHelper; | 163 class GetInfoHelper; |
157 class CheckResponseHelper; | 164 class CheckResponseHelper; |
158 | 165 |
159 typedef std::set<AsyncHelper*> PendingAsyncHelpers; | 166 typedef std::set<AsyncHelper*> PendingAsyncHelpers; |
160 typedef std::set<NewAsyncHelper*> PendingNewAsyncHelpers; | 167 typedef std::set<NewAsyncHelper*> PendingNewAsyncHelpers; |
161 typedef std::map<int, AppCacheBackendImpl*> BackendMap; | 168 typedef std::map<int, AppCacheBackendImpl*> BackendMap; |
162 | 169 |
163 AppCachePolicy* appcache_policy_; | 170 AppCachePolicy* appcache_policy_; |
164 AppCacheQuotaClient* quota_client_; | 171 AppCacheQuotaClient* quota_client_; |
165 scoped_ptr<AppCacheStorage> storage_; | 172 scoped_ptr<AppCacheStorage> storage_; |
166 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; | 173 scoped_refptr<quota::SpecialStoragePolicy> special_storage_policy_; |
167 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; | 174 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; |
168 PendingAsyncHelpers pending_helpers_; | 175 PendingAsyncHelpers pending_helpers_; |
169 PendingNewAsyncHelpers pending_new_helpers_; | 176 PendingNewAsyncHelpers pending_new_helpers_; |
170 BackendMap backends_; // One 'backend' per child process. | 177 BackendMap backends_; // One 'backend' per child process. |
171 // Context for use during cache updates. | 178 // Context for use during cache updates. |
172 net::URLRequestContext* request_context_; | 179 net::URLRequestContext* request_context_; |
173 bool clear_local_state_on_exit_; | 180 bool clear_local_state_on_exit_; |
181 // If true, nothing (not even session-only data) should be deleted on exit. | |
182 bool save_session_state_; | |
174 | 183 |
175 DISALLOW_COPY_AND_ASSIGN(AppCacheService); | 184 DISALLOW_COPY_AND_ASSIGN(AppCacheService); |
176 }; | 185 }; |
177 | 186 |
178 } // namespace appcache | 187 } // namespace appcache |
179 | 188 |
180 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ | 189 #endif // WEBKIT_APPCACHE_APPCACHE_SERVICE_H_ |
OLD | NEW |