Commit 97aff32a authored by bnc's avatar bnc Committed by Commit bot

Add AlternateProtocolInfo to HttpStreamFactoryImpl::Job.

Add AlternateProtocolInfo member to HttpStreamFactoryImpl::Job.  Add
AlternateProtocolInfo argument to constructor, remove it from MarkAsAlternate.
This will be necessary in MaybeMarkAlternateProtocolBroken to pass it on to
SetBrokenAlternateProtocol().  See https://crrev.com/665083009 for context.

BUG=392575

Review URL: https://codereview.chromium.org/871753006

Cr-Commit-Position: refs/heads/master@{#314180}
parent 1ebb1171
...@@ -86,6 +86,12 @@ NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( ...@@ -86,6 +86,12 @@ NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto(
NextProto next_proto); NextProto next_proto);
struct NET_EXPORT AlternateProtocolInfo { struct NET_EXPORT AlternateProtocolInfo {
AlternateProtocolInfo()
: port(0),
protocol(UNINITIALIZED_ALTERNATE_PROTOCOL),
probability(0),
is_broken(false) {}
AlternateProtocolInfo(uint16 port, AlternateProtocolInfo(uint16 port,
AlternateProtocol protocol, AlternateProtocol protocol,
double probability) double probability)
......
...@@ -169,6 +169,7 @@ void HttpStreamFactoryImpl::Job::MarkAsAlternate( ...@@ -169,6 +169,7 @@ void HttpStreamFactoryImpl::Job::MarkAsAlternate(
AlternateProtocolInfo alternate) { AlternateProtocolInfo alternate) {
DCHECK(!original_url_.get()); DCHECK(!original_url_.get());
original_url_.reset(new GURL(original_url)); original_url_.reset(new GURL(original_url));
alternate_protocol_ = alternate;
if (alternate.protocol == QUIC) { if (alternate.protocol == QUIC) {
DCHECK(session_->params().enable_quic); DCHECK(session_->params().enable_quic);
using_quic_ = true; using_quic_ = true;
...@@ -1454,6 +1455,7 @@ void HttpStreamFactoryImpl::Job::ReportJobSuccededForRequest() { ...@@ -1454,6 +1455,7 @@ void HttpStreamFactoryImpl::Job::ReportJobSuccededForRequest() {
void HttpStreamFactoryImpl::Job::MarkOtherJobComplete(const Job& job) { void HttpStreamFactoryImpl::Job::MarkOtherJobComplete(const Job& job) {
DCHECK_EQ(STATUS_RUNNING, other_job_status_); DCHECK_EQ(STATUS_RUNNING, other_job_status_);
other_job_status_ = job.job_status_; other_job_status_ = job.job_status_;
other_job_alternate_protocol_ = job.alternate_protocol_;
MaybeMarkAlternateProtocolBroken(); MaybeMarkAlternateProtocolBroken();
} }
......
...@@ -275,6 +275,12 @@ class HttpStreamFactoryImpl::Job { ...@@ -275,6 +275,12 @@ class HttpStreamFactoryImpl::Job {
// and will specify the original URL. // and will specify the original URL.
scoped_ptr<GURL> original_url_; scoped_ptr<GURL> original_url_;
// AlternateProtocol for this job if this is an alternate job.
AlternateProtocolInfo alternate_protocol_;
// AlternateProtocol for the other job if this is not an alternate job.
AlternateProtocolInfo other_job_alternate_protocol_;
// This is the Job we're dependent on. It will notify us if/when it's OK to // This is the Job we're dependent on. It will notify us if/when it's OK to
// proceed. // proceed.
Job* blocking_job_; Job* blocking_job_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment