summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extensions_service.h
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 02:09:42 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-01 02:09:42 +0000
commit654512b4c7e02401af2ce207d678c683841eedb6 (patch)
treed856c557204c2ebbc94a5f4c7d8106b1ab5ffc41 /chrome/browser/extensions/extensions_service.h
parent07598d6736b8d612b1f68eaf2066ab15776293da (diff)
downloadchromium_src-654512b4c7e02401af2ce207d678c683841eedb6.zip
chromium_src-654512b4c7e02401af2ce207d678c683841eedb6.tar.gz
chromium_src-654512b4c7e02401af2ce207d678c683841eedb6.tar.bz2
Protect local storage created by extension apps.
BUG=49228 TEST=ExtensionsServiceTest.InstallAppsAndCheckStorageProtection TEST=DatabaseTrackerTest.* Review URL: http://codereview.chromium.org/3256003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58108 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extensions_service.h')
-rw-r--r--chrome/browser/extensions/extensions_service.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extensions_service.h b/chrome/browser/extensions/extensions_service.h
index efdc17b..f158303 100644
--- a/chrome/browser/extensions/extensions_service.h
+++ b/chrome/browser/extensions/extensions_service.h
@@ -362,6 +362,10 @@ class ExtensionsService
ExtensionMenuManager* menu_manager() { return &menu_manager_; }
+ const std::map<GURL, int>& protected_storage_map() const {
+ return protected_storage_map_;
+ }
+
// Notify the frontend that there was an error loading an extension.
// This method is public because ExtensionsServiceBackend can post to here.
void ReportExtensionLoadError(const FilePath& extension_path,
@@ -412,6 +416,8 @@ class ExtensionsService
void LoadInstalledExtension(const ExtensionInfo& info, bool write_to_prefs);
// Helper methods to configure the storage services accordingly.
+ void GrantProtectedStorage(Extension* extension);
+ void RevokeProtectedStorage(Extension* extension);
void GrantUnlimitedStorage(Extension* extension);
void RevokeUnlimitedStorage(Extension* extension);
@@ -489,10 +495,18 @@ class ExtensionsService
typedef std::map<GURL, int> UnlimitedStorageMap;
UnlimitedStorageMap unlimited_storage_map_;
+ // Collection of origins whose storage is protected by "Clear browsing data."
+ // A map from origin to the number of Apps currently installed and therefore
+ // intrinsically protected.
+ typedef std::map<GURL, int> ProtectedStorageMap;
+ ProtectedStorageMap protected_storage_map_;
+
FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest,
UpdatePendingExtensionAlreadyInstalled);
FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest,
InstallAppsWithUnlimtedStorage);
+ FRIEND_TEST_ALL_PREFIXES(ExtensionsServiceTest,
+ InstallAppsAndCheckStorageProtection);
DISALLOW_COPY_AND_ASSIGN(ExtensionsService);
};