OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/socket/tcp_server_socket.h" | 5 #include "net/socket/tcp_server_socket.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
11 #include "net/socket/tcp_client_socket.h" | 11 #include "net/socket/tcp_client_socket.h" |
12 | 12 |
13 namespace net { | 13 namespace net { |
14 | 14 |
15 TCPServerSocket::TCPServerSocket(NetLog* net_log, const NetLog::Source& source) | 15 TCPServerSocket::TCPServerSocket(NetLog* net_log, const NetLog::Source& source) |
16 : socket_(net_log, source), | 16 : socket_(/*socket_performance_watcher=*/nullptr, net_log, source), |
17 pending_accept_(false) { | 17 pending_accept_(false) {} |
18 } | |
19 | 18 |
20 TCPServerSocket::~TCPServerSocket() { | 19 TCPServerSocket::~TCPServerSocket() { |
21 } | 20 } |
22 | 21 |
23 int TCPServerSocket::Listen(const IPEndPoint& address, int backlog) { | 22 int TCPServerSocket::Listen(const IPEndPoint& address, int backlog) { |
24 int result = socket_.Open(address.GetFamily()); | 23 int result = socket_.Open(address.GetFamily()); |
25 if (result != OK) | 24 if (result != OK) |
26 return result; | 25 return result; |
27 | 26 |
28 result = socket_.SetDefaultOptionsForServer(); | 27 result = socket_.SetDefaultOptionsForServer(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 void TCPServerSocket::OnAcceptCompleted( | 95 void TCPServerSocket::OnAcceptCompleted( |
97 scoped_ptr<StreamSocket>* output_accepted_socket, | 96 scoped_ptr<StreamSocket>* output_accepted_socket, |
98 const CompletionCallback& forward_callback, | 97 const CompletionCallback& forward_callback, |
99 int result) { | 98 int result) { |
100 result = ConvertAcceptedSocket(result, output_accepted_socket); | 99 result = ConvertAcceptedSocket(result, output_accepted_socket); |
101 pending_accept_ = false; | 100 pending_accept_ = false; |
102 forward_callback.Run(result); | 101 forward_callback.Run(result); |
103 } | 102 } |
104 | 103 |
105 } // namespace net | 104 } // namespace net |
OLD | NEW |