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_INFO_MAP_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // Removes an entry from process_map_. | 63 // Removes an entry from process_map_. |
64 void UnregisterExtensionProcess(const std::string& extension_id, | 64 void UnregisterExtensionProcess(const std::string& extension_id, |
65 int process_id, | 65 int process_id, |
66 int site_instance_id); | 66 int site_instance_id); |
67 void UnregisterAllExtensionsInProcess(int process_id); | 67 void UnregisterAllExtensionsInProcess(int process_id); |
68 | 68 |
69 // Returns true if there is exists an extension with the same origin as | 69 // Returns true if there is exists an extension with the same origin as |
70 // |origin| in |process_id| with |permission|. | 70 // |origin| in |process_id| with |permission|. |
71 bool SecurityOriginHasAPIPermission( | 71 bool SecurityOriginHasAPIPermission( |
72 const GURL& origin, int process_id, | 72 const GURL& origin, int process_id, |
73 ExtensionAPIPermission::ID permission) const; | 73 extensions::APIPermission::ID permission) const; |
74 | 74 |
75 ExtensionsQuotaService* GetQuotaService(); | 75 ExtensionsQuotaService* GetQuotaService(); |
76 | 76 |
77 private: | 77 private: |
78 friend class base::RefCountedThreadSafe<ExtensionInfoMap>; | 78 friend class base::RefCountedThreadSafe<ExtensionInfoMap>; |
79 | 79 |
80 // Extra dynamic data related to an extension. | 80 // Extra dynamic data related to an extension. |
81 struct ExtraData; | 81 struct ExtraData; |
82 // Map of extension_id to ExtraData. | 82 // Map of extension_id to ExtraData. |
83 typedef std::map<std::string, ExtraData> ExtraDataMap; | 83 typedef std::map<std::string, ExtraData> ExtraDataMap; |
84 | 84 |
85 ~ExtensionInfoMap(); | 85 ~ExtensionInfoMap(); |
86 | 86 |
87 ExtensionSet extensions_; | 87 ExtensionSet extensions_; |
88 ExtensionSet disabled_extensions_; | 88 ExtensionSet disabled_extensions_; |
89 | 89 |
90 // Extra data associated with enabled extensions. | 90 // Extra data associated with enabled extensions. |
91 ExtraDataMap extra_data_; | 91 ExtraDataMap extra_data_; |
92 | 92 |
93 // Used by dispatchers to limit API quota for individual extensions. | 93 // Used by dispatchers to limit API quota for individual extensions. |
94 // The ExtensionQutoaService is not thread safe. We need to create and destroy | 94 // The ExtensionQutoaService is not thread safe. We need to create and destroy |
95 // it on the IO thread. | 95 // it on the IO thread. |
96 scoped_ptr<ExtensionsQuotaService> quota_service_; | 96 scoped_ptr<ExtensionsQuotaService> quota_service_; |
97 | 97 |
98 // Assignment of extensions to processes. | 98 // Assignment of extensions to processes. |
99 extensions::ProcessMap process_map_; | 99 extensions::ProcessMap process_map_; |
100 }; | 100 }; |
101 | 101 |
102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ | 102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ |
OLD | NEW |