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

Unified Diff: extensions/browser/lazy_background_task_queue.h

Issue 1129063011: Extract LazyBackgroundTaskQueue from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased from master Created 5 years, 7 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/lazy_background_task_queue.h
diff --git a/extensions/browser/lazy_background_task_queue.h b/extensions/browser/lazy_background_task_queue.h
index 96b3c891790838dc214a982c07f7d190ff948245..52cbd91f85994ee8b09e0fbe9311e65e55d6e3ee 100644
--- a/extensions/browser/lazy_background_task_queue.h
+++ b/extensions/browser/lazy_background_task_queue.h
@@ -13,6 +13,7 @@
#include "base/gtest_prod_util.h"
#include "base/memory/linked_ptr.h"
#include "base/scoped_observer.h"
+#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/extension_registry_observer.h"
@@ -32,7 +33,8 @@ 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 content::NotificationObserver,
+class LazyBackgroundTaskQueue : public KeyedService,
+ public content::NotificationObserver,
public ExtensionRegistryObserver {
public:
typedef base::Callback<void(ExtensionHost*)> PendingTask;
@@ -40,6 +42,10 @@ class LazyBackgroundTaskQueue : public content::NotificationObserver,
explicit LazyBackgroundTaskQueue(content::BrowserContext* browser_context);
~LazyBackgroundTaskQueue() override;
+ // Convenience method to return the LazyBackgroundTaskQueue for a given
+ // |context|.
+ static LazyBackgroundTaskQueue* Get(content::BrowserContext* context);
+
// Returns the number of extensions having pending tasks.
size_t extensions_with_pending_tasks() { return pending_tasks_.size(); }
« no previous file with comments | « extensions/browser/guest_view/app_view/app_view_guest.cc ('k') | extensions/browser/lazy_background_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698