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

Side by Side Diff: extensions/browser/service_worker_task_queue.h

Issue 2943583002: [extension SW] Support lazy events from extension service workers. (Closed)
Patch Set: sync @tott Created 3 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
6 #define EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
7
8 #include "components/keyed_service/core/keyed_service.h"
9 #include "extensions/browser/lazy_context_task_queue.h"
10 #include "extensions/common/extension_id.h"
11 #include "url/gurl.h"
12
13 namespace content {
14 class BrowserContext;
15 }
16
17 namespace extensions {
18 class Extension;
19 class LazyContextId;
20
21 // TODO(lazyboy): This class doesn't queue up any tasks, implement. See
22 // LazyBackgroundTaskQueue.
23 // TODO(lazyboy): Clean up queue when extension is unloaded/uninstalled.
24 class ServiceWorkerTaskQueue : public KeyedService,
25 public LazyContextTaskQueue {
26 public:
27 explicit ServiceWorkerTaskQueue(content::BrowserContext* browser_context);
28 ~ServiceWorkerTaskQueue() override;
29
30 // Convenience method to return the ServiceWorkerTaskQueue for a given
31 // |context|.
32 static ServiceWorkerTaskQueue* Get(content::BrowserContext* context);
33
34 bool ShouldEnqueueTask(content::BrowserContext* context,
35 const Extension* extension) override;
36 void AddPendingTaskToDispatchEvent(
37 LazyContextId* context_id,
38 const LazyContextTaskQueue::PendingTask& task) override;
39
40 private:
41 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerTaskQueue);
42 };
43
44 } // namespace extensions
45
46 #endif // EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
OLDNEW
« no previous file with comments | « extensions/browser/lazy_context_task_queue.h ('k') | extensions/browser/service_worker_task_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698