OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 5 #ifndef EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 6 #define EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // Tracks network requests for a given RenderViewHost, used to know | 107 // Tracks network requests for a given RenderViewHost, used to know |
108 // when network activity is idle for lazy background pages. | 108 // when network activity is idle for lazy background pages. |
109 void OnNetworkRequestStarted(content::RenderViewHost* render_view_host); | 109 void OnNetworkRequestStarted(content::RenderViewHost* render_view_host); |
110 void OnNetworkRequestDone(content::RenderViewHost* render_view_host); | 110 void OnNetworkRequestDone(content::RenderViewHost* render_view_host); |
111 | 111 |
112 // Prevents |extension|'s background page from being closed and sends the | 112 // Prevents |extension|'s background page from being closed and sends the |
113 // onSuspendCanceled() event to it. | 113 // onSuspendCanceled() event to it. |
114 void CancelSuspend(const Extension* extension); | 114 void CancelSuspend(const Extension* extension); |
115 | 115 |
116 // If |defer| is true background host creation is to be deferred until this is | |
117 // called again with |defer| set to false, at which point all deferred | |
118 // background hosts will be created. Defaults to false. | |
119 void DeferBackgroundHostCreation(bool defer); | |
120 | |
121 // Ensures background hosts are loaded for a new browser window. | 116 // Ensures background hosts are loaded for a new browser window. |
122 void OnBrowserWindowReady(); | 117 void OnBrowserWindowReady(); |
123 | 118 |
124 // Gets the BrowserContext associated with site_instance_ and all other | 119 // Gets the BrowserContext associated with site_instance_ and all other |
125 // related SiteInstances. | 120 // related SiteInstances. |
126 content::BrowserContext* GetBrowserContext() const; | 121 content::BrowserContext* GetBrowserContext() const; |
127 | 122 |
128 protected: | 123 protected: |
129 // If |context| is incognito pass the master context as |original_context|. | 124 // If |context| is incognito pass the master context as |original_context|. |
130 // Otherwise pass the same context for both. | 125 // Otherwise pass the same context for both. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // If true, then creation of background hosts is suspended. | |
219 bool defer_background_host_creation_; | |
220 | |
221 // True if we have created the startup set of background hosts. | 213 // True if we have created the startup set of background hosts. |
222 bool startup_background_hosts_created_; | 214 bool startup_background_hosts_created_; |
223 | 215 |
224 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; | 216 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; |
225 | 217 |
226 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; | 218 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; |
227 | 219 |
228 DISALLOW_COPY_AND_ASSIGN(ProcessManager); | 220 DISALLOW_COPY_AND_ASSIGN(ProcessManager); |
229 }; | 221 }; |
230 | 222 |
231 } // namespace extensions | 223 } // namespace extensions |
232 | 224 |
233 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ | 225 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ |
OLD | NEW |