OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "mojo/public/cpp/application/interface_factory.h" | 5 #include "mojo/public/cpp/application/interface_factory.h" |
6 #include "mojo/public/cpp/bindings/strong_binding.h" | 6 #include "mojo/public/cpp/bindings/strong_binding.h" |
7 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | 7 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
8 | 8 |
9 namespace mojo { | 9 namespace mojo { |
10 | 10 |
11 class NetworkServiceImpl : public NetworkService { | 11 class NetworkServiceImpl : public NetworkService { |
12 public: | 12 public: |
13 explicit NetworkServiceImpl(InterfaceRequest<NetworkService> request) | 13 explicit NetworkServiceImpl(InterfaceRequest<NetworkService> request); |
14 : binding_(this, request.Pass()) {} | 14 ~NetworkServiceImpl() override; |
15 | 15 |
16 void CreateURLLoader(InterfaceRequest<URLLoader> loader) override; | 16 void CreateURLLoader(InterfaceRequest<URLLoader> loader) override; |
17 void GetCookieStore(InterfaceRequest<CookieStore> cookie_store) override; | 17 void GetCookieStore(InterfaceRequest<CookieStore> cookie_store) override; |
18 void CreateWebSocket(InterfaceRequest<WebSocket> socket) override; | 18 void CreateWebSocket(InterfaceRequest<WebSocket> socket) override; |
19 void CreateTCPBoundSocket( | 19 void CreateTCPBoundSocket( |
20 NetAddressPtr local_address, | 20 NetAddressPtr local_address, |
21 InterfaceRequest<TCPBoundSocket> bound_socket, | 21 InterfaceRequest<TCPBoundSocket> bound_socket, |
22 const CreateTCPBoundSocketCallback& callback) override; | 22 const CreateTCPBoundSocketCallback& callback) override; |
23 void CreateTCPConnectedSocket( | 23 void CreateTCPConnectedSocket( |
24 NetAddressPtr remote_address, | 24 NetAddressPtr remote_address, |
25 ScopedDataPipeConsumerHandle send_stream, | 25 ScopedDataPipeConsumerHandle send_stream, |
26 ScopedDataPipeProducerHandle receive_stream, | 26 ScopedDataPipeProducerHandle receive_stream, |
27 InterfaceRequest<TCPConnectedSocket> client_socket, | 27 InterfaceRequest<TCPConnectedSocket> client_socket, |
28 const CreateTCPConnectedSocketCallback& callback) override; | 28 const CreateTCPConnectedSocketCallback& callback) override; |
29 void CreateUDPSocket(InterfaceRequest<UDPSocket> socket) override; | 29 void CreateUDPSocket(InterfaceRequest<UDPSocket> socket) override; |
30 void CreateHttpServer(NetAddressPtr local_address, | 30 void CreateHttpServer(NetAddressPtr local_address, |
31 HttpServerDelegatePtr delegate, | 31 HttpServerDelegatePtr delegate, |
32 const CreateHttpServerCallback& callback) override; | 32 const CreateHttpServerCallback& callback) override; |
33 void RegisterURLLoaderInterceptor( | 33 void RegisterURLLoaderInterceptor( |
34 URLLoaderInterceptorFactoryPtr factory) override; | 34 URLLoaderInterceptorFactoryPtr factory) override; |
| 35 void CreateHostResolver(InterfaceRequest<HostResolver> host_resolver) override
; |
35 | 36 |
36 private: | 37 private: |
37 StrongBinding<NetworkService> binding_; | 38 StrongBinding<NetworkService> binding_; |
38 }; | 39 }; |
39 | 40 |
40 class NetworkServiceFactory : public InterfaceFactory<NetworkService> { | 41 class NetworkServiceFactory : public InterfaceFactory<NetworkService> { |
41 public: | 42 public: |
42 void Create(ApplicationConnection* connection, | 43 void Create(ApplicationConnection* connection, |
43 InterfaceRequest<NetworkService> request) override; | 44 InterfaceRequest<NetworkService> request) override; |
44 }; | 45 }; |
45 | 46 |
46 } // namespace mojo | 47 } // namespace mojo |
OLD | NEW |