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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 | 144 |
| 145 // A map of site instance ID to the ID of the extension it hosts. | 145 // A map of site instance ID to the ID of the extension it hosts. |
| 146 typedef std::map<int, std::string> SiteInstanceIDMap; | 146 typedef std::map<int, std::string> SiteInstanceIDMap; |
| 147 SiteInstanceIDMap extension_ids_; | 147 SiteInstanceIDMap extension_ids_; |
| 148 | 148 |
| 149 // A map of process ID to site instance ID of the site instances it hosts. | 149 // A map of process ID to site instance ID of the site instances it hosts. |
| 150 typedef std::set<int> SiteInstanceIDSet; | 150 typedef std::set<int> SiteInstanceIDSet; |
| 151 typedef std::map<int, SiteInstanceIDSet> ProcessIDMap; | 151 typedef std::map<int, SiteInstanceIDSet> ProcessIDMap; |
| 152 ProcessIDMap process_ids_; | 152 ProcessIDMap process_ids_; |
| 153 | 153 |
| 154 // The associated profile. | |
| 155 Profile* profile_; | |
|
Aaron Boodman
2011/11/06 23:13:16
Elsewhere in this class we get this from the brows
Yoyo Zhou
2011/11/07 23:23:18
No, I was just oblivious.
| |
| 156 | |
| 154 private: | 157 private: |
| 155 // Registers a site instance as hosting a given extension. | 158 // Registers a site instance as hosting a given extension. |
| 156 void RegisterExtensionSiteInstance(SiteInstance* site_instance, | 159 void RegisterExtensionSiteInstance(SiteInstance* site_instance, |
| 157 const Extension* extension); | 160 const Extension* extension); |
| 158 | 161 |
| 159 // Unregisters the extension associated with |site_instance|. | 162 // Unregisters the extension associated with |site_instance|. |
| 160 void UnregisterExtensionSiteInstance(SiteInstance* site_instance); | 163 void UnregisterExtensionSiteInstance(SiteInstance* site_instance); |
| 161 | 164 |
| 162 // Contains all extension-related RenderViewHost instances for all extensions. | 165 // Contains all extension-related RenderViewHost instances for all extensions. |
| 163 typedef std::set<RenderViewHost*> RenderViewHostSet; | 166 typedef std::set<RenderViewHost*> RenderViewHostSet; |
| 164 RenderViewHostSet all_extension_views_; | 167 RenderViewHostSet all_extension_views_; |
| 165 | 168 |
| 166 private: | |
| 167 // Close the given |host| iff it's a background page. | 169 // Close the given |host| iff it's a background page. |
| 168 void CloseBackgroundHost(ExtensionHost* host); | 170 void CloseBackgroundHost(ExtensionHost* host); |
| 169 | 171 |
| 170 // Excludes background page. | 172 // Excludes background page. |
| 171 bool HasVisibleViews(const std::string& extension_id); | 173 bool HasVisibleViews(const std::string& extension_id); |
| 172 | 174 |
| 173 // Clears the mapping for the specified site instance. Returns the process the | 175 // Clears the mapping for the specified site instance. Returns the process the |
| 174 // site was mapped to, or -1 if it wasn't found. | 176 // site was mapped to, or -1 if it wasn't found. |
| 175 int ClearSiteInstanceID(int site_instance_id); | 177 int ClearSiteInstanceID(int site_instance_id); |
| 176 | 178 |
| 177 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 179 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
| 178 }; | 180 }; |
| 179 | 181 |
| 180 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 182 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
| OLD | NEW |