Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 // Returns a collection of origins using local storage to the given callback. | 33 // Returns a collection of origins using local storage to the given callback. |
| 34 virtual void GetLocalStorageUsage( | 34 virtual void GetLocalStorageUsage( |
| 35 const GetLocalStorageUsageCallback& callback) = 0; | 35 const GetLocalStorageUsageCallback& callback) = 0; |
| 36 | 36 |
| 37 // Returns a collection of origins using session storage to the given | 37 // Returns a collection of origins using session storage to the given |
| 38 // callback. | 38 // callback. |
| 39 virtual void GetSessionStorageUsage( | 39 virtual void GetSessionStorageUsage( |
| 40 const GetSessionStorageUsageCallback& callback) = 0; | 40 const GetSessionStorageUsageCallback& callback) = 0; |
| 41 | 41 |
| 42 // Deletes the local storage data for the given origin. | 42 // Deletes the local storage data for physical origin of |origin_url|. This |
| 43 virtual void DeleteLocalStorage(const GURL& origin) = 0; | 43 // includes all suborigins at the physical origin, and if |origin_url| |
| 44 // contains a suborigin, deletes the empty suborigin as well. | |
|
michaeln
2016/10/24 21:10:03
i'm not sure the examples help or hurt clarity? co
jww
2016/10/24 21:22:54
Done.
| |
| 45 // | |
| 46 // That is, for example, deletion of http://example.com will also delete local | |
| 47 // storage at http-so://foo.example.com, and similarly, deletion of | |
| 48 // http-so://foo.example.com will delete storage at http://example.com as | |
| 49 // well. | |
| 50 // | |
| 51 // See https://w3c.github.io/webappsec-suborigins/. | |
| 52 virtual void DeleteLocalStorageForPhysicalOrigin(const GURL& origin_url) = 0; | |
| 53 | |
| 54 // Same as above, but extracts the physical origin from |origin| to do the | |
| 55 // deletion, so it is unnecessary to guarantee that |origin| doesn't have a | |
| 56 // suborigin. | |
|
michaeln
2016/10/24 21:10:03
the top part of the comment is stale
jww
2016/10/24 21:22:54
Given the simplification suggestion, I basically r
| |
| 57 // Deletes the local storage for the origin of |origin_url|. Unlike | |
| 58 // DeleteLocalStorageForPhysicalOrigin above, it does not delete the local | |
| 59 // storage at other suborigins at the same physical origin. | |
| 60 // | |
| 61 // That is, for example, deletion of http://example.com will *not* also delete | |
| 62 // local storage at http-so://foo.example.com, and similarly, deletion of | |
| 63 // http-so://foo.example.com will *not* delete storage at http://example.com. | |
| 64 // | |
| 65 // See https://w3c.github.io/webappsec-suborigins/. | |
| 66 virtual void DeleteLocalStorage(const GURL& origin_url) = 0; | |
| 44 | 67 |
| 45 // Deletes the session storage data identified by |usage_info|. | 68 // Deletes the session storage data identified by |usage_info|. |
| 46 virtual void DeleteSessionStorage( | 69 virtual void DeleteSessionStorage( |
| 47 const SessionStorageUsageInfo& usage_info) = 0; | 70 const SessionStorageUsageInfo& usage_info) = 0; |
| 48 | 71 |
| 49 // If this is called, sessionStorage data will be stored on disk, and can be | 72 // If this is called, sessionStorage data will be stored on disk, and can be |
| 50 // restored after a browser restart (with RecreateSessionStorage). This | 73 // restored after a browser restart (with RecreateSessionStorage). This |
| 51 // function must be called right after DOMStorageContextWrapper is created, | 74 // function must be called right after DOMStorageContextWrapper is created, |
| 52 // and before it's used. | 75 // and before it's used. |
| 53 virtual void SetSaveSessionStorageOnDisk() = 0; | 76 virtual void SetSaveSessionStorageOnDisk() = 0; |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 64 // been created after a session restore, or a session restore won't happen. | 87 // been created after a session restore, or a session restore won't happen. |
| 65 virtual void StartScavengingUnusedSessionStorage() = 0; | 88 virtual void StartScavengingUnusedSessionStorage() = 0; |
| 66 | 89 |
| 67 protected: | 90 protected: |
| 68 virtual ~DOMStorageContext() {} | 91 virtual ~DOMStorageContext() {} |
| 69 }; | 92 }; |
| 70 | 93 |
| 71 } // namespace content | 94 } // namespace content |
| 72 | 95 |
| 73 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ | 96 #endif // CONTENT_PUBLIC_BROWSER_DOM_STORAGE_CONTEXT_H_ |
| OLD | NEW |