Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(316)

Side by Side Diff: extensions/browser/process_manager.h

Issue 547003002: Remove the --event-page-idle-time and --event-page-suspending-time switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 1s Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 content::BrowserContext* GetBrowserContext() const; 141 content::BrowserContext* GetBrowserContext() const;
142 142
143 // Sets callbacks for testing keepalive impulse behavior. 143 // Sets callbacks for testing keepalive impulse behavior.
144 typedef base::Callback<void(const std::string& extension_id)> 144 typedef base::Callback<void(const std::string& extension_id)>
145 ImpulseCallbackForTesting; 145 ImpulseCallbackForTesting;
146 void SetKeepaliveImpulseCallbackForTesting( 146 void SetKeepaliveImpulseCallbackForTesting(
147 const ImpulseCallbackForTesting& callback); 147 const ImpulseCallbackForTesting& callback);
148 void SetKeepaliveImpulseDecrementCallbackForTesting( 148 void SetKeepaliveImpulseDecrementCallbackForTesting(
149 const ImpulseCallbackForTesting& callback); 149 const ImpulseCallbackForTesting& callback);
150 150
151 // Sets the time in milliseconds that an extension event page can
152 // be idle before it is shut down; must be > 0.
153 static void SetEventPageIdleTimeForTesting(unsigned idle_time_msec);
154
155 // Sets the time in milliseconds that an extension event page has
156 // between being notified of its impending unload and that unload
157 // happening.
158 static void SetEventPageSuspendingTimeForTesting(
159 unsigned suspending_time_msec);
160
151 // Creates a non-incognito instance for tests. |registry| allows unit tests 161 // Creates a non-incognito instance for tests. |registry| allows unit tests
152 // to inject an ExtensionRegistry that is not managed by the usual 162 // to inject an ExtensionRegistry that is not managed by the usual
153 // BrowserContextKeyedServiceFactory system. 163 // BrowserContextKeyedServiceFactory system.
154 static ProcessManager* CreateForTesting(content::BrowserContext* context, 164 static ProcessManager* CreateForTesting(content::BrowserContext* context,
155 ExtensionRegistry* registry); 165 ExtensionRegistry* registry);
156 166
157 // Creates an incognito-context instance for tests. 167 // Creates an incognito-context instance for tests.
158 static ProcessManager* CreateIncognitoForTesting( 168 static ProcessManager* CreateIncognitoForTesting(
159 content::BrowserContext* incognito_context, 169 content::BrowserContext* incognito_context,
160 content::BrowserContext* original_context, 170 content::BrowserContext* original_context,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 251
242 void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached); 252 void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached);
243 253
244 // Contains all active extension-related RenderViewHost instances for all 254 // Contains all active extension-related RenderViewHost instances for all
245 // extensions. We also keep a cache of the host's view type, because that 255 // extensions. We also keep a cache of the host's view type, because that
246 // information is not accessible at registration/deregistration time. 256 // information is not accessible at registration/deregistration time.
247 ExtensionRenderViews all_extension_views_; 257 ExtensionRenderViews all_extension_views_;
248 258
249 BackgroundPageDataMap background_page_data_; 259 BackgroundPageDataMap background_page_data_;
250 260
251 // The time to delay between an extension becoming idle and
252 // sending a ShouldSuspend message; read from command-line switch.
253 base::TimeDelta event_page_idle_time_;
254
255 // The time to delay between sending a ShouldSuspend message and
256 // sending a Suspend message; read from command-line switch.
257 base::TimeDelta event_page_suspending_time_;
258
259 // True if we have created the startup set of background hosts. 261 // True if we have created the startup set of background hosts.
260 bool startup_background_hosts_created_; 262 bool startup_background_hosts_created_;
261 263
262 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; 264 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_;
263 265
264 ImpulseCallbackForTesting keepalive_impulse_callback_for_testing_; 266 ImpulseCallbackForTesting keepalive_impulse_callback_for_testing_;
265 ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_; 267 ImpulseCallbackForTesting keepalive_impulse_decrement_callback_for_testing_;
266 268
267 ObserverList<ProcessManagerObserver> observer_list_; 269 ObserverList<ProcessManagerObserver> observer_list_;
268 270
(...skipping 14 matching lines...) Expand all
283 285
284 // Must be last member, see doc on WeakPtrFactory. 286 // Must be last member, see doc on WeakPtrFactory.
285 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; 287 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_;
286 288
287 DISALLOW_COPY_AND_ASSIGN(ProcessManager); 289 DISALLOW_COPY_AND_ASSIGN(ProcessManager);
288 }; 290 };
289 291
290 } // namespace extensions 292 } // namespace extensions
291 293
292 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ 294 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/notifications_apitest.cc ('k') | extensions/browser/process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698