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

Unified Diff: components/content_settings/core/common/content_settings_pattern.h

Issue 1895993003: Add migration code to change existing domain scoped content settings to be origin scoped (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 5 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: components/content_settings/core/common/content_settings_pattern.h
diff --git a/components/content_settings/core/common/content_settings_pattern.h b/components/content_settings/core/common/content_settings_pattern.h
index f85c648bfc036aa9ac0261d0aa3cb62ed0d5318f..b5b83529b00f92b431157744a22fa4e9abebb3bb 100644
--- a/components/content_settings/core/common/content_settings_pattern.h
+++ b/components/content_settings/core/common/content_settings_pattern.h
@@ -129,6 +129,7 @@ class ContentSettingsPattern {
// Returns a pattern that matches the scheme and host of this URL, as well as
// all subdomains and ports.
+ // TODO(lshang): Remove this when crbug.com/604612 is done.
static ContentSettingsPattern FromURL(const GURL& url);
// Returns a pattern that matches exactly this URL.
@@ -145,6 +146,13 @@ class ContentSettingsPattern {
// - [a:b:c:d:e:f:g:h] (matches an exact IPv6 ip)
static ContentSettingsPattern FromString(const std::string& pattern_spec);
+ // Migrate domain scoped settings generated using FromURL() to be origin
+ // scoped. Return false if domain_pattern is not generated using FromURL().
+ // TODO(lshang): Remove this when migration is done. https://crbug.com/604612
+ static bool MigrateFromDomainToOrigin(
+ const ContentSettingsPattern& domain_pattern,
+ ContentSettingsPattern* origin_pattern);
+
// Sets the scheme that doesn't support domain wildcard and port.
// Needs to be called by the embedder before using ContentSettingsPattern.
// |scheme| can't be NULL, and the pointed string must remain alive until the

Powered by Google App Engine
This is Rietveld 408576698