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

Unified Diff: extensions/browser/process_manager.h

Issue 1096313003: Create interface "EventPageTracker" for checking an extension's (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review feedback. Created 5 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
Index: extensions/browser/process_manager.h
diff --git a/extensions/browser/process_manager.h b/extensions/browser/process_manager.h
index de23f1ec0dcf36aaa3aeca6a9d08702d7c476a3f..afabd2e7a380d1cdf33407c0d6e32ef0f6a801f3 100644
--- a/extensions/browser/process_manager.h
+++ b/extensions/browser/process_manager.h
@@ -17,6 +17,7 @@
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/event_page_tracker.h"
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/common/extension.h"
#include "extensions/common/view_type.h"
@@ -43,7 +44,8 @@ class ProcessManagerObserver;
// track of split-mode extensions only.
class ProcessManager : public KeyedService,
public content::NotificationObserver,
- public ExtensionRegistryObserver {
+ public ExtensionRegistryObserver,
+ public EventPageTracker {
public:
using ExtensionHostSet = std::set<extensions::ExtensionHost*>;
@@ -83,10 +85,6 @@ class ProcessManager : public KeyedService,
// loaded.
void MaybeCreateStartupBackgroundHosts();
- // Gets the ExtensionHost for the background page for an extension, or null if
- // the extension isn't running or doesn't have a background page.
- ExtensionHost* GetBackgroundHostForExtension(const std::string& extension_id);
-
// Returns true if the (lazy) background host for the given extension has
// already been sent the unload event and is shutting down.
bool IsBackgroundHostClosing(const std::string& extension_id);
@@ -145,6 +143,12 @@ class ProcessManager : public KeyedService,
void SetKeepaliveImpulseDecrementCallbackForTesting(
const ImpulseCallbackForTesting& callback);
+ // EventPageTracker implementation.
+ ExtensionHost* GetBackgroundHostForExtension(
+ const std::string& extension_id) override;
+ bool WakeExtension(const std::string& extension_id,
+ const base::Callback<void(bool)>& callback) override;
+
// Sets the time in milliseconds that an extension event page can
// be idle before it is shut down; must be > 0.
static void SetEventPageIdleTimeForTesting(unsigned idle_time_msec);

Powered by Google App Engine
This is Rietveld 408576698