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

Side by Side Diff: net/http/http_stream_factory_impl_job.cc

Issue 339663010: Add a probability to Alternate-Protocol support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eliminate static initializer Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/http/http_stream_factory_impl_unittest.cc » ('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_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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 case STATE_INIT_CONNECTION_COMPLETE: 164 case STATE_INIT_CONNECTION_COMPLETE:
165 case STATE_CREATE_STREAM_COMPLETE: 165 case STATE_CREATE_STREAM_COMPLETE:
166 return using_quic_ ? LOAD_STATE_CONNECTING : connection_->GetLoadState(); 166 return using_quic_ ? LOAD_STATE_CONNECTING : connection_->GetLoadState();
167 default: 167 default:
168 return LOAD_STATE_IDLE; 168 return LOAD_STATE_IDLE;
169 } 169 }
170 } 170 }
171 171
172 void HttpStreamFactoryImpl::Job::MarkAsAlternate( 172 void HttpStreamFactoryImpl::Job::MarkAsAlternate(
173 const GURL& original_url, 173 const GURL& original_url,
174 PortAlternateProtocolPair alternate) { 174 AlternateProtocolInfo alternate) {
175 DCHECK(!original_url_.get()); 175 DCHECK(!original_url_.get());
176 original_url_.reset(new GURL(original_url)); 176 original_url_.reset(new GURL(original_url));
177 if (alternate.protocol == QUIC) { 177 if (alternate.protocol == QUIC) {
178 DCHECK(session_->params().enable_quic); 178 DCHECK(session_->params().enable_quic);
179 using_quic_ = true; 179 using_quic_ = true;
180 } 180 }
181 } 181 }
182 182
183 void HttpStreamFactoryImpl::Job::WaitFor(Job* job) { 183 void HttpStreamFactoryImpl::Job::WaitFor(Job* job) {
184 DCHECK_EQ(STATE_NONE, next_state_); 184 DCHECK_EQ(STATE_NONE, next_state_);
(...skipping 1288 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 1473
1474 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) { 1474 if (job_status_ == STATUS_SUCCEEDED && other_job_status_ == STATUS_BROKEN) {
1475 HistogramBrokenAlternateProtocolLocation( 1475 HistogramBrokenAlternateProtocolLocation(
1476 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN); 1476 BROKEN_ALTERNATE_PROTOCOL_LOCATION_HTTP_STREAM_FACTORY_IMPL_JOB_MAIN);
1477 session_->http_server_properties()->SetBrokenAlternateProtocol( 1477 session_->http_server_properties()->SetBrokenAlternateProtocol(
1478 HostPortPair::FromURL(request_info_.url)); 1478 HostPortPair::FromURL(request_info_.url));
1479 } 1479 }
1480 } 1480 }
1481 1481
1482 } // namespace net 1482 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/http/http_stream_factory_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698