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