OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 typedef std::set<ExtensionHost*> ExtensionHostSet; | 50 typedef std::set<ExtensionHost*> ExtensionHostSet; |
51 typedef ExtensionHostSet::const_iterator const_iterator; | 51 typedef ExtensionHostSet::const_iterator const_iterator; |
52 const_iterator begin() const { return all_hosts_.begin(); } | 52 const_iterator begin() const { return all_hosts_.begin(); } |
53 const_iterator end() const { return all_hosts_.end(); } | 53 const_iterator end() const { return all_hosts_.end(); } |
54 | 54 |
55 // Called just before |host| is destroyed so it can be de-registered | 55 // Called just before |host| is destroyed so it can be de-registered |
56 // from our lists. | 56 // from our lists. |
57 void OnExtensionHostDestroyed(ExtensionHost* host); | 57 void OnExtensionHostDestroyed(ExtensionHost* host); |
58 | 58 |
59 private: | 59 private: |
| 60 // Called just after |host| is created so it can be registered in our lists. |
| 61 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); |
| 62 |
60 NotificationRegistrar registrar_; | 63 NotificationRegistrar registrar_; |
61 | 64 |
62 // The set of all ExtensionHosts managed by this process manager. | 65 // The set of all ExtensionHosts managed by this process manager. |
63 ExtensionHostSet all_hosts_; | 66 ExtensionHostSet all_hosts_; |
64 | 67 |
65 // The set of running viewless background extensions. | 68 // The set of running viewless background extensions. |
66 ExtensionHostSet background_hosts_; | 69 ExtensionHostSet background_hosts_; |
67 | 70 |
68 // The BrowsingInstance shared by all extensions in this profile. This | 71 // The BrowsingInstance shared by all extensions in this profile. This |
69 // controls process grouping. | 72 // controls process grouping. |
70 scoped_refptr<BrowsingInstance> browsing_instance_; | 73 scoped_refptr<BrowsingInstance> browsing_instance_; |
71 | 74 |
72 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 75 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
73 }; | 76 }; |
74 | 77 |
75 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |