OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ |
| 6 #define CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" |
| 10 #include "content/common/service_port_service.mojom.h" |
| 11 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
| 12 |
| 13 namespace blink { |
| 14 class WebServiceWorkerContextProxy; |
| 15 } |
| 16 |
| 17 namespace content { |
| 18 |
| 19 class ServicePortDispatcherImpl : public ServicePortDispatcher { |
| 20 public: |
| 21 static void Create(base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, |
| 22 mojo::InterfaceRequest<ServicePortDispatcher> request); |
| 23 |
| 24 ~ServicePortDispatcherImpl() override; |
| 25 |
| 26 private: |
| 27 ServicePortDispatcherImpl( |
| 28 base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy, |
| 29 mojo::InterfaceRequest<ServicePortDispatcher> request); |
| 30 |
| 31 void Connect(const mojo::String& target_url, |
| 32 const mojo::String& origin, |
| 33 int32_t port_id, |
| 34 const ConnectCallback& callback) override; |
| 35 |
| 36 mojo::StrongBinding<ServicePortDispatcher> binding_; |
| 37 base::WeakPtr<blink::WebServiceWorkerContextProxy> proxy_; |
| 38 |
| 39 DISALLOW_COPY_AND_ASSIGN(ServicePortDispatcherImpl); |
| 40 }; |
| 41 |
| 42 } // namespace content |
| 43 |
| 44 #endif // CONTENT_CHILD_NAVIGATOR_CONNECT_SERVICE_PORT_DISPATCHER_IMPL_H_ |
OLD | NEW |