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 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 ALTERNATE_PROTOCOL_BROKEN, // The alternate protocol is known to be broken. | 62 ALTERNATE_PROTOCOL_BROKEN, // The alternate protocol is known to be broken. |
63 UNINITIALIZED_ALTERNATE_PROTOCOL, | 63 UNINITIALIZED_ALTERNATE_PROTOCOL, |
64 }; | 64 }; |
65 | 65 |
66 // Simply returns whether |protocol| is between | 66 // Simply returns whether |protocol| is between |
67 // ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION and | 67 // ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION and |
68 // ALTERNATE_PROTOCOL_MAXIMUM_VALID_VERSION (inclusive). | 68 // ALTERNATE_PROTOCOL_MAXIMUM_VALID_VERSION (inclusive). |
69 NET_EXPORT bool IsAlternateProtocolValid(AlternateProtocol protocol); | 69 NET_EXPORT bool IsAlternateProtocolValid(AlternateProtocol protocol); |
70 | 70 |
71 enum AlternateProtocolSize { | 71 enum AlternateProtocolSize { |
72 NUM_VALID_ALTERNATE_PROTOCOLS = | 72 NUM_VALID_ALTERNATE_PROTOCOLS = ALTERNATE_PROTOCOL_MAXIMUM_VALID_VERSION - |
73 ALTERNATE_PROTOCOL_MAXIMUM_VALID_VERSION - | 73 ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION + |
74 ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION + 1, | 74 1, |
75 }; | 75 }; |
76 | 76 |
77 NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol); | 77 NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol); |
78 NET_EXPORT AlternateProtocol AlternateProtocolFromString( | 78 NET_EXPORT AlternateProtocol |
79 const std::string& str); | 79 AlternateProtocolFromString(const std::string& str); |
80 NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( | 80 NET_EXPORT_PRIVATE AlternateProtocol |
81 NextProto next_proto); | 81 AlternateProtocolFromNextProto(NextProto next_proto); |
82 | 82 |
83 struct NET_EXPORT PortAlternateProtocolPair { | 83 struct NET_EXPORT PortAlternateProtocolPair { |
84 bool Equals(const PortAlternateProtocolPair& other) const { | 84 bool Equals(const PortAlternateProtocolPair& other) const { |
85 return port == other.port && protocol == other.protocol; | 85 return port == other.port && protocol == other.protocol; |
86 } | 86 } |
87 | 87 |
88 std::string ToString() const; | 88 std::string ToString() const; |
89 | 89 |
90 uint16 port; | 90 uint16 port; |
91 AlternateProtocol protocol; | 91 AlternateProtocol protocol; |
92 }; | 92 }; |
93 | 93 |
94 typedef base::MRUCache< | 94 typedef base::MRUCache<HostPortPair, PortAlternateProtocolPair> |
95 HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; | 95 AlternateProtocolMap; |
96 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; | 96 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; |
97 typedef std::map<HostPortPair, | 97 typedef std::map<HostPortPair, HttpPipelinedHostCapability> |
98 HttpPipelinedHostCapability> PipelineCapabilityMap; | 98 PipelineCapabilityMap; |
99 | 99 |
100 extern const char kAlternateProtocolHeader[]; | 100 extern const char kAlternateProtocolHeader[]; |
101 | 101 |
102 // The interface for setting/retrieving the HTTP server properties. | 102 // The interface for setting/retrieving the HTTP server properties. |
103 // Currently, this class manages servers': | 103 // Currently, this class manages servers': |
104 // * SPDY support (based on NPN results) | 104 // * SPDY support (based on NPN results) |
105 // * Alternate-Protocol support | 105 // * Alternate-Protocol support |
106 // * Spdy Settings (like CWND ID field) | 106 // * Spdy Settings (like CWND ID field) |
107 class NET_EXPORT HttpServerProperties { | 107 class NET_EXPORT HttpServerProperties { |
108 public: | 108 public: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 virtual PipelineCapabilityMap GetPipelineCapabilityMap() const = 0; | 196 virtual PipelineCapabilityMap GetPipelineCapabilityMap() const = 0; |
197 | 197 |
198 private: | 198 private: |
199 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 199 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
200 }; | 200 }; |
201 | 201 |
202 } // namespace net | 202 } // namespace net |
203 | 203 |
204 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 204 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
OLD | NEW |