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

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: 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 9c95c1c266b01d295ea290b09cbd8fff83e6b997..1eba4957885ec57f061120018b22557fbd1d94c2 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -5,10 +5,14 @@
#include "chrome/browser/extensions/extension_special_storage_policy.h"
#include "base/logging.h"
+#include "chrome/common/content_settings.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
+#include "chrome/browser/content_settings/host_content_settings_map.h"
jochen (gone - plz use gerrit) 2011/08/17 11:29:06 alphabetical ordering
marja 2011/08/17 11:51:16 Done.
-ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy() {}
+ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy(
+ HostContentSettingsMap* host_content_settings_map)
+ : host_content_settings_map_(host_content_settings_map) {}
ExtensionSpecialStoragePolicy::~ExtensionSpecialStoragePolicy() {}
@@ -24,6 +28,12 @@ bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
return unlimited_extensions_.Contains(origin);
}
+bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
+ ContentSetting content_setting = host_content_settings_map_->
jochen (gone - plz use gerrit) 2011/08/17 11:29:06 since host_content_settings_map_ can be NULL, you
marja 2011/08/17 11:51:16 Done.
+ 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