Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: net/socket/client_socket_handle.cc

Issue 1898133002: Add reprioritization to socket pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumbed SetPriority down from HttpStreamFactoryImpl::Job. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698