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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 8676046: Log server advertised protos (NPN data to NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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/base/net_log_event_type_list.h ('k') | net/socket/ssl_client_socket.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
===================================================================
--- 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();
}
« no previous file with comments | « net/base/net_log_event_type_list.h ('k') | net/socket/ssl_client_socket.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698