OLD | NEW |
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 #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 <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 // Remove any record of |extension_id| created with RegisterExtensionProcess. | 60 // Remove any record of |extension_id| created with RegisterExtensionProcess. |
61 // If |extension_id| is unknown, we ignore it. | 61 // If |extension_id| is unknown, we ignore it. |
62 void UnregisterExtensionProcess(const std::string& extension_id, | 62 void UnregisterExtensionProcess(const std::string& extension_id, |
63 int process_id); | 63 int process_id); |
64 | 64 |
65 // Returns true if |extension_id| is running in |process_id|.. | 65 // Returns true if |extension_id| is running in |process_id|.. |
66 bool IsExtensionInProcess(const std::string& extension_id, | 66 bool IsExtensionInProcess(const std::string& extension_id, |
67 int process_id) const; | 67 int process_id) const; |
68 | 68 |
| 69 // Returns true if there is exists an extension with the same origin as |
| 70 // |origin| in |process_id| with |permission|. |
| 71 bool SecurityOriginHasAPIPermission( |
| 72 const GURL& origin, int process_id, |
| 73 ExtensionAPIPermission::ID permission) const; |
| 74 |
69 private: | 75 private: |
70 // Extra dynamic data related to an extension. | 76 // Extra dynamic data related to an extension. |
71 struct ExtraData; | 77 struct ExtraData; |
72 // Map of extension_id to ExtraData. | 78 // Map of extension_id to ExtraData. |
73 typedef std::map<std::string, ExtraData> ExtraDataMap; | 79 typedef std::map<std::string, ExtraData> ExtraDataMap; |
74 | 80 |
75 ExtensionSet extensions_; | 81 ExtensionSet extensions_; |
76 ExtensionSet disabled_extensions_; | 82 ExtensionSet disabled_extensions_; |
77 | 83 |
78 // Extra data associated with enabled extensions. | 84 // Extra data associated with enabled extensions. |
79 ExtraDataMap extra_data_; | 85 ExtraDataMap extra_data_; |
80 | 86 |
81 typedef std::multimap<std::string, int> ExtensionProcessIDMap; | 87 typedef std::multimap<std::string, int> ExtensionProcessIDMap; |
82 ExtensionProcessIDMap extension_process_ids_; | 88 ExtensionProcessIDMap extension_process_ids_; |
83 }; | 89 }; |
84 | 90 |
85 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ | 91 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_INFO_MAP_H_ |
OLD | NEW |