| Index: extensions/browser/service_worker_task_queue.h
|
| diff --git a/extensions/browser/service_worker_task_queue.h b/extensions/browser/service_worker_task_queue.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..07ffe18134a6f33b49cdc5d99e51745562a7a1e4
|
| --- /dev/null
|
| +++ b/extensions/browser/service_worker_task_queue.h
|
| @@ -0,0 +1,46 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
|
| +#define EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
|
| +
|
| +#include "components/keyed_service/core/keyed_service.h"
|
| +#include "extensions/browser/lazy_context_task_queue.h"
|
| +#include "extensions/common/extension_id.h"
|
| +#include "url/gurl.h"
|
| +
|
| +namespace content {
|
| +class BrowserContext;
|
| +}
|
| +
|
| +namespace extensions {
|
| +class Extension;
|
| +class LazyContextId;
|
| +
|
| +// TODO(lazyboy): This class doesn't queue up any tasks, implement. See
|
| +// LazyBackgroundTaskQueue.
|
| +// TODO(lazyboy): Clean up queue when extension is unloaded/uninstalled.
|
| +class ServiceWorkerTaskQueue : public KeyedService,
|
| + public LazyContextTaskQueue {
|
| + public:
|
| + explicit ServiceWorkerTaskQueue(content::BrowserContext* browser_context);
|
| + ~ServiceWorkerTaskQueue() override;
|
| +
|
| + // Convenience method to return the ServiceWorkerTaskQueue for a given
|
| + // |context|.
|
| + static ServiceWorkerTaskQueue* Get(content::BrowserContext* context);
|
| +
|
| + bool ShouldEnqueueTask(content::BrowserContext* context,
|
| + const Extension* extension) override;
|
| + void AddPendingTaskToDispatchEvent(
|
| + LazyContextId* context_id,
|
| + const LazyContextTaskQueue::PendingTask& task) override;
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ServiceWorkerTaskQueue);
|
| +};
|
| +
|
| +} // namespace extensions
|
| +
|
| +#endif // EXTENSIONS_BROWSER_SERVICE_WORKER_TASK_QUEUE_H_
|
|
|