OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |