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

Unified 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 latest round of comments. 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_stream_factory_impl_job.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index 375a71b9d3c5d208a7f573674fb410f542ac1141..38b824274ea5c3b5f310eaf17b2be8086bb90dc1 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -318,8 +318,17 @@ void HttpStreamFactoryImpl::Job::Orphan() {
void HttpStreamFactoryImpl::Job::SetPriority(RequestPriority priority) {
priority_ = priority;
- // TODO(akalin): Propagate this to |connection_| and maybe the
- // preconnect state.
+ // Ownership of |connection_| is passed to the newly created stream
+ // or H2 session in DoCreateStream(), and the consumer is not
+ // notified immediately, so this call may occur when |connection_|
+ // is null.
mmenke 2017/01/18 20:37:26 suggest a blank comment between both comments.
Randy Smith (Not in Mondays) 2017/01/22 21:37:00 Done.
+ // Note that streams are created without a priority associated with them,
+ // and it is up to the consumer to set their priority via
+ // HttpStream::InitializeStream(). So there is no need for this code
+ // to propagate priority changes to the newly created stream.
+ if (connection_ && connection_->is_initialized())
+ connection_->SetPriority(priority);
+ // TODO(akalin): Maybe Propagate this to the preconnect state.
}
bool HttpStreamFactoryImpl::Job::was_alpn_negotiated() const {
@@ -1177,6 +1186,7 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
delegate_->websocket_handshake_stream_create_helper()
->CreateBasicStream(std::move(connection_), using_proxy));
} else {
+ LOG(ERROR) << __FUNCTION__ << ":" << __LINE__ << ": Stream set";
mmenke 2017/01/18 20:37:26 Remove comment? DLOG?
Randy Smith (Not in Mondays) 2017/01/22 21:37:00 Ooops. Done.
stream_.reset(new HttpBasicStream(
std::move(connection_), using_proxy,
session_->params().http_09_on_non_default_ports_enabled));

Powered by Google App Engine
This is Rietveld 408576698