Index: net/http/http_stream_factory_impl_job.cc |
=================================================================== |
--- net/http/http_stream_factory_impl_job.cc (revision 111993) |
+++ net/http/http_stream_factory_impl_job.cc (working copy) |
@@ -65,6 +65,36 @@ |
return dict; |
} |
+// Parameters associated with the Proto (with NPN negotiation) of a HTTP stream. |
+class HttpStreamProtoParameters : public NetLog::EventParameters { |
+ public: |
+ static scoped_refptr<HttpStreamProtoParameters> Create( |
+ const SSLClientSocket::NextProtoStatus status, |
+ const std::string& proto) { |
+ return make_scoped_refptr(new HttpStreamProtoParameters(status, proto)); |
+ } |
+ |
+ virtual Value* ToValue() const; |
+ |
+ private: |
+ HttpStreamProtoParameters(const SSLClientSocket::NextProtoStatus status, |
+ const std::string& proto) |
+ : status_(status), |
+ proto_(proto) {} |
+ |
+ const SSLClientSocket::NextProtoStatus status_; |
+ const std::string proto_; |
+}; |
+ |
+Value* HttpStreamProtoParameters::ToValue() const { |
+ DictionaryValue* dict = new DictionaryValue(); |
+ |
+ dict->SetString("next_proto_status", |
+ SSLClientSocket::NextProtoStatusToString(status_)); |
+ dict->SetString("proto", proto_); |
+ return dict; |
+} |
+ |
HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory, |
HttpNetworkSession* session, |
const HttpRequestInfo& request_info, |
@@ -711,6 +741,11 @@ |
static_cast<SSLClientSocket*>(connection_->socket()); |
if (ssl_socket->was_npn_negotiated()) { |
was_npn_negotiated_ = true; |
+ std::string proto; |
+ SSLClientSocket::NextProtoStatus status = |
+ ssl_socket->GetNextProto(&proto); |
+ net_log_.AddEvent(NetLog::TYPE_HTTP_STREAM_REQUEST_PROTO, |
+ HttpStreamProtoParameters::Create(status, proto)); |
if (ssl_socket->was_spdy_negotiated()) |
SwitchToSpdyMode(); |
} |