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_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 typedef base::Callback< | 24 typedef base::Callback< |
25 void(const std::vector<dom_storage::DomStorageContext::UsageInfo>&)> | 25 void(const std::vector<dom_storage::DomStorageContext::UsageInfo>&)> |
26 GetUsageInfoCallback; | 26 GetUsageInfoCallback; |
27 | 27 |
28 // Returns a collection of origins using local storage to the given callback. | 28 // Returns a collection of origins using local storage to the given callback. |
29 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) = 0; | 29 virtual void GetUsageInfo(const GetUsageInfoCallback& callback) = 0; |
30 | 30 |
31 // Deletes the local storage data for the given origin. | 31 // Deletes the local storage data for the given origin. |
32 virtual void DeleteOrigin(const GURL& origin) = 0; | 32 virtual void DeleteOrigin(const GURL& origin) = 0; |
33 | 33 |
| 34 // If this is called, sessionStorage data will be stored on disk, and can be |
| 35 // restored after a browser restart (with RecreateSessionStorage). This |
| 36 // function must be called right after DOMStorageContextImpl is created, and |
| 37 // before it's used. |
| 38 virtual void SetSaveSessionStorageOnDisk() = 0; |
| 39 |
34 // Creates a SessionStorageNamespace with the given |persistent_id|. Used | 40 // Creates a SessionStorageNamespace with the given |persistent_id|. Used |
35 // after tabs are restored by session restore. When created, the | 41 // after tabs are restored by session restore. When created, the |
36 // SessionStorageNamespace with the correct |persistent_id| will be | 42 // SessionStorageNamespace with the correct |persistent_id| will be |
37 // associated with the persisted sessionStorage data. | 43 // associated with the persisted sessionStorage data. |
38 virtual scoped_refptr<SessionStorageNamespace> RecreateSessionStorage( | 44 virtual scoped_refptr<SessionStorageNamespace> RecreateSessionStorage( |
39 const std::string& persistent_id) = 0; | 45 const std::string& persistent_id) = 0; |
40 | 46 |
| 47 // Starts deleting sessionStorages which don't have an associated |
| 48 // SessionStorageNamespace alive. Called when SessionStorageNamespaces have |
| 49 // been created after a session restore, or a session restore won't happen. |
| 50 virtual void StartScavengingUnusedSessionStorage() = 0; |
| 51 |
41 protected: | 52 protected: |
42 virtual ~DOMStorageContext() {} | 53 virtual ~DOMStorageContext() {} |
43 }; | 54 }; |
44 | 55 |
45 } // namespace content | 56 } // namespace content |
46 | 57 |
47 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 58 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
OLD | NEW |