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

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 1898133002: Add reprioritization to socket pools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test for not propagating priority in HttpStreamFactoryImpl::Job if the stream's been returned alrea… Created 3 years, 11 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/http/http_stream_factory_impl_job.h" 5 #include "net/http/http_stream_factory_impl_job.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 if (connection_ && connection_->socket()) { 311 if (connection_ && connection_->socket()) {
312 connection_->socket()->Disconnect(); 312 connection_->socket()->Disconnect();
313 } 313 }
314 delegate_->OnOrphanedJobComplete(this); 314 delegate_->OnOrphanedJobComplete(this);
315 } 315 }
316 // |this| may be deleted after this call. 316 // |this| may be deleted after this call.
317 } 317 }
318 318
319 void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) { 319 void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) {
320 priority_ = priority; 320 priority_ = priority;
321 // TODO(akalin): Propagate this to |connection_| and maybe the 321 // connection_ is moved to be owned by the newly created stream
mmenke 2017/01/03 22:51:22 "connection_ is moved to be owned by the newly cre
mmenke 2017/01/03 22:51:22 Also, would it make more sense to put the TODO abo
Randy Smith (Not in Mondays) 2017/01/05 03:47:18 Huh; I had thought the PostTask() went to an objec
Randy Smith (Not in Mondays) 2017/01/05 03:47:18 Done.
322 // preconnect state. 322 // (or equivalent) in DoCreateStream(), and the consumer not notified
323 // until after a PostTask, so this call may occur when connection_ is null.
324 if (connection_)
325 connection_->SetPriority(priority);
326 // TODO(akalin): Maybe Propagate this to the preconnect state.
323 } 327 }
324 328
325 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const { 329 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const {
326 return was_alpn_negotiated_; 330 return was_alpn_negotiated_;
327 } 331 }
328 332
329 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const { 333 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const {
330 return negotiated_protocol_; 334 return negotiated_protocol_;
331 } 335 }
332 336
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1509
1506 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1510 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1507 if (connection_->socket()) { 1511 if (connection_->socket()) {
1508 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1512 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1509 } 1513 }
1510 1514
1511 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1515 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1512 } 1516 }
1513 1517
1514 } // namespace net 1518 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698