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

Unified Diff: extensions/browser/lazy_background_task_queue.h

Issue 2943583002: [extension SW] Support lazy events from extension service workers. (Closed)
Patch Set: sync @tott Created 3 years, 6 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 | « extensions/browser/extension_message_filter.cc ('k') | extensions/browser/lazy_background_task_queue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/lazy_background_task_queue.h
diff --git a/extensions/browser/lazy_background_task_queue.h b/extensions/browser/lazy_background_task_queue.h
index 2f24e27a7c167ac7c8de1a0ecd37ec254d639f78..8d0bcd25a62ca393468c8194b5b39537ce260eb6 100644
--- a/extensions/browser/lazy_background_task_queue.h
+++ b/extensions/browser/lazy_background_task_queue.h
@@ -18,6 +18,7 @@
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/extension_registry_observer.h"
+#include "extensions/browser/lazy_context_task_queue.h"
#include "extensions/common/extension_id.h"
namespace content {
@@ -28,6 +29,7 @@ namespace extensions {
class Extension;
class ExtensionHost;
class ExtensionRegistry;
+class LazyContextId;
// This class maintains a queue of tasks that should execute when an
// extension's lazy background page is loaded. It is also in charge of loading
@@ -36,6 +38,7 @@ class ExtensionRegistry;
// It is the consumer's responsibility to use this class when appropriate, i.e.
// only with extensions that have not-yet-loaded lazy background pages.
class LazyBackgroundTaskQueue : public KeyedService,
+ public LazyContextTaskQueue,
public content::NotificationObserver,
public ExtensionRegistryObserver {
public:
@@ -53,7 +56,13 @@ class LazyBackgroundTaskQueue : public KeyedService,
// extension has a lazy background page that is being suspended this method
// cancels that suspension.
bool ShouldEnqueueTask(content::BrowserContext* context,
- const Extension* extension);
+ const Extension* extension) override;
+ // TODO(lazyboy): Find a better way to use AddPendingTask instead of this.
+ // Currently AddPendingTask has lots of consumers that depend on
+ // ExtensionHost.
+ void AddPendingTaskToDispatchEvent(
+ LazyContextId* context_id,
+ const LazyContextTaskQueue::PendingTask& task) override;
// Adds a task to the queue for a given extension. If this is the first
// task added for the extension, its lazy background page will be loaded.
« no previous file with comments | « extensions/browser/extension_message_filter.cc ('k') | extensions/browser/lazy_background_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698