OLD | NEW |
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 #include "net/socket/ssl_client_socket.h" | 10 #include "net/socket/ssl_client_socket.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
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 AlternativeService::ToString() const { |
104 return base::StringPrintf("%d:%s p=%f", port, | 104 return base::StringPrintf("(%s, %s, %d)", AlternateProtocolToString(protocol), |
105 AlternateProtocolToString(protocol), probability); | 105 host.c_str(), port); |
| 106 } |
| 107 |
| 108 std::string AlternativeServiceInfo::ToString() const { |
| 109 return base::StringPrintf("%s, p=%f", alternative_service.ToString().c_str(), |
| 110 probability); |
106 } | 111 } |
107 | 112 |
108 // static | 113 // static |
109 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { | 114 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { |
110 ssl_config->next_protos.clear(); | 115 ssl_config->next_protos.clear(); |
111 ssl_config->next_protos.push_back(kProtoHTTP11); | 116 ssl_config->next_protos.push_back(kProtoHTTP11); |
112 } | 117 } |
113 | 118 |
114 } // namespace net | 119 } // namespace net |
OLD | NEW |