| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // HttpAlternateProtocols is an in-memory data structure used for keeping track | 5 // HttpAlternateProtocols is an in-memory data structure used for keeping track |
| 6 // of which HTTP HostPortPairs have an alternate protocol that can be used | 6 // of which HTTP HostPortPairs have an alternate protocol that can be used |
| 7 // instead of HTTP on a different port. | 7 // instead of HTTP on a different port. |
| 8 | 8 |
| 9 #ifndef NET_HTTP_HTTP_ALTERNATE_PROTOCOLS_H_ | 9 #ifndef NET_HTTP_HTTP_ALTERNATE_PROTOCOLS_H_ |
| 10 #define NET_HTTP_HTTP_ALTERNATE_PROTOCOLS_H_ | 10 #define NET_HTTP_HTTP_ALTERNATE_PROTOCOLS_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <map> | 13 #include <map> |
| 14 #include <string> | 14 #include <string> |
| 15 #include <utility> | 15 #include <utility> |
| 16 | 16 |
| 17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
| 18 #include "net/base/host_port_pair.h" | 18 #include "net/base/host_port_pair.h" |
| 19 #include "net/base/net_api.h" |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| 21 | 22 |
| 22 class HttpAlternateProtocols { | 23 class NET_API HttpAlternateProtocols { |
| 23 public: | 24 public: |
| 24 enum Protocol { | 25 enum Protocol { |
| 25 NPN_SPDY_1, | 26 NPN_SPDY_1, |
| 26 NPN_SPDY_2, | 27 NPN_SPDY_2, |
| 27 NUM_ALTERNATE_PROTOCOLS, | 28 NUM_ALTERNATE_PROTOCOLS, |
| 28 BROKEN, // The alternate protocol is known to be broken. | 29 BROKEN, // The alternate protocol is known to be broken. |
| 29 UNINITIALIZED, | 30 UNINITIALIZED, |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 struct PortProtocolPair { | 33 struct PortProtocolPair { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // The forced alternate protocol. If not-null, there is a protocol being | 85 // The forced alternate protocol. If not-null, there is a protocol being |
| 85 // forced. | 86 // forced. |
| 86 static PortProtocolPair* forced_alternate_protocol_; | 87 static PortProtocolPair* forced_alternate_protocol_; |
| 87 | 88 |
| 88 DISALLOW_COPY_AND_ASSIGN(HttpAlternateProtocols); | 89 DISALLOW_COPY_AND_ASSIGN(HttpAlternateProtocols); |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 } // namespace net | 92 } // namespace net |
| 92 | 93 |
| 93 #endif // NET_HTTP_HTTP_ALTERNATE_PROTOCOLS_H_ | 94 #endif // NET_HTTP_HTTP_ALTERNATE_PROTOCOLS_H_ |
| OLD | NEW |