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 21 matching lines...) Expand all Loading... |
32 private: | 32 private: |
33 EmbeddedWorkerInstanceClientImpl( | 33 EmbeddedWorkerInstanceClientImpl( |
34 EmbeddedWorkerDispatcher* dispatcher, | 34 EmbeddedWorkerDispatcher* dispatcher, |
35 mojo::InterfaceRequest<mojom::EmbeddedWorkerInstanceClient> request); | 35 mojo::InterfaceRequest<mojom::EmbeddedWorkerInstanceClient> request); |
36 | 36 |
37 // mojom::EmbeddedWorkerInstanceClient implementation | 37 // mojom::EmbeddedWorkerInstanceClient implementation |
38 void StartWorker( | 38 void StartWorker( |
39 const EmbeddedWorkerStartParams& params, | 39 const EmbeddedWorkerStartParams& params, |
40 mojom::ServiceWorkerEventDispatcherRequest dispatcher_request) override; | 40 mojom::ServiceWorkerEventDispatcherRequest dispatcher_request) override; |
41 void StopWorker(const StopWorkerCallback& callback) override; | 41 void StopWorker(const StopWorkerCallback& callback) override; |
| 42 void ResumeAfterDownload() override; |
| 43 void AddMessageToConsole(blink::WebConsoleMessage::Level level, |
| 44 const std::string& message) override; |
42 | 45 |
43 // Handler of connection error bound to |binding_| | 46 // Handler of connection error bound to |binding_| |
44 void OnError(); | 47 void OnError(); |
45 | 48 |
46 EmbeddedWorkerDispatcher* dispatcher_; | 49 EmbeddedWorkerDispatcher* dispatcher_; |
47 mojo::Binding<mojom::EmbeddedWorkerInstanceClient> binding_; | 50 mojo::Binding<mojom::EmbeddedWorkerInstanceClient> binding_; |
48 | 51 |
49 // This is valid before StartWorker is called. After that, this object | 52 // This is valid before StartWorker is called. After that, this object |
50 // will be passed to ServiceWorkerContextClient. | 53 // will be passed to ServiceWorkerContextClient. |
51 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> temporal_self_; | 54 std::unique_ptr<EmbeddedWorkerInstanceClientImpl> temporal_self_; |
52 | 55 |
53 base::Optional<int> embedded_worker_id_; | 56 base::Optional<int> embedded_worker_id_; |
54 | 57 |
55 // Owned by EmbeddedWorkerDispatcher. This can be nullptr while a worker is | 58 // Owned by EmbeddedWorkerDispatcher. This can be nullptr while a worker is |
56 // not running. | 59 // not running. |
57 EmbeddedWorkerDispatcher::WorkerWrapper* wrapper_; | 60 EmbeddedWorkerDispatcher::WorkerWrapper* wrapper_; |
58 | 61 |
59 StopWorkerCallback stop_callback_; | 62 StopWorkerCallback stop_callback_; |
60 | 63 |
61 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceClientImpl); | 64 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceClientImpl); |
62 }; | 65 }; |
63 | 66 |
64 } // namespace content | 67 } // namespace content |
65 | 68 |
66 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_
H_ | 69 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_
H_ |
OLD | NEW |