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

Unified Diff: extensions/browser/lazy_context_id.cc

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/lazy_context_id.h ('k') | extensions/browser/lazy_context_task_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/lazy_context_id.cc
diff --git a/extensions/browser/lazy_context_id.cc b/extensions/browser/lazy_context_id.cc
index 80a4dcfacfeaa71db2283cdb2ff1d8cd8df4e5e4..d8c9fe16c55e8fe588ff794160d64a30615809a4 100644
--- a/extensions/browser/lazy_context_id.cc
+++ b/extensions/browser/lazy_context_id.cc
@@ -5,6 +5,7 @@
#include "extensions/browser/lazy_context_id.h"
#include "extensions/browser/lazy_background_task_queue.h"
+#include "extensions/browser/service_worker_task_queue.h"
namespace extensions {
@@ -12,9 +13,19 @@ LazyContextId::LazyContextId(content::BrowserContext* context,
const ExtensionId& extension_id)
: type_(Type::kEventPage), context_(context), extension_id_(extension_id) {}
-LazyBackgroundTaskQueue* LazyContextId::GetTaskQueue() {
- DCHECK(is_for_event_page());
- return LazyBackgroundTaskQueue::Get(context_);
+LazyContextId::LazyContextId(content::BrowserContext* context,
+ const ExtensionId& extension_id,
+ const GURL& service_worker_scope)
+ : type_(Type::kServiceWorker),
+ context_(context),
+ extension_id_(extension_id),
+ service_worker_scope_(service_worker_scope) {}
+
+LazyContextTaskQueue* LazyContextId::GetTaskQueue() {
+ if (is_for_event_page())
+ return LazyBackgroundTaskQueue::Get(context_);
+ DCHECK(is_for_service_worker());
+ return ServiceWorkerTaskQueue::Get(context_);
}
} // namespace extensions
« no previous file with comments | « extensions/browser/lazy_context_id.h ('k') | extensions/browser/lazy_context_task_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698