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

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: Attempt to fix windows compile failure. 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 //
326 // Note that streams are created without a priority associated with them,
327 // and it is up to the consumer to set their priority via
328 // HttpStream::InitializeStream(). So there is no need for this code
329 // to propagate priority changes to the newly created stream.
330 if (connection_ && connection_->is_initialized())
331 connection_->SetPriority(priority);
332 // TODO(akalin): Maybe Propagate this to the preconnect state.
323 } 333 }
324 334
325 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const { 335 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const {
326 return was_alpn_negotiated_; 336 return was_alpn_negotiated_;
327 } 337 }
328 338
329 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const { 339 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const {
330 return negotiated_protocol_; 340 return negotiated_protocol_;
331 } 341 }
332 342
(...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1515
1506 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1516 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1507 if (connection_->socket()) { 1517 if (connection_->socket()) {
1508 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1518 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1509 } 1519 }
1510 1520
1511 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1521 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1512 } 1522 }
1513 1523
1514 } // namespace net 1524 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698