| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 protected: | 93 protected: |
| 94 explicit ExtensionProcessManager(Profile* profile); | 94 explicit ExtensionProcessManager(Profile* profile); |
| 95 | 95 |
| 96 // Called just after |host| is created so it can be registered in our lists. | 96 // Called just after |host| is created so it can be registered in our lists. |
| 97 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); | 97 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); |
| 98 | 98 |
| 99 // Called on browser shutdown to close our extension hosts. | 99 // Called on browser shutdown to close our extension hosts. |
| 100 void CloseBackgroundHosts(); | 100 void CloseBackgroundHosts(); |
| 101 | 101 |
| 102 // NotificationObserver: | 102 // NotificationObserver: |
| 103 virtual void Observe(NotificationType type, | 103 virtual void Observe(int type, |
| 104 const NotificationSource& source, | 104 const NotificationSource& source, |
| 105 const NotificationDetails& details); | 105 const NotificationDetails& details); |
| 106 | 106 |
| 107 NotificationRegistrar registrar_; | 107 NotificationRegistrar registrar_; |
| 108 | 108 |
| 109 // The set of all ExtensionHosts managed by this process manager. | 109 // The set of all ExtensionHosts managed by this process manager. |
| 110 ExtensionHostSet all_hosts_; | 110 ExtensionHostSet all_hosts_; |
| 111 | 111 |
| 112 // The set of running viewless background extensions. | 112 // The set of running viewless background extensions. |
| 113 ExtensionHostSet background_hosts_; | 113 ExtensionHostSet background_hosts_; |
| 114 | 114 |
| 115 // The BrowsingInstance shared by all extensions in this profile. This | 115 // The BrowsingInstance shared by all extensions in this profile. This |
| 116 // controls process grouping. | 116 // controls process grouping. |
| 117 scoped_refptr<BrowsingInstance> browsing_instance_; | 117 scoped_refptr<BrowsingInstance> browsing_instance_; |
| 118 | 118 |
| 119 // A map of extension ID to the render_process_id that the extension lives in. | 119 // A map of extension ID to the render_process_id that the extension lives in. |
| 120 typedef std::map<std::string, int> ProcessIDMap; | 120 typedef std::map<std::string, int> ProcessIDMap; |
| 121 ProcessIDMap process_ids_; | 121 ProcessIDMap process_ids_; |
| 122 | 122 |
| 123 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 123 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 126 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
| OLD | NEW |