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

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

Issue 2592793002: Revert of Change how the quota system computes the total poolsize for temporary storage (Closed)
Patch Set: Created 4 years 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 331c9a3088fc3c223d58fd12118b0c0e783add3c..2abb046383df60a9c9853258394bc247aae87b1c 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -114,6 +114,11 @@ bool ExtensionSpecialStoragePolicy::IsStorageSessionOnly(const GURL& origin) {
return cookie_settings_->IsCookieSessionOnly(origin);
}
+bool ExtensionSpecialStoragePolicy::CanQueryDiskSize(const GURL& origin) {
+ base::AutoLock locker(lock_);
+ return installed_apps_.Contains(origin);
+}
+
bool ExtensionSpecialStoragePolicy::HasSessionOnlyOrigins() {
if (cookie_settings_.get() == NULL)
return false;
@@ -172,6 +177,9 @@ void ExtensionSpecialStoragePolicy::GrantRightsForExtension(
extension->is_app()) {
if (NeedsProtection(extension) && protected_apps_.Add(extension))
change_flags |= SpecialStoragePolicy::STORAGE_PROTECTED;
+ // FIXME: Does GrantRightsForExtension imply |extension| is installed?
+ if (extension->is_app())
+ installed_apps_.Add(extension);
if (extension->permissions_data()->HasAPIPermission(
APIPermission::kUnlimitedStorage) &&
@@ -217,6 +225,9 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForExtension(
if (NeedsProtection(extension) && protected_apps_.Remove(extension))
change_flags |= SpecialStoragePolicy::STORAGE_PROTECTED;
+ if (extension->is_app())
+ installed_apps_.Remove(extension);
+
if (extension->permissions_data()->HasAPIPermission(
APIPermission::kUnlimitedStorage) &&
unlimited_extensions_.Remove(extension))
@@ -240,6 +251,7 @@ void ExtensionSpecialStoragePolicy::RevokeRightsForAllExtensions() {
{
base::AutoLock locker(lock_);
protected_apps_.Clear();
+ installed_apps_.Clear();
unlimited_extensions_.Clear();
file_handler_extensions_.Clear();
isolated_extensions_.Clear();

Powered by Google App Engine
This is Rietveld 408576698