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

Unified Diff: chrome/browser/extensions/extension_process_manager.h

Issue 10804020: Introduce runtime.onSuspendCanceled() event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_process_manager.h
diff --git a/chrome/browser/extensions/extension_process_manager.h b/chrome/browser/extensions/extension_process_manager.h
index eea12952a7f17e03f172bddf37a65fbe880fdebb..68609e3cc9f7a569ca4cf83f4d1c12a7940521e1 100644
--- a/chrome/browser/extensions/extension_process_manager.h
+++ b/chrome/browser/extensions/extension_process_manager.h
@@ -113,8 +113,12 @@ class ExtensionProcessManager : public content::NotificationObserver {
// the count of how many outstanding "things" are keeping the page alive.
// When this reaches 0, we will begin the process of shutting down the page.
// "Things" include pending events, resource loads, and API calls.
+ // The |cancel_suspend| option defaults to false and indicates whether
+ // incrementing the keepalive count should prevent it from being suspended.
int GetLazyKeepaliveCount(const extensions::Extension* extension);
int IncrementLazyKeepaliveCount(const extensions::Extension* extension);
+ int IncrementLazyKeepaliveCount(const extensions::Extension* extension,
+ bool cancel_suspend);
int DecrementLazyKeepaliveCount(const extensions::Extension* extension);
void IncrementLazyKeepaliveCountForView(
@@ -132,6 +136,9 @@ class ExtensionProcessManager : public content::NotificationObserver {
void OnNetworkRequestStarted(content::RenderViewHost* render_view_host);
void OnNetworkRequestDone(content::RenderViewHost* render_view_host);
+ // Prevent the specified extension from being suspended.
+ void CancelSuspend(const std::string& extension_id);
+
protected:
explicit ExtensionProcessManager(Profile* profile);
@@ -185,7 +192,9 @@ class ExtensionProcessManager : public content::NotificationObserver {
void OnLazyBackgroundPageIdle(const std::string& extension_id,
int sequence_id);
void OnLazyBackgroundPageActive(const std::string& extension_id);
- void CloseLazyBackgroundPageNow(const std::string& extension_id);
+ void MaybePostOnLazyBackgroundPageIdle(const std::string& extension_id);
+ void CloseLazyBackgroundPageNow(const std::string& extension_id,
+ int sequence_id);
// Updates a potentially-registered RenderViewHost once it has been
// associated with a WebContents. This allows us to gather information that

Powered by Google App Engine
This is Rietveld 408576698