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

Unified Diff: net/socket/next_proto.cc

Issue 560573002: Introduce new SPDY Version UMA histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Introduce new histogram with permanent values. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: net/socket/next_proto.cc
diff --git a/net/socket/next_proto.cc b/net/socket/next_proto.cc
index c9172365c383fec7e0a1089b3284fb1c0d7aa7cd..d7f8abb3c88ec86eee7f7f1bee0e0de6b3d94fef 100644
--- a/net/socket/next_proto.cc
+++ b/net/socket/next_proto.cc
@@ -2,10 +2,32 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "next_proto.h"
+#include "net/socket/next_proto.h"
+
+#include "base/logging.h"
namespace net {
+unsigned int SpdyProtoPermanentValue(NextProto protocol) {
+ // These values are collected by UMA, do not change or reuse them. When
+ // adding new values, do not forget to update spdyProtoPermanentValueBoundary.
+ switch (protocol) {
+ case kProtoDeprecatedSPDY2:
+ return 1;
+ case kProtoSPDY3:
+ return 2;
+ case kProtoSPDY31:
+ return 3;
+ // SPDY4 currently is HTTP/2 draft-14.
+ // TODO(bnc): increment when we update to new draft or final specification.
+ case kProtoSPDY4:
+ return 4;
+ default:
+ NOTREACHED() << "Invalid SPDY protocol.";
+ return 0;
+ }
+}
+
NextProtoVector NextProtosHttpOnly() {
NextProtoVector next_protos;
next_protos.push_back(kProtoHTTP11);
« net/socket/next_proto.h ('K') | « net/socket/next_proto.h ('k') | net/spdy/spdy_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698