| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_INFO_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_INFO_MAP_H_ |
| 6 #define EXTENSIONS_BROWSER_INFO_MAP_H_ | 6 #define EXTENSIONS_BROWSER_INFO_MAP_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "extensions/browser/api/declarative_net_request/ruleset_manager.h" |
| 13 #include "extensions/browser/process_map.h" | 14 #include "extensions/browser/process_map.h" |
| 14 #include "extensions/browser/quota_service.h" | 15 #include "extensions/browser/quota_service.h" |
| 15 #include "extensions/common/extension_set.h" | 16 #include "extensions/common/extension_set.h" |
| 16 #include "extensions/common/permissions/api_permission.h" | 17 #include "extensions/common/permissions/api_permission.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class FilePath; | 20 class FilePath; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace extensions { | 23 namespace extensions { |
| 23 class ContentVerifier; | 24 class ContentVerifier; |
| 24 class Extension; | 25 class Extension; |
| 25 | 26 |
| 26 // Contains extension data that needs to be accessed on the IO thread. It can | 27 // Contains extension data that needs to be accessed on the IO thread. It can |
| 27 // be created/destroyed on any thread, but all other methods must be called on | 28 // be created/destroyed on any thread, but all other methods must be called on |
| 28 // the IO thread. | 29 // the IO thread. |
| 29 class InfoMap : public base::RefCountedThreadSafe<InfoMap> { | 30 class InfoMap : public base::RefCountedThreadSafe<InfoMap> { |
| 30 public: | 31 public: |
| 31 InfoMap(); | 32 InfoMap(); |
| 32 | 33 |
| 33 const ExtensionSet& extensions() const; | 34 const ExtensionSet& extensions() const; |
| 34 const ExtensionSet& disabled_extensions() const; | 35 const ExtensionSet& disabled_extensions() const; |
| 35 | 36 |
| 36 // Information about which extensions are assigned to which render processes. | 37 // Information about which extensions are assigned to which render processes. |
| 37 const ProcessMap& process_map() const { return process_map_; } | 38 const ProcessMap& process_map() const { return process_map_; } |
| 38 | 39 |
| 40 declarative_net_request::RulesetManager* ruleset_manager() { |
| 41 return &ruleset_manager_; |
| 42 } |
| 43 |
| 44 const declarative_net_request::RulesetManager* ruleset_manager() const { |
| 45 return &ruleset_manager_; |
| 46 } |
| 47 |
| 39 // Callback for when new extensions are loaded. | 48 // Callback for when new extensions are loaded. |
| 40 void AddExtension(const Extension* extension, | 49 void AddExtension(const Extension* extension, |
| 41 base::Time install_time, | 50 base::Time install_time, |
| 42 bool incognito_enabled, | 51 bool incognito_enabled, |
| 43 bool notifications_disabled); | 52 bool notifications_disabled); |
| 44 | 53 |
| 45 // Callback for when an extension is unloaded. | 54 // Callback for when an extension is unloaded. |
| 46 void RemoveExtension(const std::string& extension_id, | 55 void RemoveExtension(const std::string& extension_id, |
| 47 const UnloadedExtensionReason reason); | 56 const UnloadedExtensionReason reason); |
| 48 | 57 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 ExtraDataMap extra_data_; | 112 ExtraDataMap extra_data_; |
| 104 | 113 |
| 105 // Used by dispatchers to limit API quota for individual extensions. | 114 // Used by dispatchers to limit API quota for individual extensions. |
| 106 // The QuotaService is not thread safe. We need to create and destroy it on | 115 // The QuotaService is not thread safe. We need to create and destroy it on |
| 107 // the IO thread. | 116 // the IO thread. |
| 108 std::unique_ptr<QuotaService> quota_service_; | 117 std::unique_ptr<QuotaService> quota_service_; |
| 109 | 118 |
| 110 // Assignment of extensions to renderer processes. | 119 // Assignment of extensions to renderer processes. |
| 111 ProcessMap process_map_; | 120 ProcessMap process_map_; |
| 112 | 121 |
| 122 declarative_net_request::RulesetManager ruleset_manager_; |
| 123 |
| 113 scoped_refptr<ContentVerifier> content_verifier_; | 124 scoped_refptr<ContentVerifier> content_verifier_; |
| 114 }; | 125 }; |
| 115 | 126 |
| 116 } // namespace extensions | 127 } // namespace extensions |
| 117 | 128 |
| 118 #endif // EXTENSIONS_BROWSER_INFO_MAP_H_ | 129 #endif // EXTENSIONS_BROWSER_INFO_MAP_H_ |
| OLD | NEW |