| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_H_ |
| 6 #define CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_H_ | 6 #define CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "content/child/child_thread_impl.h" | 10 #include "content/child/child_thread_impl.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 EmbeddedWorkerInstanceClientImpl( | 36 EmbeddedWorkerInstanceClientImpl( |
| 37 EmbeddedWorkerDispatcher* dispatcher, | 37 EmbeddedWorkerDispatcher* dispatcher, |
| 38 mojo::InterfaceRequest<mojom::EmbeddedWorkerInstanceClient> request); | 38 mojo::InterfaceRequest<mojom::EmbeddedWorkerInstanceClient> request); |
| 39 | 39 |
| 40 // mojom::EmbeddedWorkerInstanceClient implementation | 40 // mojom::EmbeddedWorkerInstanceClient implementation |
| 41 void StartWorker( | 41 void StartWorker( |
| 42 const EmbeddedWorkerStartParams& params, | 42 const EmbeddedWorkerStartParams& params, |
| 43 mojom::ServiceWorkerEventDispatcherRequest dispatcher_request) override; | 43 mojom::ServiceWorkerEventDispatcherRequest dispatcher_request, |
| 44 mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo instance_host) |
| 45 override; |
| 44 void StopWorker(const StopWorkerCallback& callback) override; | 46 void StopWorker(const StopWorkerCallback& callback) override; |
| 45 void ResumeAfterDownload() override; | 47 void ResumeAfterDownload() override; |
| 46 void AddMessageToConsole(blink::WebConsoleMessage::Level level, | 48 void AddMessageToConsole(blink::WebConsoleMessage::Level level, |
| 47 const std::string& message) override; | 49 const std::string& message) override; |
| 48 | 50 |
| 49 // Handler of connection error bound to |binding_| | 51 // Handler of connection error bound to |binding_| |
| 50 void OnError(); | 52 void OnError(); |
| 51 | 53 |
| 52 EmbeddedWorkerDispatcher* dispatcher_; | 54 EmbeddedWorkerDispatcher* dispatcher_; |
| 53 mojo::Binding<mojom::EmbeddedWorkerInstanceClient> binding_; | 55 mojo::Binding<mojom::EmbeddedWorkerInstanceClient> binding_; |
| 54 | 56 |
| 55 // This is valid before StartWorker is called. After that, this object | 57 // This is valid before StartWorker is called. After that, this object |
| 56 // will be passed to ServiceWorkerContextClient. | 58 // will be passed to ServiceWorkerContextClient. |
| 57 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> temporal_self_; | 59 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> temporal_self_; |
| 58 | 60 |
| 59 base::Optional<int> embedded_worker_id_; | 61 base::Optional<int> embedded_worker_id_; |
| 60 | 62 |
| 61 // Owned by EmbeddedWorkerDispatcher. This can be nullptr while a worker is | 63 // Owned by EmbeddedWorkerDispatcher. This can be nullptr while a worker is |
| 62 // not running. | 64 // not running. |
| 63 EmbeddedWorkerDispatcher::WorkerWrapper* wrapper_; | 65 EmbeddedWorkerDispatcher::WorkerWrapper* wrapper_; |
| 64 | 66 |
| 65 StopWorkerCallback stop_callback_; | 67 StopWorkerCallback stop_callback_; |
| 66 | 68 |
| 67 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceClientImpl); | 69 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceClientImpl); |
| 68 }; | 70 }; |
| 69 | 71 |
| 70 } // namespace content | 72 } // namespace content |
| 71 | 73 |
| 72 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_
H_ | 74 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_
H_ |
| OLD | NEW |