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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 public: | 31 public: |
32 InfoMap(); | 32 InfoMap(); |
33 | 33 |
34 const ExtensionSet& extensions() const { return extensions_; } | 34 const ExtensionSet& extensions() const { return extensions_; } |
35 const ExtensionSet& disabled_extensions() const { | 35 const ExtensionSet& disabled_extensions() const { |
36 return disabled_extensions_; | 36 return disabled_extensions_; |
37 } | 37 } |
38 | 38 |
39 // Information about which extensions are assigned to which render processes. | 39 // Information about which extensions are assigned to which render processes. |
40 const ProcessMap& process_map() const { return process_map_; } | 40 const ProcessMap& process_map() const { return process_map_; } |
41 // Information about which extensions are assigned to which worker processes. | |
42 const ProcessMap& worker_process_map() const { return worker_process_map_; } | |
43 | 41 |
44 // Callback for when new extensions are loaded. | 42 // Callback for when new extensions are loaded. |
45 void AddExtension(const extensions::Extension* extension, | 43 void AddExtension(const extensions::Extension* extension, |
46 base::Time install_time, | 44 base::Time install_time, |
47 bool incognito_enabled, | 45 bool incognito_enabled, |
48 bool notifications_disabled); | 46 bool notifications_disabled); |
49 | 47 |
50 // Callback for when an extension is unloaded. | 48 // Callback for when an extension is unloaded. |
51 void RemoveExtension(const std::string& extension_id, | 49 void RemoveExtension(const std::string& extension_id, |
52 const extensions::UnloadedExtensionInfo::Reason reason); | 50 const extensions::UnloadedExtensionInfo::Reason reason); |
(...skipping 13 matching lines...) Expand all Loading... |
66 void RegisterExtensionProcess(const std::string& extension_id, | 64 void RegisterExtensionProcess(const std::string& extension_id, |
67 int process_id, | 65 int process_id, |
68 int site_instance_id); | 66 int site_instance_id); |
69 | 67 |
70 // Removes an entry from process_map_. | 68 // Removes an entry from process_map_. |
71 void UnregisterExtensionProcess(const std::string& extension_id, | 69 void UnregisterExtensionProcess(const std::string& extension_id, |
72 int process_id, | 70 int process_id, |
73 int site_instance_id); | 71 int site_instance_id); |
74 void UnregisterAllExtensionsInProcess(int process_id); | 72 void UnregisterAllExtensionsInProcess(int process_id); |
75 | 73 |
76 // Adds an entry to worker_process_map_. | |
77 void RegisterExtensionWorkerProcess(const std::string& extension_id, | |
78 int process_id, | |
79 int site_instance_id); | |
80 | |
81 // Removes an entry from worker_process_map_. | |
82 void UnregisterExtensionWorkerProcess(int process_id); | |
83 | |
84 // Returns the subset of extensions which has the same |origin| in | 74 // Returns the subset of extensions which has the same |origin| in |
85 // |process_id| with the specified |permission|. | 75 // |process_id| with the specified |permission|. |
86 void GetExtensionsWithAPIPermissionForSecurityOrigin( | 76 void GetExtensionsWithAPIPermissionForSecurityOrigin( |
87 const GURL& origin, | 77 const GURL& origin, |
88 int process_id, | 78 int process_id, |
89 extensions::APIPermission::ID permission, | 79 extensions::APIPermission::ID permission, |
90 ExtensionSet* extensions) const; | 80 ExtensionSet* extensions) const; |
91 | 81 |
92 // Returns true if there is exists an extension with the same origin as | 82 // Returns true if there is exists an extension with the same origin as |
93 // |origin| in |process_id| with |permission|. | 83 // |origin| in |process_id| with |permission|. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ExtraDataMap extra_data_; | 126 ExtraDataMap extra_data_; |
137 | 127 |
138 // Used by dispatchers to limit API quota for individual extensions. | 128 // Used by dispatchers to limit API quota for individual extensions. |
139 // The QuotaService is not thread safe. We need to create and destroy it on | 129 // The QuotaService is not thread safe. We need to create and destroy it on |
140 // the IO thread. | 130 // the IO thread. |
141 scoped_ptr<QuotaService> quota_service_; | 131 scoped_ptr<QuotaService> quota_service_; |
142 | 132 |
143 // Assignment of extensions to renderer processes. | 133 // Assignment of extensions to renderer processes. |
144 extensions::ProcessMap process_map_; | 134 extensions::ProcessMap process_map_; |
145 | 135 |
146 // Assignment of extensions to worker processes. | |
147 extensions::ProcessMap worker_process_map_; | |
148 | |
149 int signin_process_id_; | 136 int signin_process_id_; |
150 | 137 |
151 scoped_refptr<ContentVerifier> content_verifier_; | 138 scoped_refptr<ContentVerifier> content_verifier_; |
152 }; | 139 }; |
153 | 140 |
154 } // namespace extensions | 141 } // namespace extensions |
155 | 142 |
156 #endif // EXTENSIONS_BROWSER_INFO_MAP_H_ | 143 #endif // EXTENSIONS_BROWSER_INFO_MAP_H_ |
OLD | NEW |