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

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

Issue 10272019: Add an arbitrary delay before unloading lazy background pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9e9df0803813a0930e64a16f353bb23fa366ff48..a43e552cb7a039ef602aaff50fedc0c4405cb3a0 100644
--- a/chrome/browser/extensions/extension_process_manager.h
+++ b/chrome/browser/extensions/extension_process_manager.h
@@ -12,6 +12,8 @@
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+#include "base/time.h"
#include "content/public/common/view_type.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -182,8 +184,10 @@ class ExtensionProcessManager : public content::NotificationObserver {
// 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);
+ void OnLazyBackgroundPageIdle(const std::string& extension_id,
+ int sequence_id);
void OnLazyBackgroundPageActive(const std::string& extension_id);
+ void CloseLazyBackgroundPageNow(const std::string& extension_id);
// Updates a potentially-registered RenderViewHost once it has been
// associated with a WebContents. This allows us to gather information that
@@ -192,6 +196,16 @@ class ExtensionProcessManager : public content::NotificationObserver {
BackgroundPageDataMap background_page_data_;
+ // The time to delay between an extension becoming idle and
+ // sending a ShouldUnload message; read from command-line switch.
+ base::TimeDelta event_page_idle_time_;
+
+ // The time to delay between sending a ShouldUnload message and
+ // sending a Unload message; read from command-line switch.
+ base::TimeDelta event_page_unloading_time_;
+
+ base::WeakPtrFactory<ExtensionProcessManager> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionProcessManager);
};
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_process_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698