| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 if (str == "npn-h2") | 55 if (str == "npn-h2") |
| 56 return NPN_HTTP_2; | 56 return NPN_HTTP_2; |
| 57 if (str == "npn-spdy/3.1") | 57 if (str == "npn-spdy/3.1") |
| 58 return NPN_SPDY_3_1; | 58 return NPN_SPDY_3_1; |
| 59 | 59 |
| 60 return UNINITIALIZED_ALTERNATE_PROTOCOL; | 60 return UNINITIALIZED_ALTERNATE_PROTOCOL; |
| 61 } | 61 } |
| 62 | 62 |
| 63 AlternateProtocol AlternateProtocolFromNextProto(NextProto next_proto) { | 63 AlternateProtocol AlternateProtocolFromNextProto(NextProto next_proto) { |
| 64 switch (next_proto) { | 64 switch (next_proto) { |
| 65 case kProtoSPDY31: | |
| 66 return NPN_SPDY_3_1; | |
| 67 case kProtoHTTP2: | 65 case kProtoHTTP2: |
| 68 return NPN_HTTP_2; | 66 return NPN_HTTP_2; |
| 69 case kProtoQUIC1SPDY3: | 67 case kProtoQUIC1SPDY3: |
| 70 return QUIC; | 68 return QUIC; |
| 71 | 69 |
| 72 case kProtoUnknown: | 70 case kProtoUnknown: |
| 73 case kProtoHTTP11: | 71 case kProtoHTTP11: |
| 74 break; | 72 break; |
| 75 } | 73 } |
| 76 | 74 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 94 | 92 |
| 95 // static | 93 // static |
| 96 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { | 94 void HttpServerProperties::ForceHTTP11(SSLConfig* ssl_config) { |
| 97 ssl_config->alpn_protos.clear(); | 95 ssl_config->alpn_protos.clear(); |
| 98 ssl_config->alpn_protos.push_back(kProtoHTTP11); | 96 ssl_config->alpn_protos.push_back(kProtoHTTP11); |
| 99 ssl_config->npn_protos.clear(); | 97 ssl_config->npn_protos.clear(); |
| 100 ssl_config->npn_protos.push_back(kProtoHTTP11); | 98 ssl_config->npn_protos.push_back(kProtoHTTP11); |
| 101 } | 99 } |
| 102 | 100 |
| 103 } // namespace net | 101 } // namespace net |
| OLD | NEW |