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

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

Issue 2689963003: Don't report a keepalive count for persistent pages. (Closed)
Patch Set: Update ProcessManagerBrowserTests for GetLazyKeepaliveCount Created 3 years, 10 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // WebContents, or null. 110 // WebContents, or null.
111 const Extension* GetExtensionForRenderFrameHost( 111 const Extension* GetExtensionForRenderFrameHost(
112 content::RenderFrameHost* render_frame_host); 112 content::RenderFrameHost* render_frame_host);
113 const Extension* GetExtensionForWebContents( 113 const Extension* GetExtensionForWebContents(
114 const content::WebContents* web_contents); 114 const content::WebContents* web_contents);
115 115
116 // Getter and setter for the lazy background page's keepalive count. This is 116 // Getter and setter for the lazy background page's keepalive count. This is
117 // the count of how many outstanding "things" are keeping the page alive. 117 // the count of how many outstanding "things" are keeping the page alive.
118 // When this reaches 0, we will begin the process of shutting down the page. 118 // When this reaches 0, we will begin the process of shutting down the page.
119 // "Things" include pending events, resource loads, and API calls. 119 // "Things" include pending events, resource loads, and API calls.
120 // Returns -1 if |extension| has a persistent background page.
Devlin 2017/02/14 16:18:24 nit: s/has a persistent background page/doesn't ha
Wez 2017/02/14 17:39:16 Done.
120 int GetLazyKeepaliveCount(const Extension* extension); 121 int GetLazyKeepaliveCount(const Extension* extension);
121 void IncrementLazyKeepaliveCount(const Extension* extension); 122 void IncrementLazyKeepaliveCount(const Extension* extension);
122 void DecrementLazyKeepaliveCount(const Extension* extension); 123 void DecrementLazyKeepaliveCount(const Extension* extension);
123 124
124 // Keeps a background page alive. Unlike IncrementLazyKeepaliveCount, these 125 // Keeps a background page alive. Unlike IncrementLazyKeepaliveCount, these
125 // impulses will only keep the page alive for a limited amount of time unless 126 // impulses will only keep the page alive for a limited amount of time unless
126 // called regularly. 127 // called regularly.
127 void KeepaliveImpulse(const Extension* extension); 128 void KeepaliveImpulse(const Extension* extension);
128 129
129 // Triggers a keepalive impulse for a plugin (e.g NaCl). 130 // Triggers a keepalive impulse for a plugin (e.g NaCl).
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 338
338 // Must be last member, see doc on WeakPtrFactory. 339 // Must be last member, see doc on WeakPtrFactory.
339 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_; 340 base::WeakPtrFactory<ProcessManager> weak_ptr_factory_;
340 341
341 DISALLOW_COPY_AND_ASSIGN(ProcessManager); 342 DISALLOW_COPY_AND_ASSIGN(ProcessManager);
342 }; 343 };
343 344
344 } // namespace extensions 345 } // namespace extensions
345 346
346 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_ 347 #endif // EXTENSIONS_BROWSER_PROCESS_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698