OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | |
6 #define MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | |
7 | |
8 #include "base/compiler_specific.h" | |
9 #include "mojo/public/cpp/bindings/strong_binding.h" | |
10 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | |
11 #include "mojo/shell/public/cpp/message_loop_ref.h" | |
12 #include "url/gurl.h" | |
13 | |
14 namespace mojo { | |
15 | |
16 class NetworkServiceImpl : public NetworkService { | |
17 public: | |
18 NetworkServiceImpl(scoped_ptr<mojo::MessageLoopRef> app_refcount, | |
19 InterfaceRequest<NetworkService> request); | |
20 ~NetworkServiceImpl() override; | |
21 | |
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; | |
40 | |
41 private: | |
42 scoped_ptr<mojo::MessageLoopRef> app_refcount_; | |
43 StrongBinding<NetworkService> binding_; | |
44 }; | |
45 | |
46 } // namespace mojo | |
47 | |
48 #endif // MOJO_SERVICES_NETWORK_NETWORK_SERVICE_IMPL_H_ | |
OLD | NEW |