Chromium Code Reviews| 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_PROCESS_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 // Returns the SiteInstance that the given URL belongs to. | 69 // Returns the SiteInstance that the given URL belongs to. |
| 70 virtual SiteInstance* GetSiteInstanceForURL(const GURL& url); | 70 virtual SiteInstance* GetSiteInstanceForURL(const GURL& url); |
| 71 | 71 |
| 72 // Registers a SiteInstance as hosting a given extension. | 72 // Registers a SiteInstance as hosting a given extension. |
| 73 void RegisterExtensionSiteInstance(SiteInstance* site_instance, | 73 void RegisterExtensionSiteInstance(SiteInstance* site_instance, |
| 74 const Extension* extension); | 74 const Extension* extension); |
| 75 | 75 |
| 76 // Unregisters the extension associated with |site_instance|. | 76 // Unregisters the extension associated with |site_instance|. |
| 77 void UnregisterExtensionSiteInstance(SiteInstance* site_instance); | 77 void UnregisterExtensionSiteInstance(SiteInstance* site_instance); |
| 78 | 78 |
| 79 // True if this process host is hosting an extension. | |
| 80 bool IsExtensionProcess(int host_id); | |
|
jam
2011/10/04 16:59:22
to be consistent with everywhere else, please use
jochen (gone - plz use gerrit)
2011/10/04 18:50:19
Done.
| |
| 81 | |
| 79 // True if this process host is hosting an extension with extension bindings | 82 // True if this process host is hosting an extension with extension bindings |
| 80 // enabled. | 83 // enabled. |
| 81 bool AreBindingsEnabledForProcess(int host_id); | 84 bool AreBindingsEnabledForProcess(int host_id); |
| 82 | 85 |
| 83 // Returns the extension process that |url| is associated with if it exists. | 86 // Returns the extension process that |url| is associated with if it exists. |
| 84 // This is not valid for hosted apps without the background permission, since | 87 // This is not valid for hosted apps without the background permission, since |
| 85 // such apps may have multiple processes. | 88 // such apps may have multiple processes. |
| 86 virtual RenderProcessHost* GetExtensionProcess(const GURL& url); | 89 virtual RenderProcessHost* GetExtensionProcess(const GURL& url); |
| 87 | 90 |
| 88 // Returns the process that the extension with the given ID is running in. | 91 // Returns the process that the extension with the given ID is running in. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 SiteInstanceIDMap extension_ids_; | 133 SiteInstanceIDMap extension_ids_; |
| 131 | 134 |
| 132 // A map of process ID to site instance ID of the site instances it hosts. | 135 // A map of process ID to site instance ID of the site instances it hosts. |
| 133 typedef std::map<int, std::set<int> > ProcessIDMap; | 136 typedef std::map<int, std::set<int> > ProcessIDMap; |
| 134 ProcessIDMap process_ids_; | 137 ProcessIDMap process_ids_; |
| 135 | 138 |
| 136 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 139 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
| 137 }; | 140 }; |
| 138 | 141 |
| 139 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 142 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
| OLD | NEW |