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
3 // found in the LICENSE file.
5 #ifndef MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_
6 #define MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_
8 #include "base/compiler_specific.h"
9 #include "mojo/services/network/public/interfaces/network_service.mojom.h"
10 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_impl.h"
14 class ApplicationConnection
;
17 class NetworkServiceImpl
: public InterfaceImpl
<NetworkService
> {
19 NetworkServiceImpl(ApplicationConnection
* connection
,
20 NetworkContext
* context
);
21 ~NetworkServiceImpl() override
;
23 // NetworkService methods:
24 void CreateURLLoader(InterfaceRequest
<URLLoader
> loader
) override
;
25 void GetCookieStore(InterfaceRequest
<CookieStore
> store
) override
;
26 void CreateWebSocket(InterfaceRequest
<WebSocket
> socket
) override
;
27 void CreateTCPBoundSocket(
28 NetAddressPtr local_address
,
29 InterfaceRequest
<TCPBoundSocket
> bound_socket
,
30 const Callback
<void(NetworkErrorPtr
, NetAddressPtr
)>& callback
) override
;
31 void CreateTCPConnectedSocket(
32 NetAddressPtr remote_address
,
33 ScopedDataPipeConsumerHandle send_stream
,
34 ScopedDataPipeProducerHandle receive_stream
,
35 InterfaceRequest
<TCPConnectedSocket
> client_socket
,
36 const Callback
<void(NetworkErrorPtr
, NetAddressPtr
)>& callback
) override
;
37 void CreateUDPSocket(InterfaceRequest
<UDPSocket
> socket
) override
;
40 NetworkContext
* context_
;
46 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_