Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Side by Side Diff: chrome/browser/extensions/extension_process_manager.h

Issue 8361021: Track all extension processes in ExtensionInfoMap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: argh Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 // The BrowsingInstance shared by all extensions in this profile. This 141 // The BrowsingInstance shared by all extensions in this profile. This
142 // controls process grouping. 142 // controls process grouping.
143 scoped_refptr<BrowsingInstance> browsing_instance_; 143 scoped_refptr<BrowsingInstance> browsing_instance_;
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::map<int, std::set<int> > ProcessIDMap; 150 typedef std::set<int> SiteInstanceIDSet;
151 typedef std::map<int, SiteInstanceIDSet> ProcessIDMap;
151 ProcessIDMap process_ids_; 152 ProcessIDMap process_ids_;
152 153
153 private: 154 private:
154 // Registers a site instance as hosting a given extension. 155 // Registers a site instance as hosting a given extension.
155 void RegisterExtensionSiteInstance(SiteInstance* site_instance, 156 void RegisterExtensionSiteInstance(SiteInstance* site_instance,
156 const Extension* extension); 157 const Extension* extension);
157 158
158 // Unregisters the extension associated with |site_instance|. 159 // Unregisters the extension associated with |site_instance|.
159 void UnregisterExtensionSiteInstance(SiteInstance* site_instance); 160 void UnregisterExtensionSiteInstance(SiteInstance* site_instance);
160 161
161 // Contains all extension-related RenderViewHost instances for all extensions. 162 // Contains all extension-related RenderViewHost instances for all extensions.
162 typedef std::set<RenderViewHost*> RenderViewHostSet; 163 typedef std::set<RenderViewHost*> RenderViewHostSet;
163 RenderViewHostSet all_extension_views_; 164 RenderViewHostSet all_extension_views_;
164 165
165 private: 166 private:
166 // Close the given |host| iff it's a background page. 167 // Close the given |host| iff it's a background page.
167 void CloseBackgroundHost(ExtensionHost* host); 168 void CloseBackgroundHost(ExtensionHost* host);
168 169
169 // Excludes background page. 170 // Excludes background page.
170 bool HasVisibleViews(const std::string& extension_id); 171 bool HasVisibleViews(const std::string& extension_id);
171 172
173 // Clears the mapping for the specified site instance. Returns the process the
174 // site was mapped to, or -1 if it wasn't found.
175 int ClearSiteInstanceID(int site_instance_id);
176
172 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); 177 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager);
173 }; 178 };
174 179
175 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ 180 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_info_map.cc ('k') | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698