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_bound_socket_impl.h" | 5 #include "mojo/services/network/tcp_bound_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 "mojo/services/network/tcp_server_socket_impl.h" | 12 #include "mojo/services/network/tcp_server_socket_impl.h" |
13 #include "net/base/net_errors.h" | 13 #include "net/base/net_errors.h" |
14 | 14 |
15 namespace mojo { | 15 namespace mojo { |
16 | 16 |
17 TCPBoundSocketImpl::TCPBoundSocketImpl( | 17 TCPBoundSocketImpl::TCPBoundSocketImpl( |
18 scoped_ptr<mojo::AppRefCount> app_refcount, | 18 scoped_ptr<mojo::MessageLoopRef> app_refcount, |
19 InterfaceRequest<TCPBoundSocket> request) | 19 InterfaceRequest<TCPBoundSocket> request) |
20 : app_refcount_(std::move(app_refcount)), | 20 : app_refcount_(std::move(app_refcount)), |
21 binding_(this, std::move(request)) {} | 21 binding_(this, std::move(request)) {} |
22 | 22 |
23 TCPBoundSocketImpl::~TCPBoundSocketImpl() { | 23 TCPBoundSocketImpl::~TCPBoundSocketImpl() { |
24 } | 24 } |
25 | 25 |
26 int TCPBoundSocketImpl::Bind(NetAddressPtr local_address) { | 26 int TCPBoundSocketImpl::Bind(NetAddressPtr local_address) { |
27 net::IPEndPoint end_point = local_address.To<net::IPEndPoint>(); | 27 net::IPEndPoint end_point = local_address.To<net::IPEndPoint>(); |
28 | 28 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } else { | 117 } else { |
118 pending_connect_send_stream_.reset(); | 118 pending_connect_send_stream_.reset(); |
119 pending_connect_receive_stream_.reset(); | 119 pending_connect_receive_stream_.reset(); |
120 pending_connect_socket_ = InterfaceRequest<TCPConnectedSocket>(); | 120 pending_connect_socket_ = InterfaceRequest<TCPConnectedSocket>(); |
121 } | 121 } |
122 pending_connect_callback_.Run(MakeNetworkError(result)); | 122 pending_connect_callback_.Run(MakeNetworkError(result)); |
123 pending_connect_callback_ = Callback<void(NetworkErrorPtr)>(); | 123 pending_connect_callback_ = Callback<void(NetworkErrorPtr)>(); |
124 } | 124 } |
125 | 125 |
126 } // namespace mojo | 126 } // namespace mojo |
OLD | NEW |