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/application/public/cpp/app_lifetime_helper.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"
16 class NetworkServiceImpl
: public NetworkService
{
18 NetworkServiceImpl(scoped_ptr
<mojo::AppRefCount
> app_refcount
,
19 InterfaceRequest
<NetworkService
> request
);
20 ~NetworkServiceImpl() override
;
22 // NetworkService methods:
23 void CreateTCPBoundSocket(
24 NetAddressPtr local_address
,
25 InterfaceRequest
<TCPBoundSocket
> bound_socket
,
26 const CreateTCPBoundSocketCallback
& callback
) override
;
27 void CreateTCPConnectedSocket(
28 NetAddressPtr remote_address
,
29 ScopedDataPipeConsumerHandle send_stream
,
30 ScopedDataPipeProducerHandle receive_stream
,
31 InterfaceRequest
<TCPConnectedSocket
> client_socket
,
32 const CreateTCPConnectedSocketCallback
& callback
) override
;
33 void CreateUDPSocket(InterfaceRequest
<UDPSocket
> socket
) override
;
34 void CreateHttpServer(NetAddressPtr local_address
,
35 HttpServerDelegatePtr delegate
,
36 const CreateHttpServerCallback
& callback
) override
;
37 void GetMimeTypeFromFile(
38 const mojo::String
& file_path
,
39 const GetMimeTypeFromFileCallback
& callback
) override
;
42 scoped_ptr
<mojo::AppRefCount
> app_refcount_
;
43 StrongBinding
<NetworkService
> binding_
;
48 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_