OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 void CloseLazyBackgroundPageNow(const std::string& extension_id, | 188 void CloseLazyBackgroundPageNow(const std::string& extension_id, |
189 int sequence_id); | 189 int sequence_id); |
190 | 190 |
191 // Potentially registers a RenderViewHost, if it is associated with an | 191 // Potentially registers a RenderViewHost, if it is associated with an |
192 // extension. Does nothing if this is not an extension renderer. | 192 // extension. Does nothing if this is not an extension renderer. |
193 void RegisterRenderViewHost(content::RenderViewHost* render_view_host); | 193 void RegisterRenderViewHost(content::RenderViewHost* render_view_host); |
194 | 194 |
195 // Clears background page data for this extension. | 195 // Clears background page data for this extension. |
196 void ClearBackgroundPageData(const std::string& extension_id); | 196 void ClearBackgroundPageData(const std::string& extension_id); |
197 | 197 |
198 // Returns true if loading background pages should be deferred. This is | |
199 // true if there are no browser windows open and the browser process was | |
200 // started to show the app launcher. | |
201 bool DeferLoadingBackgroundHosts() const; | |
202 | |
203 // Contains all active extension-related RenderViewHost instances for all | 198 // Contains all active extension-related RenderViewHost instances for all |
204 // extensions. We also keep a cache of the host's view type, because that | 199 // extensions. We also keep a cache of the host's view type, because that |
205 // information is not accessible at registration/deregistration time. | 200 // information is not accessible at registration/deregistration time. |
206 ExtensionRenderViews all_extension_views_; | 201 ExtensionRenderViews all_extension_views_; |
207 | 202 |
208 BackgroundPageDataMap background_page_data_; | 203 BackgroundPageDataMap background_page_data_; |
209 | 204 |
210 // The time to delay between an extension becoming idle and | 205 // The time to delay between an extension becoming idle and |
211 // sending a ShouldSuspend message; read from command-line switch. | 206 // sending a ShouldSuspend message; read from command-line switch. |
212 base::TimeDelta event_page_idle_time_; | 207 base::TimeDelta event_page_idle_time_; |
213 | 208 |
214 // The time to delay between sending a ShouldSuspend message and | 209 // The time to delay between sending a ShouldSuspend message and |
215 // sending a Suspend message; read from command-line switch. | 210 // sending a Suspend message; read from command-line switch. |
216 base::TimeDelta event_page_suspending_time_; | 211 base::TimeDelta event_page_suspending_time_; |
217 | 212 |
218 base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_; | 213 base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_; |
219 | 214 |
220 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); | 215 DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager); |
221 }; | 216 }; |
222 | 217 |
223 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ | 218 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROCESS_MANAGER_H_ |
OLD | NEW |