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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
11 #include "base/optional.h" | 11 #include "base/optional.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "content/child/child_thread_impl.h" | 13 #include "content/child/child_thread_impl.h" |
14 #include "content/child/scoped_child_process_reference.h" | 14 #include "content/child/scoped_child_process_reference.h" |
15 #include "content/common/service_worker/embedded_worker.mojom.h" | 15 #include "content/common/service_worker/embedded_worker.mojom.h" |
16 #include "mojo/public/cpp/bindings/binding.h" | 16 #include "mojo/public/cpp/bindings/binding.h" |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class WebEmbeddedWorker; | 20 class WebEmbeddedWorker; |
21 | 21 |
22 } // namespace blink | 22 } // namespace blink |
23 | 23 |
| 24 namespace service_manager { |
| 25 struct BindSourceInfo; |
| 26 } |
| 27 |
24 namespace content { | 28 namespace content { |
25 | 29 |
26 class EmbeddedWorkerDevToolsAgent; | 30 class EmbeddedWorkerDevToolsAgent; |
27 class ServiceWorkerContextClient; | 31 class ServiceWorkerContextClient; |
28 | 32 |
29 // This class exposes interfaces of WebEmbeddedWorker to the browser process. | 33 // This class exposes interfaces of WebEmbeddedWorker to the browser process. |
30 // Unless otherwise noted, all methods should be called on the main thread. | 34 // Unless otherwise noted, all methods should be called on the main thread. |
31 class EmbeddedWorkerInstanceClientImpl | 35 class EmbeddedWorkerInstanceClientImpl |
32 : public mojom::EmbeddedWorkerInstanceClient { | 36 : public mojom::EmbeddedWorkerInstanceClient { |
33 public: | 37 public: |
34 static void Create( | 38 static void Create(const service_manager::BindSourceInfo& source_info, |
35 mojo::InterfaceRequest<mojom::EmbeddedWorkerInstanceClient> request); | 39 mojom::EmbeddedWorkerInstanceClientRequest request); |
36 | 40 |
37 ~EmbeddedWorkerInstanceClientImpl() override; | 41 ~EmbeddedWorkerInstanceClientImpl() override; |
38 | 42 |
39 // Called from ServiceWorkerContextClient. | 43 // Called from ServiceWorkerContextClient. |
40 void WorkerContextDestroyed(); | 44 void WorkerContextDestroyed(); |
41 EmbeddedWorkerDevToolsAgent* devtools_agent() { | 45 EmbeddedWorkerDevToolsAgent* devtools_agent() { |
42 return wrapper_->devtools_agent(); | 46 return wrapper_->devtools_agent(); |
43 }; | 47 }; |
44 | 48 |
45 private: | 49 private: |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 std::unique_ptr<WorkerWrapper> wrapper_; | 97 std::unique_ptr<WorkerWrapper> wrapper_; |
94 | 98 |
95 base::Optional<base::TimeTicks> stop_worker_time_; | 99 base::Optional<base::TimeTicks> stop_worker_time_; |
96 | 100 |
97 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceClientImpl); | 101 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstanceClientImpl); |
98 }; | 102 }; |
99 | 103 |
100 } // namespace content | 104 } // namespace content |
101 | 105 |
102 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_
H_ | 106 #endif // CONTENT_RENDERER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_CLIENT_IMPL_
H_ |
OLD | NEW |