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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 8787011: Log server advertised protos and the selected (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
Index: net/http/http_stream_factory_impl_job.cc
===================================================================
--- net/http/http_stream_factory_impl_job.cc (revision 112817)
+++ net/http/http_stream_factory_impl_job.cc (working copy)
@@ -65,6 +65,43 @@
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,
+ const std::string& server_proto) {
agl 2011/12/05 16:38:10 s/server_proto/server_protos/
ramant (doing other things) 2011/12/05 19:03:28 Done.
+ return make_scoped_refptr(new HttpStreamProtoParameters(
+ status, proto, server_proto));
agl 2011/12/05 16:38:10 s/server_proto/server_protos/
ramant (doing other things) 2011/12/05 19:03:28 Done.
+ }
+
+ virtual Value* ToValue() const;
+
+ private:
+ HttpStreamProtoParameters(const SSLClientSocket::NextProtoStatus status,
+ const std::string& proto,
+ const std::string& server_proto)
agl 2011/12/05 16:38:10 s/server_proto/server_protos/ (and the rest.)
ramant (doing other things) 2011/12/05 19:03:28 Done.
+ : status_(status),
+ proto_(proto),
+ server_proto_(server_proto) {}
+
+ const SSLClientSocket::NextProtoStatus status_;
+ const std::string proto_;
+ const std::string server_proto_;
+};
+
+Value* HttpStreamProtoParameters::ToValue() const {
+ DictionaryValue* dict = new DictionaryValue();
+
+ dict->SetString("next_proto_status",
+ SSLClientSocket::NextProtoStatusToString(status_));
+ dict->SetString("proto", proto_);
+ dict->SetString("server_proto",
agl 2011/12/05 16:38:10 s/server_proto/server_protos/
ramant (doing other things) 2011/12/05 19:03:28 Done.
+ SSLClientSocket::ServerProtoToString(server_proto_));
agl 2011/12/05 16:38:10 s/Proto/Protos/ s/server_proto_/server_protos_/
ramant (doing other things) 2011/12/05 19:03:28 Done.
+ return dict;
+}
+
HttpStreamFactoryImpl::Job::Job(HttpStreamFactoryImpl* stream_factory,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
@@ -711,6 +748,13 @@
static_cast<SSLClientSocket*>(connection_->socket());
if (ssl_socket->was_npn_negotiated()) {
was_npn_negotiated_ = true;
+ std::string proto;
+ std::string server_proto;
agl 2011/12/05 16:38:10 server_protos
ramant (doing other things) 2011/12/05 19:03:28 Done.
+ SSLClientSocket::NextProtoStatus status =
+ ssl_socket->GetNextProto(&proto, &server_proto);
+ net_log_.AddEvent(
+ NetLog::TYPE_HTTP_STREAM_REQUEST_PROTO,
+ HttpStreamProtoParameters::Create(status, proto, server_proto));
if (ssl_socket->was_spdy_negotiated())
SwitchToSpdyMode();
}

Powered by Google App Engine
This is Rietveld 408576698