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

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

Issue 6532008: Fix chromium-style compile error that got in the tree since yesterday. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for Feb 17th Created 9 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/logging.h" 7 #include "base/logging.h"
8 #include "chrome/common/extensions/extension.h" 8 #include "chrome/common/extensions/extension.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 10
11 ExtensionSpecialStoragePolicy::ExtensionSpecialStoragePolicy() {}
12
11 bool ExtensionSpecialStoragePolicy::IsStorageProtected(const GURL& origin) { 13 bool ExtensionSpecialStoragePolicy::IsStorageProtected(const GURL& origin) {
12 if (origin.SchemeIs(chrome::kExtensionScheme)) 14 if (origin.SchemeIs(chrome::kExtensionScheme))
13 return true; 15 return true;
14 base::AutoLock locker(lock_); 16 base::AutoLock locker(lock_);
15 return protected_apps_.Contains(origin); 17 return protected_apps_.Contains(origin);
16 } 18 }
17 19
18 bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) { 20 bool ExtensionSpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
19 base::AutoLock locker(lock_); 21 base::AutoLock locker(lock_);
20 return unlimited_extensions_.Contains(origin); 22 return unlimited_extensions_.Contains(origin);
(...skipping 26 matching lines...) Expand all
47 if (extension->HasApiPermission(Extension::kUnlimitedStoragePermission)) 49 if (extension->HasApiPermission(Extension::kUnlimitedStoragePermission))
48 unlimited_extensions_.Remove(extension); 50 unlimited_extensions_.Remove(extension);
49 } 51 }
50 52
51 void ExtensionSpecialStoragePolicy::RevokeRightsForAllExtensions() { 53 void ExtensionSpecialStoragePolicy::RevokeRightsForAllExtensions() {
52 base::AutoLock locker(lock_); 54 base::AutoLock locker(lock_);
53 protected_apps_.Clear(); 55 protected_apps_.Clear();
54 unlimited_extensions_.Clear(); 56 unlimited_extensions_.Clear();
55 } 57 }
56 58
59 ExtensionSpecialStoragePolicy::~ExtensionSpecialStoragePolicy() {}
60
57 //----------------------------------------------------------------------------- 61 //-----------------------------------------------------------------------------
58 // SpecialCollection helper class 62 // SpecialCollection helper class
59 //----------------------------------------------------------------------------- 63 //-----------------------------------------------------------------------------
60 64
65 ExtensionSpecialStoragePolicy::SpecialCollection::SpecialCollection() {}
66
67 ExtensionSpecialStoragePolicy::SpecialCollection::~SpecialCollection() {}
68
61 bool ExtensionSpecialStoragePolicy::SpecialCollection::Contains( 69 bool ExtensionSpecialStoragePolicy::SpecialCollection::Contains(
62 const GURL& origin) { 70 const GURL& origin) {
63 CachedResults::const_iterator found = cached_resuts_.find(origin); 71 CachedResults::const_iterator found = cached_resuts_.find(origin);
64 if (found != cached_resuts_.end()) 72 if (found != cached_resuts_.end())
65 return found->second; 73 return found->second;
66 74
67 for (Extensions::const_iterator iter = extensions_.begin(); 75 for (Extensions::const_iterator iter = extensions_.begin();
68 iter != extensions_.end(); ++iter) { 76 iter != extensions_.end(); ++iter) {
69 if ((*iter)->OverlapsWithOrigin(origin)) { 77 if ((*iter)->OverlapsWithOrigin(origin)) {
70 cached_resuts_[origin] = true; 78 cached_resuts_[origin] = true;
(...skipping 13 matching lines...) Expand all
84 void ExtensionSpecialStoragePolicy::SpecialCollection::Remove( 92 void ExtensionSpecialStoragePolicy::SpecialCollection::Remove(
85 const Extension* extension) { 93 const Extension* extension) {
86 cached_resuts_.clear(); 94 cached_resuts_.clear();
87 extensions_.erase(extension); 95 extensions_.erase(extension);
88 } 96 }
89 97
90 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() { 98 void ExtensionSpecialStoragePolicy::SpecialCollection::Clear() {
91 cached_resuts_.clear(); 99 cached_resuts_.clear();
92 extensions_.clear(); 100 extensions_.clear();
93 } 101 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_special_storage_policy.h ('k') | chrome/common/render_messages_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698