Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / mojo / services / network / network_service_impl.h
blobb349cda1656077d1475179514306f5344ae03048
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"
12 #include "url/gurl.h"
14 namespace mojo {
16 class NetworkServiceImpl : public NetworkService {
17 public:
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;
41 private:
42 scoped_ptr<mojo::AppRefCount> app_refcount_;
43 StrongBinding<NetworkService> binding_;
46 } // namespace mojo
48 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_