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

Unified Diff: extensions/browser/process_manager.h

Issue 60613004: Add KeepaliveImpulse to extension process manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Back to 1sec times for tests. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: extensions/browser/process_manager.h
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h
index 669ebe78557e4bfb6d71e252a367e54179ad2977..9e4b07c392428f2604433b62347dcfb2f7df4b7b 100644
--- a/extensions/browser/process_manager.h
+++ b/extensions/browser/process_manager.h
@@ -92,6 +92,11 @@ class ProcessManager : public content::NotificationObserver {
void IncrementLazyKeepaliveCountForView(
content::RenderViewHost* render_view_host);
+ // Keeps a background page alive. Unlike IncrementLazyKeepaliveCount, these
+ // impulses will only keep the page alive for a limited amount of time unless
+ // called regularly.
+ void KeepaliveImpulse(const Extension* extension);
+
// Handles a response to the ShouldSuspend message, used for lazy background
// pages.
void OnShouldSuspendAck(const std::string& extension_id, int sequence_id);
@@ -164,6 +169,13 @@ class ProcessManager : public content::NotificationObserver {
// Close the given |host| iff it's a background page.
void CloseBackgroundHost(ExtensionHost* host);
+ // Internal implementation of DecrementLazyKeepaliveCount with an
+ // |extension_id| known to have a lazy background page.
+ int DecrementLazyKeepaliveCount(std::string extension_id);
tapted 2013/11/28 03:03:37 nit: const std::string& extension_id - seems more
scheib 2013/12/02 21:22:38 Done.
+
+ // Checks if keepalive impulses have occured, and adjusts keep alive count.
+ void OnKeepaliveImpulseCheck();
+
// These are called when the extension transitions between idle and active.
// They control the process of closing the background page when idle.
void OnLazyBackgroundPageIdle(const std::string& extension_id,

Powered by Google App Engine
This is Rietveld 408576698