| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/client_socket_handle.h" | 5 #include "net/socket/client_socket_handle.h" |
| 6 | 6 |
| 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" |
| 7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 8 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| 9 #include "base/logging.h" | 11 #include "base/logging.h" |
| 10 #include "net/base/net_errors.h" | 12 #include "net/base/net_errors.h" |
| 11 #include "net/socket/client_socket_pool.h" | 13 #include "net/socket/client_socket_pool.h" |
| 12 #include "net/socket/client_socket_pool_histograms.h" | 14 #include "net/socket/client_socket_pool_histograms.h" |
| 13 | 15 |
| 14 namespace net { | 16 namespace net { |
| 15 | 17 |
| 16 ClientSocketHandle::ClientSocketHandle() | 18 ClientSocketHandle::ClientSocketHandle() |
| 17 : is_initialized_(false), | 19 : is_initialized_(false), |
| 18 pool_(NULL), | 20 pool_(NULL), |
| 19 layered_pool_(NULL), | 21 layered_pool_(NULL), |
| 20 is_reused_(false), | 22 is_reused_(false), |
| 21 ALLOW_THIS_IN_INITIALIZER_LIST( | 23 ALLOW_THIS_IN_INITIALIZER_LIST(callback_( |
| 22 callback_(this, &ClientSocketHandle::OnIOComplete)), | 24 base::Bind(&ClientSocketHandle::OnIOComplete, |
| 25 base::Unretained(this)))), |
| 23 is_ssl_error_(false) {} | 26 is_ssl_error_(false) {} |
| 24 | 27 |
| 25 ClientSocketHandle::~ClientSocketHandle() { | 28 ClientSocketHandle::~ClientSocketHandle() { |
| 26 Reset(); | 29 Reset(); |
| 27 } | 30 } |
| 28 | 31 |
| 29 void ClientSocketHandle::Reset() { | 32 void ClientSocketHandle::Reset() { |
| 30 ResetInternal(true); | 33 ResetInternal(true); |
| 31 ResetErrorState(); | 34 ResetErrorState(); |
| 32 } | 35 } |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // release() socket. It ends up working though, since those methods are being | 136 // release() socket. It ends up working though, since those methods are being |
| 134 // used to layer sockets (and the destination sources are the same). | 137 // used to layer sockets (and the destination sources are the same). |
| 135 DCHECK(socket_.get()); | 138 DCHECK(socket_.get()); |
| 136 socket_->NetLog().BeginEvent( | 139 socket_->NetLog().BeginEvent( |
| 137 NetLog::TYPE_SOCKET_IN_USE, | 140 NetLog::TYPE_SOCKET_IN_USE, |
| 138 make_scoped_refptr(new NetLogSourceParameter( | 141 make_scoped_refptr(new NetLogSourceParameter( |
| 139 "source_dependency", requesting_source_))); | 142 "source_dependency", requesting_source_))); |
| 140 } | 143 } |
| 141 | 144 |
| 142 } // namespace net | 145 } // namespace net |
| OLD | NEW |