| 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/stringprintf.h" | 8 #include "base/stringprintf.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; | 12 const char kAlternateProtocolHeader[] = "Alternate-Protocol"; |
| 13 // The order of these strings much match the order of the enum definition | 13 // The order of these strings much match the order of the enum definition |
| 14 // for AlternateProtocol. | 14 // for AlternateProtocol. |
| 15 const char* const kAlternateProtocolStrings[] = { | 15 const char* const kAlternateProtocolStrings[] = { |
| 16 "npn-spdy/1", | 16 "npn-spdy/1", |
| 17 "npn-spdy/2", | 17 "npn-spdy/2", |
| 18 "npn-spdy/3", | 18 "npn-spdy/3", |
| 19 "npn-spdy/3.1", |
| 19 "quic/1" | 20 "quic/1" |
| 20 }; | 21 }; |
| 21 const char kBrokenAlternateProtocol[] = "Broken"; | 22 const char kBrokenAlternateProtocol[] = "Broken"; |
| 22 | 23 |
| 23 const char* AlternateProtocolToString(AlternateProtocol protocol) { | 24 const char* AlternateProtocolToString(AlternateProtocol protocol) { |
| 24 switch (protocol) { | 25 switch (protocol) { |
| 25 case NPN_SPDY_1: | 26 case NPN_SPDY_1: |
| 26 case NPN_SPDY_2: | 27 case NPN_SPDY_2: |
| 27 case NPN_SPDY_3: | 28 case NPN_SPDY_3: |
| 28 case QUIC_1: | 29 case QUIC_1: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 48 return UNINITIALIZED_ALTERNATE_PROTOCOL; | 49 return UNINITIALIZED_ALTERNATE_PROTOCOL; |
| 49 } | 50 } |
| 50 | 51 |
| 51 | 52 |
| 52 std::string PortAlternateProtocolPair::ToString() const { | 53 std::string PortAlternateProtocolPair::ToString() const { |
| 53 return base::StringPrintf("%d:%s", port, | 54 return base::StringPrintf("%d:%s", port, |
| 54 AlternateProtocolToString(protocol)); | 55 AlternateProtocolToString(protocol)); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace net | 58 } // namespace net |
| OLD | NEW |