| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ | 5 #ifndef EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ |
| 6 #define EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ | 6 #define EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "extensions/renderer/service_worker_request_sender.h" | 11 #include "extensions/renderer/service_worker_request_sender.h" |
| 12 #include "extensions/renderer/v8_schema_registry.h" | 12 #include "extensions/renderer/v8_schema_registry.h" |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 class WorkerThreadDispatcher; | 15 class ExtensionBindingsSystem; |
| 16 | 16 |
| 17 // Per ServiceWorker data in worker thread. | 17 // Per ServiceWorker data in worker thread. |
| 18 // Contains: RequestSender, V8SchemaRegistry. | 18 // Contains: RequestSender, V8SchemaRegistry. |
| 19 // TODO(lazyboy): Also put worker ScriptContexts in this. | 19 // TODO(lazyboy): Also put worker ScriptContexts in this. |
| 20 class ServiceWorkerData { | 20 class ServiceWorkerData { |
| 21 public: | 21 public: |
| 22 ServiceWorkerData(WorkerThreadDispatcher* dispatcher, | 22 ServiceWorkerData(int64_t service_worker_version_id, |
| 23 int64_t service_worker_version_id); | 23 std::unique_ptr<ExtensionBindingsSystem> bindings_system); |
| 24 ~ServiceWorkerData(); | 24 ~ServiceWorkerData(); |
| 25 | 25 |
| 26 V8SchemaRegistry* v8_schema_registry() { return v8_schema_registry_.get(); } | 26 V8SchemaRegistry* v8_schema_registry() { return v8_schema_registry_.get(); } |
| 27 ServiceWorkerRequestSender* request_sender() { return request_sender_.get(); } | 27 ExtensionBindingsSystem* bindings_system() { return bindings_system_.get(); } |
| 28 int64_t service_worker_version_id() const { | 28 int64_t service_worker_version_id() const { |
| 29 return service_worker_version_id_; | 29 return service_worker_version_id_; |
| 30 } | 30 } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 const int64_t service_worker_version_id_; | 33 const int64_t service_worker_version_id_; |
| 34 | 34 |
| 35 std::unique_ptr<V8SchemaRegistry> v8_schema_registry_; | 35 std::unique_ptr<V8SchemaRegistry> v8_schema_registry_; |
| 36 std::unique_ptr<ServiceWorkerRequestSender> request_sender_; | 36 std::unique_ptr<ExtensionBindingsSystem> bindings_system_; |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerData); | 38 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerData); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace extensions | 41 } // namespace extensions |
| 42 | 42 |
| 43 #endif // EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ | 43 #endif // EXTENSIONS_BROWSER_SERVICE_WORKER_DATA_H_ |
| OLD | NEW |