Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: mojo/services/network/tcp_bound_socket_impl.h

Issue 634713002: Implement parts of the Mojo TCP interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing file in gyp Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_TCP_BOUND_SOCKET_H_
6 #define MOJO_SERVICES_NETWORK_TCP_BOUND_SOCKET_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "mojo/public/cpp/bindings/interface_impl.h"
10 #include "mojo/services/public/interfaces/network/tcp_bound_socket.mojom.h"
11 #include "net/socket/tcp_socket.h"
12
13 namespace mojo {
14
15 class TCPBoundSocketImpl : public InterfaceImpl<TCPBoundSocket> {
16 public:
17 TCPBoundSocketImpl();
18 virtual ~TCPBoundSocketImpl();
19
20 int Bind(NetAddressPtr local_address);
21
22 // Returns the local address associated with this socket. This should only
23 // be called after Bind has succeeded.
24 NetAddressPtr GetLocalAddress() const;
25
26 // TCPBoundSocket.
27 virtual void StartListening(
28 InterfaceRequest<TCPServerSocket> server,
29 const Callback<void(NetworkErrorPtr)>& callback) override;
30 virtual void Connect(
31 NetAddressPtr remote_address,
32 ScopedDataPipeConsumerHandle send_stream,
33 ScopedDataPipeProducerHandle receive_stream,
34 InterfaceRequest<TCPConnectedSocket> client_socket,
35 const Callback<void(NetworkErrorPtr)>& callback) override;
36
37 private:
38 scoped_ptr<net::TCPSocket> socket_;
39 };
40
41 } // namespace mojo
42
43 #endif // MOJO_SERVICES_NETWORK_TCP_BOUND_SOCKET_H_
OLDNEW
« no previous file with comments | « mojo/services/network/network_service_impl.cc ('k') | mojo/services/network/tcp_bound_socket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698