OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ |
6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 const base::FilePath& sessionstorage_directory() { | 126 const base::FilePath& sessionstorage_directory() { |
127 return sessionstorage_directory_; | 127 return sessionstorage_directory_; |
128 } | 128 } |
129 | 129 |
130 DOMStorageTaskRunner* task_runner() const { return task_runner_.get(); } | 130 DOMStorageTaskRunner* task_runner() const { return task_runner_.get(); } |
131 DOMStorageNamespace* GetStorageNamespace(int64_t namespace_id); | 131 DOMStorageNamespace* GetStorageNamespace(int64_t namespace_id); |
132 | 132 |
133 void GetLocalStorageUsage(std::vector<LocalStorageUsageInfo>* infos, | 133 void GetLocalStorageUsage(std::vector<LocalStorageUsageInfo>* infos, |
134 bool include_file_info); | 134 bool include_file_info); |
135 void GetSessionStorageUsage(std::vector<SessionStorageUsageInfo>* infos); | 135 void GetSessionStorageUsage(std::vector<SessionStorageUsageInfo>* infos); |
136 void DeleteLocalStorage(const GURL& origin); | 136 void DeleteLocalStorageForPhysicalOrigin(const GURL& origin_url); |
| 137 void DeleteLocalStorage(const GURL& origin_url); |
137 void DeleteSessionStorage(const SessionStorageUsageInfo& usage_info); | 138 void DeleteSessionStorage(const SessionStorageUsageInfo& usage_info); |
138 | 139 |
139 // Used by content settings to alter the behavior around | 140 // Used by content settings to alter the behavior around |
140 // what data to keep and what data to discard at shutdown. | 141 // what data to keep and what data to discard at shutdown. |
141 // The policy is not so straight forward to describe, see | 142 // The policy is not so straight forward to describe, see |
142 // the implementation for details. | 143 // the implementation for details. |
143 void SetForceKeepSessionState() { | 144 void SetForceKeepSessionState() { |
144 force_keep_session_state_ = true; | 145 force_keep_session_state_ = true; |
145 } | 146 } |
146 | 147 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void ClearSessionOnlyOrigins(); | 217 void ClearSessionOnlyOrigins(); |
217 | 218 |
218 // For scavenging unused sessionStorages. | 219 // For scavenging unused sessionStorages. |
219 void FindUnusedNamespaces(); | 220 void FindUnusedNamespaces(); |
220 void FindUnusedNamespacesInCommitSequence( | 221 void FindUnusedNamespacesInCommitSequence( |
221 const std::set<std::string>& namespace_ids_in_use, | 222 const std::set<std::string>& namespace_ids_in_use, |
222 const std::set<std::string>& protected_persistent_session_ids); | 223 const std::set<std::string>& protected_persistent_session_ids); |
223 void DeleteNextUnusedNamespace(); | 224 void DeleteNextUnusedNamespace(); |
224 void DeleteNextUnusedNamespaceInCommitSequence(); | 225 void DeleteNextUnusedNamespaceInCommitSequence(); |
225 | 226 |
226 void DeleteAndClearStorageNamespaceForOrigin(const GURL& origin, | |
227 DOMStorageNamespace* local); | |
228 | |
229 // Collection of namespaces keyed by id. | 227 // Collection of namespaces keyed by id. |
230 StorageNamespaceMap namespaces_; | 228 StorageNamespaceMap namespaces_; |
231 | 229 |
232 // Where localstorage data is stored, maybe empty for the incognito use case. | 230 // Where localstorage data is stored, maybe empty for the incognito use case. |
233 base::FilePath localstorage_directory_; | 231 base::FilePath localstorage_directory_; |
234 | 232 |
235 // Where sessionstorage data is stored, maybe empty for the incognito use | 233 // Where sessionstorage data is stored, maybe empty for the incognito use |
236 // case. Always empty until the file-backed session storage feature is | 234 // case. Always empty until the file-backed session storage feature is |
237 // implemented. | 235 // implemented. |
238 base::FilePath sessionstorage_directory_; | 236 base::FilePath sessionstorage_directory_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // sessionStorage. | 269 // sessionStorage. |
272 std::map<std::string, int64_t> persistent_namespace_id_to_namespace_id_; | 270 std::map<std::string, int64_t> persistent_namespace_id_to_namespace_id_; |
273 | 271 |
274 // For cleaning up unused databases more aggressively. | 272 // For cleaning up unused databases more aggressively. |
275 bool is_low_end_device_; | 273 bool is_low_end_device_; |
276 }; | 274 }; |
277 | 275 |
278 } // namespace content | 276 } // namespace content |
279 | 277 |
280 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 278 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ |
OLD | NEW |