OLD | NEW |
1 // Copyright (c) 2011 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 #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" |
11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 #include "net/http/http_pipelined_host_capability.h" |
13 #include "net/spdy/spdy_framer.h" // TODO(willchan): Reconsider this. | 14 #include "net/spdy/spdy_framer.h" // TODO(willchan): Reconsider this. |
14 | 15 |
15 namespace net { | 16 namespace net { |
16 | 17 |
17 enum AlternateProtocol { | 18 enum AlternateProtocol { |
18 NPN_SPDY_1 = 0, | 19 NPN_SPDY_1 = 0, |
19 NPN_SPDY_2, | 20 NPN_SPDY_2, |
20 NUM_ALTERNATE_PROTOCOLS, | 21 NUM_ALTERNATE_PROTOCOLS, |
21 ALTERNATE_PROTOCOL_BROKEN, // The alternate protocol is known to be broken. | 22 ALTERNATE_PROTOCOL_BROKEN, // The alternate protocol is known to be broken. |
22 UNINITIALIZED_ALTERNATE_PROTOCOL, | 23 UNINITIALIZED_ALTERNATE_PROTOCOL, |
23 }; | 24 }; |
24 | 25 |
25 struct NET_EXPORT PortAlternateProtocolPair { | 26 struct NET_EXPORT PortAlternateProtocolPair { |
26 bool Equals(const PortAlternateProtocolPair& other) const { | 27 bool Equals(const PortAlternateProtocolPair& other) const { |
27 return port == other.port && protocol == other.protocol; | 28 return port == other.port && protocol == other.protocol; |
28 } | 29 } |
29 | 30 |
30 std::string ToString() const; | 31 std::string ToString() const; |
31 | 32 |
32 uint16 port; | 33 uint16 port; |
33 AlternateProtocol protocol; | 34 AlternateProtocol protocol; |
34 }; | 35 }; |
35 | 36 |
36 typedef std::map<HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; | 37 typedef std::map<HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; |
37 typedef std::map<HostPortPair, spdy::SpdySettings> SpdySettingsMap; | 38 typedef std::map<HostPortPair, spdy::SpdySettings> SpdySettingsMap; |
| 39 typedef std::map<HostPortPair, |
| 40 HttpPipelinedHostCapability> PipelineCapabilityMap; |
38 | 41 |
39 extern const char kAlternateProtocolHeader[]; | 42 extern const char kAlternateProtocolHeader[]; |
40 extern const char* const kAlternateProtocolStrings[NUM_ALTERNATE_PROTOCOLS]; | 43 extern const char* const kAlternateProtocolStrings[NUM_ALTERNATE_PROTOCOLS]; |
41 | 44 |
42 // The interface for setting/retrieving the HTTP server properties. | 45 // The interface for setting/retrieving the HTTP server properties. |
43 // Currently, this class manages servers': | 46 // Currently, this class manages servers': |
44 // * SPDY support (based on NPN results) | 47 // * SPDY support (based on NPN results) |
45 // * Alternate-Protocol support | 48 // * Alternate-Protocol support |
46 // * Spdy Settings (like CWND ID field) | 49 // * Spdy Settings (like CWND ID field) |
47 class NET_EXPORT HttpServerProperties { | 50 class NET_EXPORT HttpServerProperties { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // persisted. | 91 // persisted. |
89 virtual bool SetSpdySettings(const HostPortPair& host_port_pair, | 92 virtual bool SetSpdySettings(const HostPortPair& host_port_pair, |
90 const spdy::SpdySettings& settings) = 0; | 93 const spdy::SpdySettings& settings) = 0; |
91 | 94 |
92 // Clears all spdy_settings. | 95 // Clears all spdy_settings. |
93 virtual void ClearSpdySettings() = 0; | 96 virtual void ClearSpdySettings() = 0; |
94 | 97 |
95 // Returns all persistent SpdySettings. | 98 // Returns all persistent SpdySettings. |
96 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 99 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
97 | 100 |
| 101 virtual HttpPipelinedHostCapability GetPipelineCapability( |
| 102 const HostPortPair& origin) = 0; |
| 103 |
| 104 virtual void SetPipelineCapability( |
| 105 const HostPortPair& origin, |
| 106 HttpPipelinedHostCapability capability) = 0; |
| 107 |
| 108 virtual void ClearPipelineCapabilities() = 0; |
| 109 |
| 110 virtual PipelineCapabilityMap GetPipelineCapabilityMap() const = 0; |
| 111 |
98 private: | 112 private: |
99 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 113 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
100 }; | 114 }; |
101 | 115 |
102 } // namespace net | 116 } // namespace net |
103 | 117 |
104 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 118 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
OLD | NEW |