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

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

Issue 2141753002: [Extensions] Code cleanup - const &s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 <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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698