| 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" |
| 11 #include "base/containers/mru_cache.h" | 11 #include "base/containers/mru_cache.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
| 15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 16 #include "net/http/http_pipelined_host_capability.h" | |
| 17 #include "net/socket/next_proto.h" | 16 #include "net/socket/next_proto.h" |
| 18 #include "net/spdy/spdy_framer.h" // TODO(willchan): Reconsider this. | 17 #include "net/spdy/spdy_framer.h" // TODO(willchan): Reconsider this. |
| 19 | 18 |
| 20 namespace net { | 19 namespace net { |
| 21 | 20 |
| 22 enum AlternateProtocolUsage { | 21 enum AlternateProtocolUsage { |
| 23 // Alternate Protocol was used without racing a normal connection. | 22 // Alternate Protocol was used without racing a normal connection. |
| 24 ALTERNATE_PROTOCOL_USAGE_NO_RACE = 0, | 23 ALTERNATE_PROTOCOL_USAGE_NO_RACE = 0, |
| 25 // Alternate Protocol was used by winning a race with a normal connection. | 24 // Alternate Protocol was used by winning a race with a normal connection. |
| 26 ALTERNATE_PROTOCOL_USAGE_WON_RACE = 1, | 25 ALTERNATE_PROTOCOL_USAGE_WON_RACE = 1, |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 86 |
| 88 std::string ToString() const; | 87 std::string ToString() const; |
| 89 | 88 |
| 90 uint16 port; | 89 uint16 port; |
| 91 AlternateProtocol protocol; | 90 AlternateProtocol protocol; |
| 92 }; | 91 }; |
| 93 | 92 |
| 94 typedef base::MRUCache< | 93 typedef base::MRUCache< |
| 95 HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; | 94 HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; |
| 96 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; | 95 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; |
| 97 typedef std::map<HostPortPair, | |
| 98 HttpPipelinedHostCapability> PipelineCapabilityMap; | |
| 99 | 96 |
| 100 extern const char kAlternateProtocolHeader[]; | 97 extern const char kAlternateProtocolHeader[]; |
| 101 | 98 |
| 102 // The interface for setting/retrieving the HTTP server properties. | 99 // The interface for setting/retrieving the HTTP server properties. |
| 103 // Currently, this class manages servers': | 100 // Currently, this class manages servers': |
| 104 // * SPDY support (based on NPN results) | 101 // * SPDY support (based on NPN results) |
| 105 // * Alternate-Protocol support | 102 // * Alternate-Protocol support |
| 106 // * Spdy Settings (like CWND ID field) | 103 // * Spdy Settings (like CWND ID field) |
| 107 class NET_EXPORT HttpServerProperties { | 104 class NET_EXPORT HttpServerProperties { |
| 108 public: | 105 public: |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 174 |
| 178 // Returns all persistent SPDY settings. | 175 // Returns all persistent SPDY settings. |
| 179 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 176 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
| 180 | 177 |
| 181 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, | 178 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, |
| 182 NetworkStats stats) = 0; | 179 NetworkStats stats) = 0; |
| 183 | 180 |
| 184 virtual const NetworkStats* GetServerNetworkStats( | 181 virtual const NetworkStats* GetServerNetworkStats( |
| 185 const HostPortPair& host_port_pair) const = 0; | 182 const HostPortPair& host_port_pair) const = 0; |
| 186 | 183 |
| 187 virtual HttpPipelinedHostCapability GetPipelineCapability( | |
| 188 const HostPortPair& origin) = 0; | |
| 189 | |
| 190 virtual void SetPipelineCapability( | |
| 191 const HostPortPair& origin, | |
| 192 HttpPipelinedHostCapability capability) = 0; | |
| 193 | |
| 194 virtual void ClearPipelineCapabilities() = 0; | |
| 195 | |
| 196 virtual PipelineCapabilityMap GetPipelineCapabilityMap() const = 0; | |
| 197 | |
| 198 private: | 184 private: |
| 199 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 185 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 200 }; | 186 }; |
| 201 | 187 |
| 202 } // namespace net | 188 } // namespace net |
| 203 | 189 |
| 204 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 190 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |