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

Side by Side Diff: chrome/browser/extensions/extension_special_storage_policy.cc

Issue 1229933007: Make quota logic obey durable storage permission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@3_top_durable
Patch Set: fix extensions_browsertests compile Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/extension_special_storage_policy.h" 5 #include "chrome/browser/extensions/extension_special_storage_policy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 return true; 129 return true;
130 } 130 }
131 return false; 131 return false;
132 } 132 }
133 133
134 bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) { 134 bool ExtensionSpecialStoragePolicy::HasIsolatedStorage(const GURL& origin) {
135 base::AutoLock locker(lock_); 135 base::AutoLock locker(lock_);
136 return isolated_extensions_.Contains(origin); 136 return isolated_extensions_.Contains(origin);
137 } 137 }
138 138
139 bool ExtensionSpecialStoragePolicy::IsStorageDurable(const GURL& origin) {
140 return cookie_settings_->IsStorageDurable(origin);
141 }
142
139 bool ExtensionSpecialStoragePolicy::NeedsProtection( 143 bool ExtensionSpecialStoragePolicy::NeedsProtection(
140 const extensions::Extension* extension) { 144 const extensions::Extension* extension) {
141 return extension->is_hosted_app() && !extension->from_bookmark(); 145 return extension->is_hosted_app() && !extension->from_bookmark();
142 } 146 }
143 147
144 const extensions::ExtensionSet* 148 const extensions::ExtensionSet*
145 ExtensionSpecialStoragePolicy::ExtensionsProtectingOrigin( 149 ExtensionSpecialStoragePolicy::ExtensionsProtectingOrigin(
146 const GURL& origin) { 150 const GURL& origin) {
147 base::AutoLock locker(lock_); 151 base::AutoLock locker(lock_);
148 return protected_apps_.ExtensionsContaining(origin); 152 return protected_apps_.ExtensionsContaining(origin);
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 } 355 }
352 356
353 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { 357 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() {
354 ClearCache(); 358 ClearCache();
355 extensions_.Clear(); 359 extensions_.Clear();
356 } 360 }
357 361
358 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { 362 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() {
359 STLDeleteValues(&cached_results_); 363 STLDeleteValues(&cached_results_);
360 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698