Chromium Code Reviews| 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 if (pool_) | |
|
mmenke
2016/05/09 18:41:03
When is this called without a pool?
Randy Smith (Not in Mondays)
2017/01/03 21:09:08
Well, as I read the code, HttpStreamFactoryImpl::J
mmenke
2017/01/03 21:28:22
You're right, but setting the priority of an "unin
Randy Smith (Not in Mondays)
2017/01/05 03:47:18
So I looked into this option in response to your c
| |
| 36 pool_->SetPriority(group_name_, this, priority); | |
|
mmenke
2017/01/03 21:28:22
Also, this is calling SetPriority even after this
Randy Smith (Not in Mondays)
2017/01/05 03:47:18
It's worse than doesn't seem right--it can produce
| |
| 37 } | |
| 38 | |
| 34 void ClientSocketHandle::Reset() { | 39 void ClientSocketHandle::Reset() { |
| 35 ResetInternal(true); | 40 ResetInternal(true); |
| 36 ResetErrorState(); | 41 ResetErrorState(); |
| 37 } | 42 } |
| 38 | 43 |
| 39 void ClientSocketHandle::ResetInternal(bool cancel) { | 44 void ClientSocketHandle::ResetInternal(bool cancel) { |
| 40 // Was Init called? | 45 // Was Init called? |
| 41 if (!group_name_.empty()) { | 46 if (!group_name_.empty()) { |
| 42 // If so, we must have a pool. | 47 // If so, we must have a pool. |
| 43 CHECK(pool_); | 48 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 | 174 // 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 | 175 // release() socket. It ends up working though, since those methods are being |
| 171 // used to layer sockets (and the destination sources are the same). | 176 // used to layer sockets (and the destination sources are the same). |
| 172 DCHECK(socket_.get()); | 177 DCHECK(socket_.get()); |
| 173 socket_->NetLog().BeginEvent( | 178 socket_->NetLog().BeginEvent( |
| 174 NetLog::TYPE_SOCKET_IN_USE, | 179 NetLog::TYPE_SOCKET_IN_USE, |
| 175 requesting_source_.ToEventParametersCallback()); | 180 requesting_source_.ToEventParametersCallback()); |
| 176 } | 181 } |
| 177 | 182 |
| 178 } // namespace net | 183 } // namespace net |
| OLD | NEW |