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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 STLDeleteValues(&cached_results_); | 307 STLDeleteValues(&cached_results_); |
308 } | 308 } |
309 | 309 |
310 bool ExtensionSpecialStoragePolicy::SpecialCollection::Contains( | 310 bool ExtensionSpecialStoragePolicy::SpecialCollection::Contains( |
311 const GURL& origin) { | 311 const GURL& origin) { |
312 return !ExtensionsContaining(origin)->is_empty(); | 312 return !ExtensionsContaining(origin)->is_empty(); |
313 } | 313 } |
314 | 314 |
315 bool ExtensionSpecialStoragePolicy::SpecialCollection::GrantsCapabilitiesTo( | 315 bool ExtensionSpecialStoragePolicy::SpecialCollection::GrantsCapabilitiesTo( |
316 const GURL& origin) { | 316 const GURL& origin) { |
317 for (scoped_refptr<const Extension> extension : extensions_) { | 317 for (const auto& extension : extensions_) { |
318 if (extensions::ContentCapabilitiesInfo::Get(extension.get()) | 318 if (extensions::ContentCapabilitiesInfo::Get(extension.get()) |
319 .url_patterns.MatchesURL(origin)) { | 319 .url_patterns.MatchesURL(origin)) { |
320 return true; | 320 return true; |
321 } | 321 } |
322 } | 322 } |
323 return false; | 323 return false; |
324 } | 324 } |
325 | 325 |
326 const extensions::ExtensionSet* | 326 const extensions::ExtensionSet* |
327 ExtensionSpecialStoragePolicy::SpecialCollection::ExtensionsContaining( | 327 ExtensionSpecialStoragePolicy::SpecialCollection::ExtensionsContaining( |
(...skipping 30 matching lines...) Expand all Loading... |
358 } | 358 } |
359 | 359 |
360 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { | 360 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { |
361 ClearCache(); | 361 ClearCache(); |
362 extensions_.Clear(); | 362 extensions_.Clear(); |
363 } | 363 } |
364 | 364 |
365 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { | 365 void ExtensionSpecialStoragePolicy::SpecialCollection::ClearCache() { |
366 STLDeleteValues(&cached_results_); | 366 STLDeleteValues(&cached_results_); |
367 } | 367 } |
OLD | NEW |