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

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: Incorporated comments. Created 3 years, 10 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 if (connection_ && connection_->socket()) { 338 if (connection_ && connection_->socket()) {
339 connection_->socket()->Disconnect(); 339 connection_->socket()->Disconnect();
340 } 340 }
341 delegate_->OnOrphanedJobComplete(this); 341 delegate_->OnOrphanedJobComplete(this);
342 } 342 }
343 // |this| may be deleted after this call. 343 // |this| may be deleted after this call.
344 } 344 }
345 345
346 void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) { 346 void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) {
347 priority_ = priority; 347 priority_ = priority;
348 // TODO(akalin): Propagate this to |connection_| and maybe the 348 // Ownership of |connection_| is passed to the newly created stream
349 // preconnect state. 349 // or H2 session in DoCreateStream(), and the consumer is not
350 // notified immediately, so this call may occur when |connection_|
351 // is null.
352 //
353 // Note that streams are created without a priority associated with them,
354 // and it is up to the consumer to set their priority via
355 // HttpStream::InitializeStream(). So there is no need for this code
356 // to propagate priority changes to the newly created stream.
357 if (connection_ && connection_->is_initialized())
358 connection_->SetPriority(priority);
359 // TODO(akalin): Maybe Propagate this to the preconnect state.
350 } 360 }
351 361
352 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const { 362 bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const {
353 return was_alpn_negotiated_; 363 return was_alpn_negotiated_;
354 } 364 }
355 365
356 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const { 366 NextProto HttpStreamFactoryImpl::Job::negotiated_protocol() const {
357 return negotiated_protocol_; 367 return negotiated_protocol_;
358 } 368 }
359 369
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1547 1557
1548 ConnectionAttempts socket_attempts = connection_->connection_attempts(); 1558 ConnectionAttempts socket_attempts = connection_->connection_attempts();
1549 if (connection_->socket()) { 1559 if (connection_->socket()) {
1550 connection_->socket()->GetConnectionAttempts(&socket_attempts); 1560 connection_->socket()->GetConnectionAttempts(&socket_attempts);
1551 } 1561 }
1552 1562
1553 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts); 1563 delegate_->AddConnectionAttemptsToRequest(this, socket_attempts);
1554 } 1564 }
1555 1565
1556 } // namespace net 1566 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_proxy_client_socket_pool.cc ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698