summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbnc <bnc@chromium.org>2015-02-02 12:17:03 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-02 20:17:48 +0000
commit97aff32af22e1b9117fa5ad13c3cdaf5532a5509 (patch)
tree7cc6de72cb18b7abb140643dedf2edbd89bf7461 /net
parent1ebb11710e08d51fa99836190edc3db28dffc136 (diff)
downloadchromium_src-97aff32af22e1b9117fa5ad13c3cdaf5532a5509.zip
chromium_src-97aff32af22e1b9117fa5ad13c3cdaf5532a5509.tar.gz
chromium_src-97aff32af22e1b9117fa5ad13c3cdaf5532a5509.tar.bz2
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}
Diffstat (limited to 'net')
-rw-r--r--net/http/http_server_properties.h6
-rw-r--r--net/http/http_stream_factory_impl_job.cc2
-rw-r--r--net/http/http_stream_factory_impl_job.h6
3 files changed, 14 insertions, 0 deletions
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h
index 09fd185..840a359 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -86,6 +86,12 @@ NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto(
NextProto next_proto);
struct NET_EXPORT AlternateProtocolInfo {
+ AlternateProtocolInfo()
+ : port(0),
+ protocol(UNINITIALIZED_ALTERNATE_PROTOCOL),
+ probability(0),
+ is_broken(false) {}
+
AlternateProtocolInfo(uint16 port,
AlternateProtocol protocol,
double probability)
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index bab805d..45a0970 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -169,6 +169,7 @@ void HttpStreamFactoryImpl::Job::MarkAsAlternate(
AlternateProtocolInfo alternate) {
DCHECK(!original_url_.get());
original_url_.reset(new GURL(original_url));
+ alternate_protocol_ = alternate;
if (alternate.protocol == QUIC) {
DCHECK(session_->params().enable_quic);
using_quic_ = true;
@@ -1454,6 +1455,7 @@ void HttpStreamFactoryImpl::Job::ReportJobSuccededForRequest() {
void HttpStreamFactoryImpl::Job::MarkOtherJobComplete(const Job& job) {
DCHECK_EQ(STATUS_RUNNING, other_job_status_);
other_job_status_ = job.job_status_;
+ other_job_alternate_protocol_ = job.alternate_protocol_;
MaybeMarkAlternateProtocolBroken();
}
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h
index 55bfeec..04342bf 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -275,6 +275,12 @@ class HttpStreamFactoryImpl::Job {
// and will specify the 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
// proceed.
Job* blocking_job_;