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

Side by Side Diff: net/http/http_network_transaction.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
« no previous file with comments | « no previous file | net/http/http_proxy_client_socket_pool.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 void HttpNetworkTransaction::PopulateNetErrorDetails( 414 void HttpNetworkTransaction::PopulateNetErrorDetails(
415 NetErrorDetails* details) const { 415 NetErrorDetails* details) const {
416 *details = net_error_details_; 416 *details = net_error_details_;
417 if (stream_) 417 if (stream_)
418 stream_->PopulateNetErrorDetails(details); 418 stream_->PopulateNetErrorDetails(details);
419 } 419 }
420 420
421 void HttpNetworkTransaction::SetPriority(RequestPriority priority) { 421 void HttpNetworkTransaction::SetPriority(RequestPriority priority) {
422 priority_ = priority; 422 priority_ = priority;
423 423
424 // TODO: Note that if throttling is ever implemented below this 424 // TODO(rdsmith): Note that if any code indirectly executed by
425 // level, either of the two below calls may result in request 425 // |stream_request_->SetPriority()| or |stream_->SetPriority()|
426 // completion, callbacks, and the potential deletion of this object 426 // ever implements a throttling mechanism where changing a request's
427 // (like the call below to throttle_->SetPriority()). In that case, 427 // priority may cause a this or another request to synchronously succeed
428 // this code will need to be modified. 428 // or fail, that callback could synchronously delete |*this|, causing
429 // a crash on return to this code.
430 //
431 // |throttle_->SetPriority()| has exactly the above attributes, which
432 // is why it's the last call in this function.
433
429 if (stream_request_) 434 if (stream_request_)
430 stream_request_->SetPriority(priority); 435 stream_request_->SetPriority(priority);
431 if (stream_) 436 if (stream_)
432 stream_->SetPriority(priority); 437 stream_->SetPriority(priority);
433 438
434 if (throttle_) 439 if (throttle_)
435 throttle_->SetPriority(priority); 440 throttle_->SetPriority(priority);
436 // The above call may have resulted in deleting |*this|. 441 // The above call may have resulted in deleting |*this|.
437 } 442 }
438 443
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 DCHECK(stream_request_); 1705 DCHECK(stream_request_);
1701 1706
1702 // Since the transaction can restart with auth credentials, it may create a 1707 // Since the transaction can restart with auth credentials, it may create a
1703 // stream more than once. Accumulate all of the connection attempts across 1708 // stream more than once. Accumulate all of the connection attempts across
1704 // those streams by appending them to the vector: 1709 // those streams by appending them to the vector:
1705 for (const auto& attempt : stream_request_->connection_attempts()) 1710 for (const auto& attempt : stream_request_->connection_attempts())
1706 connection_attempts_.push_back(attempt); 1711 connection_attempts_.push_back(attempt);
1707 } 1712 }
1708 1713
1709 } // namespace net 1714 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_proxy_client_socket_pool.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698