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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "mojo/services/network/net_adapters.h" | 9 #include "mojo/services/network/net_adapters.h" |
10 #include "mojo/services/network/net_address_type_converters.h" | 10 #include "mojo/services/network/net_address_type_converters.h" |
11 #include "mojo/services/network/tcp_connected_socket_impl.h" | 11 #include "mojo/services/network/tcp_connected_socket_impl.h" |
12 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 | 15 |
16 TCPServerSocketImpl::TCPServerSocketImpl( | 16 TCPServerSocketImpl::TCPServerSocketImpl( |
17 scoped_ptr<net::TCPSocket> socket, | 17 scoped_ptr<net::TCPSocket> socket, |
18 scoped_ptr<mojo::AppRefCount> app_refcount, | 18 scoped_ptr<mojo::MessageLoopRef> app_refcount, |
19 InterfaceRequest<TCPServerSocket> request) | 19 InterfaceRequest<TCPServerSocket> request) |
20 : socket_(std::move(socket)), | 20 : socket_(std::move(socket)), |
21 app_refcount_(std::move(app_refcount)), | 21 app_refcount_(std::move(app_refcount)), |
22 binding_(this, std::move(request)) {} | 22 binding_(this, std::move(request)) {} |
23 | 23 |
24 TCPServerSocketImpl::~TCPServerSocketImpl() { | 24 TCPServerSocketImpl::~TCPServerSocketImpl() { |
25 } | 25 } |
26 | 26 |
27 void TCPServerSocketImpl::Accept( | 27 void TCPServerSocketImpl::Accept( |
28 ScopedDataPipeConsumerHandle send_stream, | 28 ScopedDataPipeConsumerHandle send_stream, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 std::move(pending_receive_stream_), std::move(pending_client_socket_), | 66 std::move(pending_receive_stream_), std::move(pending_client_socket_), |
67 app_refcount_->Clone()); | 67 app_refcount_->Clone()); |
68 pending_callback_.Run(MakeNetworkError(net::OK), | 68 pending_callback_.Run(MakeNetworkError(net::OK), |
69 NetAddress::From(accepted_address_)); | 69 NetAddress::From(accepted_address_)); |
70 } | 70 } |
71 | 71 |
72 pending_callback_ = AcceptCallback(); | 72 pending_callback_ = AcceptCallback(); |
73 } | 73 } |
74 | 74 |
75 } // namespace mojo | 75 } // namespace mojo |
OLD | NEW |