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

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

Issue 7619010: Session-only local storage cleared on exit. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Code review comments (tiny). Created 9 years, 4 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 08ff3f2ee9267bc90ac0ac7b7800f40bc4700622..95a2486599bab8b3a7e9c703fc0a8116cbbbc9f7 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -5,11 +5,15 @@
#include "chrome/browser/extensions/extension_special_storage_policy.h"
#include "base/logging.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_thread.h"
-ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy() {}
+ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy(
+ HostContentSettingsMap* host_content_settings_map)
+ : host_content_settings_map_(host_content_settings_map) {}
ExtensionSpecialStoragePolicy::~ExtensionSpecialStoragePolicy() {}
@@ -25,6 +29,14 @@ bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
return unlimited_extensions_.Contains(origin);
}
+bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
+ if (host_content_settings_map_ == NULL)
+ return false;
+ ContentSetting content_setting = host_content_settings_map_->
+ GetCookieContentSetting(origin, origin, true);
+ return (content_setting == CONTENT_SETTING_SESSION_ONLY);
+}
+
bool ExtensionSpecialStoragePolicy::IsFileHandler(
const std::string& extension_id) {
base::AutoLock locker(lock_);

Powered by Google App Engine
This is Rietveld 408576698