| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 callback_(base::Bind(&ClientSocketHandle::OnIOComplete, | 24 callback_(base::Bind(&ClientSocketHandle::OnIOComplete, |
| 25 base::Unretained(this))), | 25 base::Unretained(this))), |
| 26 is_ssl_error_(false), | 26 is_ssl_error_(false), |
| 27 ssl_failure_state_(SSL_FAILURE_NONE) { | 27 ssl_failure_state_(SSL_FAILURE_NONE) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 ClientSocketHandle::~ClientSocketHandle() { | 30 ClientSocketHandle::~ClientSocketHandle() { |
| 31 Reset(); | 31 Reset(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void ClientSocketHandle::SetPriority(RequestPriority priority) { |
| 35 pool_->SetPriority(group_name_, this, priority); |
| 36 } |
| 37 |
| 34 void ClientSocketHandle::Reset() { | 38 void ClientSocketHandle::Reset() { |
| 35 ResetInternal(true); | 39 ResetInternal(true); |
| 36 ResetErrorState(); | 40 ResetErrorState(); |
| 37 } | 41 } |
| 38 | 42 |
| 39 void ClientSocketHandle::ResetInternal(bool cancel) { | 43 void ClientSocketHandle::ResetInternal(bool cancel) { |
| 40 // Was Init called? | 44 // Was Init called? |
| 41 if (!group_name_.empty()) { | 45 if (!group_name_.empty()) { |
| 42 // If so, we must have a pool. | 46 // If so, we must have a pool. |
| 43 CHECK(pool_); | 47 CHECK(pool_); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // TODO(eroman): This logging is not complete, in particular set_socket() and | 173 // TODO(eroman): This logging is not complete, in particular set_socket() and |
| 170 // release() socket. It ends up working though, since those methods are being | 174 // release() socket. It ends up working though, since those methods are being |
| 171 // used to layer sockets (and the destination sources are the same). | 175 // used to layer sockets (and the destination sources are the same). |
| 172 DCHECK(socket_.get()); | 176 DCHECK(socket_.get()); |
| 173 socket_->NetLog().BeginEvent( | 177 socket_->NetLog().BeginEvent( |
| 174 NetLog::TYPE_SOCKET_IN_USE, | 178 NetLog::TYPE_SOCKET_IN_USE, |
| 175 requesting_source_.ToEventParametersCallback()); | 179 requesting_source_.ToEventParametersCallback()); |
| 176 } | 180 } |
| 177 | 181 |
| 178 } // namespace net | 182 } // namespace net |
| OLD | NEW |