Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: content/public/browser/dom_storage_context.h

Issue 2403713002: Add suborigin logic to url::Origin (Closed)
Patch Set: Adjust DeleteLocalStorage* API Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/dom_storage_context.h
diff --git a/content/public/browser/dom_storage_context.h b/content/public/browser/dom_storage_context.h
index a4aba1e91e1b4f384a0e0eaa9891b8d6e062965c..f86be9f412bcaf4ae3c70011959dabd09a81d69f 100644
--- a/content/public/browser/dom_storage_context.h
+++ b/content/public/browser/dom_storage_context.h
@@ -39,8 +39,31 @@ class DOMStorageContext {
virtual void GetSessionStorageUsage(
const GetSessionStorageUsageCallback& callback) = 0;
- // Deletes the local storage data for the given origin.
- virtual void DeleteLocalStorage(const GURL& origin) = 0;
+ // Deletes the local storage data for physical origin of |origin_url|. This
+ // includes all suborigins at the physical origin, and if |origin_url|
+ // 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.
+ //
+ // That is, for example, deletion of http://example.com will also delete local
+ // storage at http-so://foo.example.com, and similarly, deletion of
+ // http-so://foo.example.com will delete storage at http://example.com as
+ // well.
+ //
+ // See https://w3c.github.io/webappsec-suborigins/.
+ virtual void DeleteLocalStorageForPhysicalOrigin(const GURL& origin_url) = 0;
+
+ // Same as above, but extracts the physical origin from |origin| to do the
+ // deletion, so it is unnecessary to guarantee that |origin| doesn't have a
+ // 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
+ // Deletes the local storage for the origin of |origin_url|. Unlike
+ // DeleteLocalStorageForPhysicalOrigin above, it does not delete the local
+ // storage at other suborigins at the same physical origin.
+ //
+ // That is, for example, deletion of http://example.com will *not* also delete
+ // local storage at http-so://foo.example.com, and similarly, deletion of
+ // http-so://foo.example.com will *not* delete storage at http://example.com.
+ //
+ // See https://w3c.github.io/webappsec-suborigins/.
+ virtual void DeleteLocalStorage(const GURL& origin_url) = 0;
// Deletes the session storage data identified by |usage_info|.
virtual void DeleteSessionStorage(

Powered by Google App Engine
This is Rietveld 408576698