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 WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 5 #ifndef WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 6 #define WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 | 160 |
161 // Starts backing sessionStorage on disk. This function must be called right | 161 // Starts backing sessionStorage on disk. This function must be called right |
162 // after DomStorageContext is created, before it's used. | 162 // after DomStorageContext is created, before it's used. |
163 void SetSaveSessionStorageOnDisk(); | 163 void SetSaveSessionStorageOnDisk(); |
164 | 164 |
165 // Deletes all namespaces which don't have an associated DomStorageNamespace | 165 // Deletes all namespaces which don't have an associated DomStorageNamespace |
166 // alive. This function is used for deleting possible leftover data after an | 166 // alive. This function is used for deleting possible leftover data after an |
167 // unclean exit. | 167 // unclean exit. |
168 void StartScavengingUnusedSessionStorage(); | 168 void StartScavengingUnusedSessionStorage(); |
169 | 169 |
| 170 int64 GetInMemoryStorageSize() const; |
| 171 |
170 private: | 172 private: |
171 friend class DomStorageContextTest; | 173 friend class DomStorageContextTest; |
172 FRIEND_TEST_ALL_PREFIXES(DomStorageContextTest, Basics); | 174 FRIEND_TEST_ALL_PREFIXES(DomStorageContextTest, Basics); |
173 friend class base::RefCountedThreadSafe<DomStorageContext>; | 175 friend class base::RefCountedThreadSafe<DomStorageContext>; |
174 typedef std::map<int64, scoped_refptr<DomStorageNamespace> > | 176 typedef std::map<int64, scoped_refptr<DomStorageNamespace> > |
175 StorageNamespaceMap; | 177 StorageNamespaceMap; |
176 | 178 |
177 ~DomStorageContext(); | 179 ~DomStorageContext(); |
178 | 180 |
179 void ClearSessionOnlyOrigins(); | 181 void ClearSessionOnlyOrigins(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 std::set<std::string> protected_persistent_session_ids_; | 223 std::set<std::string> protected_persistent_session_ids_; |
222 | 224 |
223 // Mapping between persistent namespace IDs and namespace IDs for | 225 // Mapping between persistent namespace IDs and namespace IDs for |
224 // sessionStorage. | 226 // sessionStorage. |
225 std::map<std::string, int64> persistent_namespace_id_to_namespace_id_; | 227 std::map<std::string, int64> persistent_namespace_id_to_namespace_id_; |
226 }; | 228 }; |
227 | 229 |
228 } // namespace dom_storage | 230 } // namespace dom_storage |
229 | 231 |
230 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ | 232 #endif // WEBKIT_DOM_STORAGE_DOM_STORAGE_CONTEXT_H_ |
OLD | NEW |