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

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

Issue 9959033: Move NextProto enum to a new file net/socket/next_proto.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address wtc's comments Created 8 years, 8 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_request.h » ('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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 pac_request_(NULL), 124 pac_request_(NULL),
125 blocking_job_(NULL), 125 blocking_job_(NULL),
126 waiting_job_(NULL), 126 waiting_job_(NULL),
127 using_ssl_(false), 127 using_ssl_(false),
128 using_spdy_(false), 128 using_spdy_(false),
129 force_spdy_always_(HttpStreamFactory::force_spdy_always()), 129 force_spdy_always_(HttpStreamFactory::force_spdy_always()),
130 force_spdy_over_ssl_(HttpStreamFactory::force_spdy_over_ssl()), 130 force_spdy_over_ssl_(HttpStreamFactory::force_spdy_over_ssl()),
131 spdy_certificate_error_(OK), 131 spdy_certificate_error_(OK),
132 establishing_tunnel_(false), 132 establishing_tunnel_(false),
133 was_npn_negotiated_(false), 133 was_npn_negotiated_(false),
134 protocol_negotiated_(SSLClientSocket::kProtoUnknown), 134 protocol_negotiated_(kProtoUnknown),
135 num_streams_(0), 135 num_streams_(0),
136 spdy_session_direct_(false), 136 spdy_session_direct_(false),
137 existing_available_pipeline_(false), 137 existing_available_pipeline_(false),
138 ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) { 138 ALLOW_THIS_IN_INITIALIZER_LIST(ptr_factory_(this)) {
139 DCHECK(stream_factory); 139 DCHECK(stream_factory);
140 DCHECK(session); 140 DCHECK(session);
141 } 141 }
142 142
143 HttpStreamFactoryImpl::Job::~Job() { 143 HttpStreamFactoryImpl::Job::~Job() {
144 net_log_.EndEvent(NetLog::TYPE_HTTP_STREAM_JOB, NULL); 144 net_log_.EndEvent(NetLog::TYPE_HTTP_STREAM_JOB, NULL);
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 blocking_job_->waiting_job_ = NULL; 240 blocking_job_->waiting_job_ = NULL;
241 blocking_job_ = NULL; 241 blocking_job_ = NULL;
242 stream_factory_->OnOrphanedJobComplete(this); 242 stream_factory_->OnOrphanedJobComplete(this);
243 } 243 }
244 } 244 }
245 245
246 bool HttpStreamFactoryImpl::Job::was_npn_negotiated() const { 246 bool HttpStreamFactoryImpl::Job::was_npn_negotiated() const {
247 return was_npn_negotiated_; 247 return was_npn_negotiated_;
248 } 248 }
249 249
250 SSLClientSocket::NextProto HttpStreamFactoryImpl::Job::protocol_negotiated() 250 NextProto HttpStreamFactoryImpl::Job::protocol_negotiated()
251 const { 251 const {
252 return protocol_negotiated_; 252 return protocol_negotiated_;
253 } 253 }
254 254
255 bool HttpStreamFactoryImpl::Job::using_spdy() const { 255 bool HttpStreamFactoryImpl::Job::using_spdy() const {
256 return using_spdy_; 256 return using_spdy_;
257 } 257 }
258 258
259 const SSLConfig& HttpStreamFactoryImpl::Job::server_ssl_config() const { 259 const SSLConfig& HttpStreamFactoryImpl::Job::server_ssl_config() const {
260 return server_ssl_config_; 260 return server_ssl_config_;
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 784
785 if (ssl_started && (result == OK || IsCertificateError(result))) { 785 if (ssl_started && (result == OK || IsCertificateError(result))) {
786 SSLClientSocket* ssl_socket = 786 SSLClientSocket* ssl_socket =
787 static_cast<SSLClientSocket*>(connection_->socket()); 787 static_cast<SSLClientSocket*>(connection_->socket());
788 if (ssl_socket->was_npn_negotiated()) { 788 if (ssl_socket->was_npn_negotiated()) {
789 was_npn_negotiated_ = true; 789 was_npn_negotiated_ = true;
790 std::string proto; 790 std::string proto;
791 std::string server_protos; 791 std::string server_protos;
792 SSLClientSocket::NextProtoStatus status = 792 SSLClientSocket::NextProtoStatus status =
793 ssl_socket->GetNextProto(&proto, &server_protos); 793 ssl_socket->GetNextProto(&proto, &server_protos);
794 SSLClientSocket::NextProto protocol_negotiated = 794 NextProto protocol_negotiated =
795 SSLClientSocket::NextProtoFromString(proto); 795 SSLClientSocket::NextProtoFromString(proto);
796 protocol_negotiated_ = protocol_negotiated; 796 protocol_negotiated_ = protocol_negotiated;
797 net_log_.AddEvent( 797 net_log_.AddEvent(
798 NetLog::TYPE_HTTP_STREAM_REQUEST_PROTO, 798 NetLog::TYPE_HTTP_STREAM_REQUEST_PROTO,
799 HttpStreamProtoParameters::Create(status, proto, server_protos)); 799 HttpStreamProtoParameters::Create(status, proto, server_protos));
800 if (ssl_socket->was_spdy_negotiated()) 800 if (ssl_socket->was_spdy_negotiated())
801 SwitchToSpdyMode(); 801 SwitchToSpdyMode();
802 } 802 }
803 if (ShouldForceSpdySSL()) 803 if (ShouldForceSpdySSL())
804 SwitchToSpdyMode(); 804 SwitchToSpdyMode();
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1244 return false; 1244 return false;
1245 } 1245 }
1246 if (request_info_.method != "GET" && request_info_.method != "HEAD") { 1246 if (request_info_.method != "GET" && request_info_.method != "HEAD") {
1247 return false; 1247 return false;
1248 } 1248 }
1249 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining( 1249 return stream_factory_->http_pipelined_host_pool_.IsKeyEligibleForPipelining(
1250 *http_pipelining_key_.get()); 1250 *http_pipelining_key_.get());
1251 } 1251 }
1252 1252
1253 } // namespace net 1253 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/http/http_stream_factory_impl_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698