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" |
| 11 #include "net/ssl/ssl_config.h" |
10 | 12 |
11 namespace net { | 13 namespace net { |
12 | 14 |
13 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; | 15 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; |
14 | 16 |
15 namespace { | 17 namespace { |
16 | 18 |
17 // The order of these strings much match the order of the enum definition | 19 // The order of these strings much match the order of the enum definition |
18 // for AlternateProtocol. | 20 // for AlternateProtocol. |
19 const char* const kAlternateProtocolStrings[] = { | 21 const char* const kAlternateProtocolStrings[] = { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 return UNINITIALIZED_ALTERNATE_PROTOCOL; | 101 return UNINITIALIZED_ALTERNATE_PROTOCOL; |
100 } | 102 } |
101 | 103 |
102 std::string AlternateProtocolInfo::ToString() const { | 104 std::string AlternateProtocolInfo::ToString() const { |
103 return base::StringPrintf("%d:%s p=%f%s", port, | 105 return base::StringPrintf("%d:%s p=%f%s", port, |
104 AlternateProtocolToString(protocol), | 106 AlternateProtocolToString(protocol), |
105 probability, | 107 probability, |
106 is_broken ? " (broken)" : ""); | 108 is_broken ? " (broken)" : ""); |
107 } | 109 } |
108 | 110 |
| 111 // static |
| 112 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { |
| 113 ssl_config->next_protos.clear(); |
| 114 ssl_config->next_protos.push_back(kProtoHTTP11); |
| 115 } |
| 116 |
109 } // namespace net | 117 } // namespace net |
OLD | NEW |