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 <iostream> | |
8 | |
9 #include "base/logging.h" | 7 #include "base/logging.h" |
10 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
11 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
12 #include "net/socket/ssl_client_socket.h" | 10 #include "net/socket/ssl_client_socket.h" |
13 #include "net/ssl/ssl_config.h" | 11 #include "net/ssl/ssl_config.h" |
14 | 12 |
15 namespace net { | 13 namespace net { |
16 | 14 |
17 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; | 15 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; |
18 | 16 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 std::string AlternativeService::ToString() const { | 103 std::string AlternativeService::ToString() const { |
106 return base::StringPrintf("%s %s:%d", AlternateProtocolToString(protocol), | 104 return base::StringPrintf("%s %s:%d", AlternateProtocolToString(protocol), |
107 host.c_str(), port); | 105 host.c_str(), port); |
108 } | 106 } |
109 | 107 |
110 std::string AlternativeServiceInfo::ToString() const { | 108 std::string AlternativeServiceInfo::ToString() const { |
111 return base::StringPrintf("%s, p=%f", alternative_service.ToString().c_str(), | 109 return base::StringPrintf("%s, p=%f", alternative_service.ToString().c_str(), |
112 probability); | 110 probability); |
113 } | 111 } |
114 | 112 |
115 std::ostream& operator<<(std::ostream& os, | |
116 const AlternativeService& alternative_service) { | |
117 return (os << alternative_service.ToString()); | |
118 } | |
119 | |
120 // static | 113 // static |
121 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { | 114 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { |
122 ssl_config->next_protos.clear(); | 115 ssl_config->next_protos.clear(); |
123 ssl_config->next_protos.push_back(kProtoHTTP11); | 116 ssl_config->next_protos.push_back(kProtoHTTP11); |
124 } | 117 } |
125 | 118 |
126 } // namespace net | 119 } // namespace net |
OLD | NEW |