| 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 | 50 |
| 51 typedef std::set<ExtensionHost*> ExtensionHostSet; | 51 typedef std::set<ExtensionHost*> ExtensionHostSet; |
| 52 typedef ExtensionHostSet::const_iterator const_iterator; | 52 typedef ExtensionHostSet::const_iterator const_iterator; |
| 53 const_iterator begin() const { return all_hosts_.begin(); } | 53 const_iterator begin() const { return all_hosts_.begin(); } |
| 54 const_iterator end() const { return all_hosts_.end(); } | 54 const_iterator end() const { return all_hosts_.end(); } |
| 55 | 55 |
| 56 // Called just before |host| is destroyed so it can be de-registered | 56 // Called just before |host| is destroyed so it can be de-registered |
| 57 // from our lists. | 57 // from our lists. |
| 58 void OnExtensionHostDestroyed(ExtensionHost* host); | 58 void OnExtensionHostDestroyed(ExtensionHost* host); |
| 59 | 59 |
| 60 // Called after an extension render process crashes. |
| 61 void OnExtensionProcessCrashed(ExtensionHost* host); |
| 62 |
| 63 // Called after an extension process successfully restarts after crash. |
| 64 void OnExtensionProcessRestored(ExtensionHost* host); |
| 65 |
| 60 private: | 66 private: |
| 61 // Called just after |host| is created so it can be registered in our lists. | 67 // Called just after |host| is created so it can be registered in our lists. |
| 62 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); | 68 void OnExtensionHostCreated(ExtensionHost* host, bool is_background); |
| 63 | 69 |
| 64 NotificationRegistrar registrar_; | 70 NotificationRegistrar registrar_; |
| 65 | 71 |
| 66 // The set of all ExtensionHosts managed by this process manager. | 72 // The set of all ExtensionHosts managed by this process manager. |
| 67 ExtensionHostSet all_hosts_; | 73 ExtensionHostSet all_hosts_; |
| 68 | 74 |
| 69 // The set of running viewless background extensions. | 75 // The set of running viewless background extensions. |
| 70 ExtensionHostSet background_hosts_; | 76 ExtensionHostSet background_hosts_; |
| 71 | 77 |
| 72 // The BrowsingInstance shared by all extensions in this profile. This | 78 // The BrowsingInstance shared by all extensions in this profile. This |
| 73 // controls process grouping. | 79 // controls process grouping. |
| 74 scoped_refptr<BrowsingInstance> browsing_instance_; | 80 scoped_refptr<BrowsingInstance> browsing_instance_; |
| 75 | 81 |
| 76 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 82 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
| 77 }; | 83 }; |
| 78 | 84 |
| 79 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 85 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
| OLD | NEW |