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

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: Fix glitch in ClientSocketHandle API contract. 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 // Ownership of |connection_| is passed to the newly created stream
322 // preconnect state. 322 // or H2 session in DoCreateStream(), and the consumer is not
323 // notified immediately, so this call may occur when |connection_|
324 // is null.
325 // TODO(rdsmith): Also set the priority on the stream, if it's present, to
326 // make sure the above race doesn't drop a reprioritization on the floor.
mmenke 2017/01/05 20:18:35 I see some ways to test it, but nothing that seems
Randy Smith (Not in Mondays) 2017/01/13 23:05:44 You know, unless you object after reading the foll
327 if (connection_ && connection_->is_initialized())
328 connection_->SetPriority(priority);
329 // TODO(akalin): Maybe Propagate this to the preconnect state.
323 } 330 }
324 331
325 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const { 332 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const {
326 return was_alpn_negotiated_; 333 return was_alpn_negotiated_;
327 } 334 }
328 335
329 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const { 336 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const {
330 return negotiated_protocol_; 337 return negotiated_protocol_;
331 } 338 }
332 339
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1512
1506 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1513 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1507 if (connection_->socket()) { 1514 if (connection_->socket()) {
1508 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1515 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1509 } 1516 }
1510 1517
1511 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1518 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1512 } 1519 }
1513 1520
1514 } // namespace net 1521 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698