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/common/weak_interface_ptr_set.h" | 9 #include "mojo/common/weak_interface_ptr_set.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/interface_impl.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 InterfaceImpl<NetworkService> { | 18 class NetworkServiceImpl : public NetworkService { |
19 public: | 19 public: |
20 NetworkServiceImpl(ApplicationConnection* connection, | 20 NetworkServiceImpl(InterfaceRequest<NetworkService> request, |
| 21 ApplicationConnection* connection, |
21 NetworkContext* context); | 22 NetworkContext* context); |
22 ~NetworkServiceImpl() override; | 23 ~NetworkServiceImpl() override; |
23 | 24 |
24 // NetworkService methods: | 25 // NetworkService methods: |
25 void CreateURLLoader(InterfaceRequest<URLLoader> loader) override; | 26 void CreateURLLoader(InterfaceRequest<URLLoader> loader) override; |
26 void GetCookieStore(InterfaceRequest<CookieStore> store) override; | 27 void GetCookieStore(InterfaceRequest<CookieStore> store) override; |
27 void CreateWebSocket(InterfaceRequest<WebSocket> socket) override; | 28 void CreateWebSocket(InterfaceRequest<WebSocket> socket) override; |
28 void CreateTCPBoundSocket( | 29 void CreateTCPBoundSocket( |
29 NetAddressPtr local_address, | 30 NetAddressPtr local_address, |
30 InterfaceRequest<TCPBoundSocket> bound_socket, | 31 InterfaceRequest<TCPBoundSocket> bound_socket, |
(...skipping 11 matching lines...) Expand all Loading... |
42 void RegisterURLLoaderInterceptor( | 43 void RegisterURLLoaderInterceptor( |
43 URLLoaderInterceptorFactoryPtr factory) override; | 44 URLLoaderInterceptorFactoryPtr factory) override; |
44 void CreateHostResolver( | 45 void CreateHostResolver( |
45 InterfaceRequest<HostResolver> host_resolver) override; | 46 InterfaceRequest<HostResolver> host_resolver) override; |
46 | 47 |
47 private: | 48 private: |
48 NetworkContext* context_; | 49 NetworkContext* context_; |
49 GURL origin_; | 50 GURL origin_; |
50 WeakInterfacePtrSet<URLLoaderInterceptorFactory> | 51 WeakInterfacePtrSet<URLLoaderInterceptorFactory> |
51 url_loader_interceptor_factories_; | 52 url_loader_interceptor_factories_; |
| 53 StrongBinding<NetworkService> binding_; |
52 }; | 54 }; |
53 | 55 |
54 } // namespace mojo | 56 } // namespace mojo |
55 | 57 |
56 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | 58 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ |
OLD | NEW |