OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_DATA_H_ |
| 6 #define EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ |
| 7 |
| 8 #include <memory> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "extensions/renderer/service_worker_request_sender.h" |
| 12 #include "extensions/renderer/v8_schema_registry.h" |
| 13 |
| 14 namespace extensions { |
| 15 class WorkerThreadDispatcher; |
| 16 |
| 17 // Per ServiceWorker data in worker thread. |
| 18 // Contains: RequestSender, V8SchemaRegistry. |
| 19 // TODO(lazyboy): Also put worker ScriptContexts in this. |
| 20 class ServiceWorkerData { |
| 21 public: |
| 22 ServiceWorkerData(WorkerThreadDispatcher* dispatcher, int embedded_worker_id); |
| 23 ~ServiceWorkerData(); |
| 24 |
| 25 V8SchemaRegistry* v8_schema_registry() { return v8_schema_registry_.get(); } |
| 26 RequestSender* request_sender() { return request_sender_.get(); } |
| 27 int embedded_worker_id() const { return embedded_worker_id_; } |
| 28 |
| 29 private: |
| 30 const int embedded_worker_id_; |
| 31 |
| 32 std::unique_ptr<V8SchemaRegistry> v8_schema_registry_; |
| 33 std::unique_ptr<ServiceWorkerRequestSender> request_sender_; |
| 34 |
| 35 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerData); |
| 36 }; |
| 37 |
| 38 } // namespace extensions |
| 39 |
| 40 #endif // EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ |
OLD | NEW |