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

Unified Diff: chrome/browser/extensions/extension_special_storage_policy.cc

Issue 1164073005: Allow script to request durable storage permission (chrome side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased onto content setting patch Created 5 years, 6 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: chrome/browser/extensions/extension_special_storage_policy.cc
diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc
index 076273c99b74b1e9d80abe06b553f43dbc2a605c..40860a2dc28cb88f17425ecc71fd174887bcb1d7 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -136,6 +136,18 @@ bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
return isolated_extensions_.Contains(origin);
}
+bool ExtensionSpecialStoragePolicy::IsStorageDurable(const GURL& origin) {
+ ContentSettingsForOneType entries;
+ cookie_settings_->GetDurableSettings(&entries);
+ for (size_t i = 0; i < entries.size(); ++i) {
+ if (!entries[i].primary_pattern.Matches(origin))
+ continue;
+ // TODO(dgrogan): How should this use secondary_pattern?
+ return entries[i].setting == CONTENT_SETTING_ALLOW;
+ }
+ return false;
+}
+
bool ExtensionSpecialStoragePolicy::NeedsProtection(
const extensions::Extension* extension) {
return extension->is_hosted_app() && !extension->from_bookmark();

Powered by Google App Engine
This is Rietveld 408576698