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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 11416058: Integrating the QuicStreamFactory into the network stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix static initializer Created 8 years 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
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ddd5ae65d02293d14cefa236c87f18a3d8902ff8..2208dc4a33b30e87d46ca0ed29a783a45ae99c12 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -28,6 +28,7 @@
#include "net/http/http_server_properties.h"
#include "net/http/http_stream_factory.h"
#include "net/http/http_stream_factory_impl_request.h"
+#include "net/quic/quic_http_stream.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/client_socket_pool.h"
#include "net/socket/client_socket_pool_manager.h"
@@ -89,6 +90,8 @@ HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory,
waiting_job_(NULL),
using_ssl_(false),
using_spdy_(false),
+ using_quic_(false),
+ quic_request_(session_->quic_stream_factory()),
force_spdy_always_(HttpStreamFactory::force_spdy_always()),
force_spdy_over_ssl_(HttpStreamFactory::force_spdy_over_ssl()),
spdy_certificate_error_(OK),
@@ -157,7 +160,7 @@ LoadState HttpStreamFactoryImpl::Job::GetLoadState() const {
case STATE_RESOLVE_PROXY_COMPLETE:
return session_->proxy_service()->GetLoadState(pac_request_);
case STATE_CREATE_STREAM_COMPLETE:
- return connection_->GetLoadState();
+ return using_quic_ ? LOAD_STATE_CONNECTING : connection_->GetLoadState();
case STATE_INIT_CONNECTION_COMPLETE:
return LOAD_STATE_SENDING_REQUEST;
default:
@@ -638,6 +641,12 @@ bool HttpStreamFactoryImpl::Job::ShouldForceSpdyWithoutSSL() const {
return rv && !HttpStreamFactory::HasSpdyExclusion(origin_);
}
+bool HttpStreamFactoryImpl::Job::ShouldForceQuic() const {
+ return session_->params().origin_port_to_force_quic_on == origin_.port()
+ && session_->params().origin_port_to_force_quic_on != 0
+ && proxy_info_.is_direct();
+}
+
int HttpStreamFactoryImpl::Job::DoWaitForJob() {
DCHECK(blocking_job_);
next_state_ = STATE_WAIT_FOR_JOB_COMPLETE;
@@ -660,6 +669,12 @@ int HttpStreamFactoryImpl::Job::DoInitConnection() {
using_ssl_ = request_info_.url.SchemeIs("https") || ShouldForceSpdySSL();
using_spdy_ = false;
+ if (ShouldForceQuic()) {
+ next_state_ = STATE_CREATE_STREAM;
+ using_quic_ = true;
+ return OK;
+ }
+
// Check first if we have a spdy session for this group. If so, then go
// straight to using that.
HostPortProxyPair spdy_session_key = GetSpdySessionKey();
@@ -903,7 +918,7 @@ int HttpStreamFactoryImpl::Job::DoWaitingUserAction(int result) {
int HttpStreamFactoryImpl::Job::DoCreateStream() {
DCHECK(connection_->socket() || existing_spdy_session_ ||
- existing_available_pipeline_);
+ existing_available_pipeline_ || using_quic_);
next_state_ = STATE_CREATE_STREAM_COMPLETE;
@@ -915,6 +930,11 @@ int HttpStreamFactoryImpl::Job::DoCreateStream() {
const ProxyServer& proxy_server = proxy_info_.proxy_server();
+ if (using_quic_) {
+ return quic_request_.Request(HostPortProxyPair(origin_, proxy_server),
+ net_log_, io_callback_);
+ }
+
if (!using_spdy_) {
bool using_proxy = (proxy_info_.is_http() || proxy_info_.is_https()) &&
request_info_.url.SchemeIs("http");
@@ -997,6 +1017,10 @@ int HttpStreamFactoryImpl::Job::DoCreateStreamComplete(int result) {
if (result < 0)
return result;
+ if (using_quic_) {
+ stream_ = quic_request_.ReleaseStream();
+ }
+
session_->proxy_service()->ReportSuccess(proxy_info_);
next_state_ = STATE_NONE;
return OK;
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698