OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/services/network/tcp_server_socket_impl.h" | 5 #include "mojo/services/network/tcp_server_socket_impl.h" |
6 | 6 |
7 #include "mojo/services/network/net_adapters.h" | 7 #include "mojo/services/network/net_adapters.h" |
8 #include "mojo/services/network/net_address_type_converters.h" | 8 #include "mojo/services/network/net_address_type_converters.h" |
9 #include "mojo/services/network/tcp_connected_socket_impl.h" | 9 #include "mojo/services/network/tcp_connected_socket_impl.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 | 13 |
14 TCPServerSocketImpl::TCPServerSocketImpl(scoped_ptr<net::TCPSocket> socket) | 14 TCPServerSocketImpl::TCPServerSocketImpl( |
15 : socket_(socket.Pass()) { | 15 InterfaceRequest<TCPServerSocket> request, |
| 16 scoped_ptr<net::TCPSocket> socket) |
| 17 : binding_(this, request.Pass()), socket_(socket.Pass()) { |
16 } | 18 } |
17 | 19 |
18 TCPServerSocketImpl::~TCPServerSocketImpl() { | 20 TCPServerSocketImpl::~TCPServerSocketImpl() { |
19 } | 21 } |
20 | 22 |
21 void TCPServerSocketImpl::Accept( | 23 void TCPServerSocketImpl::Accept( |
22 ScopedDataPipeConsumerHandle send_stream, | 24 ScopedDataPipeConsumerHandle send_stream, |
23 ScopedDataPipeProducerHandle receive_stream, | 25 ScopedDataPipeProducerHandle receive_stream, |
24 InterfaceRequest<TCPConnectedSocket> client_socket, | 26 InterfaceRequest<TCPConnectedSocket> client_socket, |
25 const AcceptCallback& callback) { | 27 const AcceptCallback& callback) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 accepted_socket_.Pass(), pending_send_stream_.Pass(), | 61 accepted_socket_.Pass(), pending_send_stream_.Pass(), |
60 pending_receive_stream_.Pass(), pending_client_socket_.Pass()); | 62 pending_receive_stream_.Pass(), pending_client_socket_.Pass()); |
61 pending_callback_.Run(MakeNetworkError(net::OK), | 63 pending_callback_.Run(MakeNetworkError(net::OK), |
62 NetAddress::From(accepted_address_)); | 64 NetAddress::From(accepted_address_)); |
63 } | 65 } |
64 | 66 |
65 pending_callback_ = AcceptCallback(); | 67 pending_callback_ = AcceptCallback(); |
66 } | 68 } |
67 | 69 |
68 } // namespace mojo | 70 } // namespace mojo |
OLD | NEW |