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_macros.h" | 8 #include "base/metrics/histogram_macros.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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (str == "npn-spdy/3.1") | 102 if (str == "npn-spdy/3.1") |
103 return NPN_HTTP_2; | 103 return NPN_HTTP_2; |
104 | 104 |
105 return UNINITIALIZED_ALTERNATE_PROTOCOL; | 105 return UNINITIALIZED_ALTERNATE_PROTOCOL; |
106 } | 106 } |
107 | 107 |
108 AlternateProtocol AlternateProtocolFromNextProto(NextProto next_proto) { | 108 AlternateProtocol AlternateProtocolFromNextProto(NextProto next_proto) { |
109 switch (next_proto) { | 109 switch (next_proto) { |
110 case kProtoHTTP2: | 110 case kProtoHTTP2: |
111 return NPN_HTTP_2; | 111 return NPN_HTTP_2; |
112 case kProtoQUIC1SPDY3: | 112 case kProtoQUIC: |
113 return QUIC; | 113 return QUIC; |
114 | 114 |
115 case kProtoUnknown: | 115 case kProtoUnknown: |
116 case kProtoHTTP11: | 116 case kProtoHTTP11: |
117 break; | 117 break; |
118 } | 118 } |
119 | 119 |
120 NOTREACHED() << "Invalid NextProto: " << next_proto; | 120 NOTREACHED() << "Invalid NextProto: " << next_proto; |
121 return UNINITIALIZED_ALTERNATE_PROTOCOL; | 121 return UNINITIALIZED_ALTERNATE_PROTOCOL; |
122 } | 122 } |
(...skipping 12 matching lines...) Expand all Loading... |
135 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second); | 135 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second); |
136 } | 136 } |
137 | 137 |
138 // static | 138 // static |
139 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { | 139 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { |
140 ssl_config->alpn_protos.clear(); | 140 ssl_config->alpn_protos.clear(); |
141 ssl_config->alpn_protos.push_back(kProtoHTTP11); | 141 ssl_config->alpn_protos.push_back(kProtoHTTP11); |
142 } | 142 } |
143 | 143 |
144 } // namespace net | 144 } // namespace net |
OLD | NEW |