Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 return port == other.port && protocol == other.protocol; | 30 return port == other.port && protocol == other.protocol; |
| 31 } | 31 } |
| 32 | 32 |
| 33 std::string ToString() const; | 33 std::string ToString() const; |
| 34 | 34 |
| 35 uint16 port; | 35 uint16 port; |
| 36 AlternateProtocol protocol; | 36 AlternateProtocol protocol; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 typedef std::map<HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; | 39 typedef std::map<HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; |
| 40 typedef std::map<HostPortPair, spdy::SpdySettings> SpdySettingsMap; | 40 typedef std::map<HostPortPair, spdy::SettingsMap> SpdySettingsMap; |
| 41 typedef std::map<HostPortPair, | 41 typedef std::map<HostPortPair, |
| 42 HttpPipelinedHostCapability> PipelineCapabilityMap; | 42 HttpPipelinedHostCapability> PipelineCapabilityMap; |
| 43 | 43 |
| 44 extern const char kAlternateProtocolHeader[]; | 44 extern const char kAlternateProtocolHeader[]; |
| 45 extern const char* const kAlternateProtocolStrings[NUM_ALTERNATE_PROTOCOLS]; | 45 extern const char* const kAlternateProtocolStrings[NUM_ALTERNATE_PROTOCOLS]; |
| 46 | 46 |
| 47 // The interface for setting/retrieving the HTTP server properties. | 47 // The interface for setting/retrieving the HTTP server properties. |
| 48 // Currently, this class manages servers': | 48 // Currently, this class manages servers': |
| 49 // * SPDY support (based on NPN results) | 49 // * SPDY support (based on NPN results) |
| 50 // * Alternate-Protocol support | 50 // * Alternate-Protocol support |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 77 virtual void SetAlternateProtocol(const HostPortPair& server, | 77 virtual void SetAlternateProtocol(const HostPortPair& server, |
| 78 uint16 alternate_port, | 78 uint16 alternate_port, |
| 79 AlternateProtocol alternate_protocol) = 0; | 79 AlternateProtocol alternate_protocol) = 0; |
| 80 | 80 |
| 81 // Sets the Alternate-Protocol for |server| to be BROKEN. | 81 // Sets the Alternate-Protocol for |server| to be BROKEN. |
| 82 virtual void SetBrokenAlternateProtocol(const HostPortPair& server) = 0; | 82 virtual void SetBrokenAlternateProtocol(const HostPortPair& server) = 0; |
| 83 | 83 |
| 84 // Returns all Alternate-Protocol mappings. | 84 // Returns all Alternate-Protocol mappings. |
| 85 virtual const AlternateProtocolMap& alternate_protocol_map() const = 0; | 85 virtual const AlternateProtocolMap& alternate_protocol_map() const = 0; |
| 86 | 86 |
| 87 // Gets a reference to the SpdySettings stored for a host. | 87 // Gets a reference to the SettingsMap stored for a host. |
| 88 // If no settings are stored, returns an empty set of settings. | 88 // If no settings are stored, returns an empty SettingsMap. |
| 89 virtual const spdy::SpdySettings& GetSpdySettings( | 89 virtual const spdy::SettingsMap& GetSpdySettings( |
| 90 const HostPortPair& host_port_pair) const = 0; | 90 const HostPortPair& host_port_pair) const = 0; |
| 91 | 91 |
| 92 // Saves settings for a host. Returns true if SpdySettings are to be | 92 // Saves an individual SPDY setting for a host. Returns true if SPDY setting |
| 93 // persisted. Used by unittests only. | 93 // is to be persisted. |
| 94 // TODO(rtenneti): Move this method to test utility file. | 94 virtual bool SetSpdySetting( |
| 95 virtual bool SetSpdySettings(const HostPortPair& host_port_pair, | 95 const HostPortPair& host_port_pair, |
| 96 const spdy::SpdySettings& settings) = 0; | 96 uint32 id, |
| 97 const spdy::SettingsFlagsAndValue& flags_and_value) = 0; | |
|
Ryan Hamilton
2012/03/21 16:24:41
Please expand this out to take flags and value ind
ramant (doing other things)
2012/03/23 04:11:25
Done.
| |
| 97 | 98 |
| 98 // Saves an individual setting for a host. Returns true if SpdySetting is to | 99 // Clears all SPDY settings. |
| 99 // be persisted. | |
| 100 virtual bool SetSpdySetting(const HostPortPair& host_port_pair, | |
| 101 const spdy::SpdySetting& setting) = 0; | |
| 102 | |
| 103 // Clears all spdy_settings. | |
| 104 virtual void ClearSpdySettings() = 0; | 100 virtual void ClearSpdySettings() = 0; |
| 105 | 101 |
| 106 // Returns all persistent SpdySettings. | 102 // Returns all SPDY settings. |
| 107 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 103 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
| 108 | 104 |
| 109 virtual HttpPipelinedHostCapability GetPipelineCapability( | 105 virtual HttpPipelinedHostCapability GetPipelineCapability( |
| 110 const HostPortPair& origin) = 0; | 106 const HostPortPair& origin) = 0; |
| 111 | 107 |
| 112 virtual void SetPipelineCapability( | 108 virtual void SetPipelineCapability( |
| 113 const HostPortPair& origin, | 109 const HostPortPair& origin, |
| 114 HttpPipelinedHostCapability capability) = 0; | 110 HttpPipelinedHostCapability capability) = 0; |
| 115 | 111 |
| 116 virtual void ClearPipelineCapabilities() = 0; | 112 virtual void ClearPipelineCapabilities() = 0; |
| 117 | 113 |
| 118 virtual PipelineCapabilityMap GetPipelineCapabilityMap() const = 0; | 114 virtual PipelineCapabilityMap GetPipelineCapabilityMap() const = 0; |
| 119 | 115 |
| 120 private: | 116 private: |
| 121 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 117 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 122 }; | 118 }; |
| 123 | 119 |
| 124 } // namespace net | 120 } // namespace net |
| 125 | 121 |
| 126 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 122 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |