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

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

Issue 665083009: ABANDONED Handle multiple AlternateProtocols for each HostPortPair. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 unified diff | Download patch
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_server_properties.h" 5 #include "net/http/http_server_properties.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 10
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 case kProtoUnknown: 94 case kProtoUnknown:
95 case kProtoHTTP11: 95 case kProtoHTTP11:
96 break; 96 break;
97 } 97 }
98 98
99 NOTREACHED() << "Invalid NextProto: " << next_proto; 99 NOTREACHED() << "Invalid NextProto: " << next_proto;
100 return UNINITIALIZED_ALTERNATE_PROTOCOL; 100 return UNINITIALIZED_ALTERNATE_PROTOCOL;
101 } 101 }
102 102
103 std::string AlternateProtocolInfo::ToString() const { 103 std::string AlternateProtocolInfo::ToString() const {
104 return base::StringPrintf("%d:%s p=%f", port, 104 return base::StringPrintf(
105 AlternateProtocolToString(protocol), 105 "%d:%s p=%f", port, AlternateProtocolToString(protocol), probability);
106 probability); 106 }
107
108 std::string AlternateProtocolsToString(AlternateProtocols protocols) {
109 std::string output{};
110 for (AlternateProtocols::const_iterator it = protocols.begin();
111 it != protocols.end();
112 ++it) {
113 output.append(it->ToString());
114 output.append("; ");
115 }
116 return output;
107 } 117 }
108 118
109 } // namespace net 119 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698