OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | 5 #ifndef MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ |
6 #define MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | 6 #define MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "mojo/application/public/cpp/app_lifetime_helper.h" | 9 #include "mojo/application/public/cpp/app_lifetime_helper.h" |
10 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | 10 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
11 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 11 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 class ApplicationConnection; | 15 class ApplicationConnection; |
16 class NetworkContext; | 16 class NetworkContext; |
17 | 17 |
18 class NetworkServiceImpl : public NetworkService { | 18 class NetworkServiceImpl : public NetworkService { |
19 public: | 19 public: |
20 NetworkServiceImpl(ApplicationConnection* connection, | 20 NetworkServiceImpl(ApplicationConnection* connection, |
21 NetworkContext* context, | 21 NetworkContext* context, |
22 scoped_ptr<mojo::AppRefCount> app_refcount, | 22 scoped_ptr<mojo::AppRefCount> app_refcount, |
23 InterfaceRequest<NetworkService> request); | 23 InterfaceRequest<NetworkService> request); |
24 ~NetworkServiceImpl() override; | 24 ~NetworkServiceImpl() override; |
25 | 25 |
26 // NetworkService methods: | 26 // NetworkService methods: |
27 void CreateURLLoader(InterfaceRequest<URLLoader> loader) override; | |
28 void GetCookieStore(InterfaceRequest<CookieStore> store) override; | 27 void GetCookieStore(InterfaceRequest<CookieStore> store) override; |
29 void CreateWebSocket(InterfaceRequest<WebSocket> socket) override; | 28 void CreateWebSocket(InterfaceRequest<WebSocket> socket) override; |
30 void CreateTCPBoundSocket( | 29 void CreateTCPBoundSocket( |
31 NetAddressPtr local_address, | 30 NetAddressPtr local_address, |
32 InterfaceRequest<TCPBoundSocket> bound_socket, | 31 InterfaceRequest<TCPBoundSocket> bound_socket, |
33 const CreateTCPBoundSocketCallback& callback) override; | 32 const CreateTCPBoundSocketCallback& callback) override; |
34 void CreateTCPConnectedSocket( | 33 void CreateTCPConnectedSocket( |
35 NetAddressPtr remote_address, | 34 NetAddressPtr remote_address, |
36 ScopedDataPipeConsumerHandle send_stream, | 35 ScopedDataPipeConsumerHandle send_stream, |
37 ScopedDataPipeProducerHandle receive_stream, | 36 ScopedDataPipeProducerHandle receive_stream, |
38 InterfaceRequest<TCPConnectedSocket> client_socket, | 37 InterfaceRequest<TCPConnectedSocket> client_socket, |
39 const CreateTCPConnectedSocketCallback& callback) override; | 38 const CreateTCPConnectedSocketCallback& callback) override; |
40 void CreateUDPSocket(InterfaceRequest<UDPSocket> socket) override; | 39 void CreateUDPSocket(InterfaceRequest<UDPSocket> socket) override; |
41 void CreateHttpServer(NetAddressPtr local_address, | 40 void CreateHttpServer(NetAddressPtr local_address, |
42 HttpServerDelegatePtr delegate, | 41 HttpServerDelegatePtr delegate, |
43 const CreateHttpServerCallback& callback) override; | 42 const CreateHttpServerCallback& callback) override; |
44 | 43 |
45 private: | 44 private: |
46 NetworkContext* context_; | 45 NetworkContext* context_; |
47 scoped_ptr<mojo::AppRefCount> app_refcount_; | 46 scoped_ptr<mojo::AppRefCount> app_refcount_; |
48 GURL origin_; | 47 GURL origin_; |
49 StrongBinding<NetworkService> binding_; | 48 StrongBinding<NetworkService> binding_; |
50 }; | 49 }; |
51 | 50 |
52 } // namespace mojo | 51 } // namespace mojo |
53 | 52 |
54 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | 53 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ |
OLD | NEW |