| 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 protected: | 57 protected: |
| 58 ~ExtensionSpecialStoragePolicy() override; | 58 ~ExtensionSpecialStoragePolicy() override; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 class SpecialCollection { | 61 class SpecialCollection { |
| 62 public: | 62 public: |
| 63 SpecialCollection(); | 63 SpecialCollection(); |
| 64 ~SpecialCollection(); | 64 ~SpecialCollection(); |
| 65 | 65 |
| 66 bool Contains(const GURL& origin); | 66 bool Contains(const GURL& origin); |
| 67 bool GrantsCapabilitiesTo(const GURL& origin); |
| 67 const extensions::ExtensionSet* ExtensionsContaining(const GURL& origin); | 68 const extensions::ExtensionSet* ExtensionsContaining(const GURL& origin); |
| 68 bool ContainsExtension(const std::string& extension_id); | 69 bool ContainsExtension(const std::string& extension_id); |
| 69 bool Add(const extensions::Extension* extension); | 70 bool Add(const extensions::Extension* extension); |
| 70 bool Remove(const extensions::Extension* extension); | 71 bool Remove(const extensions::Extension* extension); |
| 71 void Clear(); | 72 void Clear(); |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 typedef std::map<GURL, extensions::ExtensionSet*> CachedResults; | 75 typedef std::map<GURL, extensions::ExtensionSet*> CachedResults; |
| 75 | 76 |
| 76 void ClearCache(); | 77 void ClearCache(); |
| 77 | 78 |
| 78 extensions::ExtensionSet extensions_; | 79 extensions::ExtensionSet extensions_; |
| 79 CachedResults cached_results_; | 80 CachedResults cached_results_; |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 void NotifyGranted(const GURL& origin, int change_flags); | 83 void NotifyGranted(const GURL& origin, int change_flags); |
| 83 void NotifyRevoked(const GURL& origin, int change_flags); | 84 void NotifyRevoked(const GURL& origin, int change_flags); |
| 84 void NotifyCleared(); | 85 void NotifyCleared(); |
| 85 | 86 |
| 86 base::Lock lock_; // Synchronize all access to the collections. | 87 base::Lock lock_; // Synchronize all access to the collections. |
| 87 SpecialCollection protected_apps_; | 88 SpecialCollection protected_apps_; |
| 88 SpecialCollection installed_apps_; | 89 SpecialCollection installed_apps_; |
| 89 SpecialCollection unlimited_extensions_; | 90 SpecialCollection unlimited_extensions_; |
| 90 SpecialCollection file_handler_extensions_; | 91 SpecialCollection file_handler_extensions_; |
| 91 SpecialCollection isolated_extensions_; | 92 SpecialCollection isolated_extensions_; |
| 93 SpecialCollection content_capabilities_unlimited_extensions_; |
| 92 scoped_refptr<CookieSettings> cookie_settings_; | 94 scoped_refptr<CookieSettings> cookie_settings_; |
| 93 }; | 95 }; |
| 94 | 96 |
| 95 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ | 97 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SPECIAL_STORAGE_POLICY_H_ |
| OLD | NEW |