OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_client_socket.h" | 5 #include "net/socket/tcp_client_socket.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 // |socket_| is gone. Therefore, it is safe to use base::Unretained() here. | 262 // |socket_| is gone. Therefore, it is safe to use base::Unretained() here. |
263 CompletionCallback write_callback = base::Bind( | 263 CompletionCallback write_callback = base::Bind( |
264 &TCPClientSocket::DidCompleteReadWrite, base::Unretained(this), callback); | 264 &TCPClientSocket::DidCompleteReadWrite, base::Unretained(this), callback); |
265 int result = socket_->Write(buf, buf_len, write_callback); | 265 int result = socket_->Write(buf, buf_len, write_callback); |
266 if (result > 0) | 266 if (result > 0) |
267 use_history_.set_was_used_to_convey_data(); | 267 use_history_.set_was_used_to_convey_data(); |
268 | 268 |
269 return result; | 269 return result; |
270 } | 270 } |
271 | 271 |
272 bool TCPClientSocket::SetReceiveBufferSize(int32 size) { | 272 int TCPClientSocket::SetReceiveBufferSize(int32 size) { |
273 return socket_->SetReceiveBufferSize(size); | 273 return socket_->SetReceiveBufferSize(size); |
274 } | 274 } |
275 | 275 |
276 bool TCPClientSocket::SetSendBufferSize(int32 size) { | 276 int TCPClientSocket::SetSendBufferSize(int32 size) { |
277 return socket_->SetSendBufferSize(size); | 277 return socket_->SetSendBufferSize(size); |
278 } | 278 } |
279 | 279 |
280 bool TCPClientSocket::SetKeepAlive(bool enable, int delay) { | 280 bool TCPClientSocket::SetKeepAlive(bool enable, int delay) { |
281 return socket_->SetKeepAlive(enable, delay); | 281 return socket_->SetKeepAlive(enable, delay); |
282 } | 282 } |
283 | 283 |
284 bool TCPClientSocket::SetNoDelay(bool no_delay) { | 284 bool TCPClientSocket::SetNoDelay(bool no_delay) { |
285 return socket_->SetNoDelay(no_delay); | 285 return socket_->SetNoDelay(no_delay); |
286 } | 286 } |
(...skipping 24 matching lines...) Expand all Loading... |
311 int result = socket_->Open(family); | 311 int result = socket_->Open(family); |
312 if (result != OK) | 312 if (result != OK) |
313 return result; | 313 return result; |
314 | 314 |
315 socket_->SetDefaultOptionsForClient(); | 315 socket_->SetDefaultOptionsForClient(); |
316 | 316 |
317 return OK; | 317 return OK; |
318 } | 318 } |
319 | 319 |
320 } // namespace net | 320 } // namespace net |
OLD | NEW |