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 DeleteLocalStorage(const GURL& origin_url); |
137 void DeleteSessionStorage(const SessionStorageUsageInfo& usage_info); | 137 void DeleteSessionStorage(const SessionStorageUsageInfo& usage_info); |
138 | 138 |
139 // Used by content settings to alter the behavior around | 139 // Used by content settings to alter the behavior around |
140 // what data to keep and what data to discard at shutdown. | 140 // what data to keep and what data to discard at shutdown. |
141 // The policy is not so straight forward to describe, see | 141 // The policy is not so straight forward to describe, see |
142 // the implementation for details. | 142 // the implementation for details. |
143 void SetForceKeepSessionState() { | 143 void SetForceKeepSessionState() { |
144 force_keep_session_state_ = true; | 144 force_keep_session_state_ = true; |
145 } | 145 } |
146 | 146 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 void ClearSessionOnlyOrigins(); | 216 void ClearSessionOnlyOrigins(); |
217 | 217 |
218 // For scavenging unused sessionStorages. | 218 // For scavenging unused sessionStorages. |
219 void FindUnusedNamespaces(); | 219 void FindUnusedNamespaces(); |
220 void FindUnusedNamespacesInCommitSequence( | 220 void FindUnusedNamespacesInCommitSequence( |
221 const std::set<std::string>& namespace_ids_in_use, | 221 const std::set<std::string>& namespace_ids_in_use, |
222 const std::set<std::string>& protected_persistent_session_ids); | 222 const std::set<std::string>& protected_persistent_session_ids); |
223 void DeleteNextUnusedNamespace(); | 223 void DeleteNextUnusedNamespace(); |
224 void DeleteNextUnusedNamespaceInCommitSequence(); | 224 void DeleteNextUnusedNamespaceInCommitSequence(); |
225 | 225 |
226 void DeleteAndClearStorageNamespaceForOrigin(const GURL& origin, | 226 void DeleteAndClearStorageNamespaceForOrigin(const GURL& origin_url, |
227 DOMStorageNamespace* local); | 227 DOMStorageNamespace* local); |
228 | 228 |
229 // Collection of namespaces keyed by id. | 229 // Collection of namespaces keyed by id. |
230 StorageNamespaceMap namespaces_; | 230 StorageNamespaceMap namespaces_; |
231 | 231 |
232 // Where localstorage data is stored, maybe empty for the incognito use case. | 232 // Where localstorage data is stored, maybe empty for the incognito use case. |
233 base::FilePath localstorage_directory_; | 233 base::FilePath localstorage_directory_; |
234 | 234 |
235 // Where sessionstorage data is stored, maybe empty for the incognito use | 235 // Where sessionstorage data is stored, maybe empty for the incognito use |
236 // case. Always empty until the file-backed session storage feature is | 236 // case. Always empty until the file-backed session storage feature is |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 // sessionStorage. | 271 // sessionStorage. |
272 std::map<std::string, int64_t> persistent_namespace_id_to_namespace_id_; | 272 std::map<std::string, int64_t> persistent_namespace_id_to_namespace_id_; |
273 | 273 |
274 // For cleaning up unused databases more aggressively. | 274 // For cleaning up unused databases more aggressively. |
275 bool is_low_end_device_; | 275 bool is_low_end_device_; |
276 }; | 276 }; |
277 | 277 |
278 } // namespace content | 278 } // namespace content |
279 | 279 |
280 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ | 280 #endif // CONTENT_BROWSER_DOM_STORAGE_DOM_STORAGE_CONTEXT_IMPL_H_ |
OLD | NEW |