| 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_IMPL_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void SetHTTP11Required(const HostPortPair& server) override; | 92 void SetHTTP11Required(const HostPortPair& server) override; |
| 93 void MaybeForceHTTP11(const HostPortPair& server, | 93 void MaybeForceHTTP11(const HostPortPair& server, |
| 94 SSLConfig* ssl_config) override; | 94 SSLConfig* ssl_config) override; |
| 95 AlternateProtocolInfo GetAlternateProtocol( | 95 AlternateProtocolInfo GetAlternateProtocol( |
| 96 const HostPortPair& server) override; | 96 const HostPortPair& server) override; |
| 97 void SetAlternateProtocol(const HostPortPair& server, | 97 void SetAlternateProtocol(const HostPortPair& server, |
| 98 uint16 alternate_port, | 98 uint16 alternate_port, |
| 99 AlternateProtocol alternate_protocol, | 99 AlternateProtocol alternate_protocol, |
| 100 double probability) override; | 100 double probability) override; |
| 101 void SetBrokenAlternateProtocol(const HostPortPair& server) override; | 101 void SetBrokenAlternateProtocol(const HostPortPair& server) override; |
| 102 bool IsAlternativeServiceBroken( |
| 103 const AlternativeService& alternative_service) override; |
| 102 bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; | 104 bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; |
| 103 void ConfirmAlternateProtocol(const HostPortPair& server) override; | 105 void ConfirmAlternateProtocol(const HostPortPair& server) override; |
| 104 void ClearAlternateProtocol(const HostPortPair& server) override; | 106 void ClearAlternateProtocol(const HostPortPair& server) override; |
| 105 const AlternateProtocolMap& alternate_protocol_map() const override; | 107 const AlternateProtocolMap& alternate_protocol_map() const override; |
| 106 void SetAlternateProtocolProbabilityThreshold(double threshold) override; | 108 void SetAlternateProtocolProbabilityThreshold(double threshold) override; |
| 107 const SettingsMap& GetSpdySettings( | 109 const SettingsMap& GetSpdySettings( |
| 108 const HostPortPair& host_port_pair) override; | 110 const HostPortPair& host_port_pair) override; |
| 109 bool SetSpdySetting(const HostPortPair& host_port_pair, | 111 bool SetSpdySetting(const HostPortPair& host_port_pair, |
| 110 SpdySettingsIds id, | 112 SpdySettingsIds id, |
| 111 SpdySettingsFlags flags, | 113 SpdySettingsFlags flags, |
| 112 uint32 value) override; | 114 uint32 value) override; |
| 113 void ClearSpdySettings(const HostPortPair& host_port_pair) override; | 115 void ClearSpdySettings(const HostPortPair& host_port_pair) override; |
| 114 void ClearAllSpdySettings() override; | 116 void ClearAllSpdySettings() override; |
| 115 const SpdySettingsMap& spdy_settings_map() const override; | 117 const SpdySettingsMap& spdy_settings_map() const override; |
| 116 bool GetSupportsQuic(IPAddressNumber* last_address) const override; | 118 bool GetSupportsQuic(IPAddressNumber* last_address) const override; |
| 117 void SetSupportsQuic(bool used_quic, const IPAddressNumber& address) override; | 119 void SetSupportsQuic(bool used_quic, const IPAddressNumber& address) override; |
| 118 void SetServerNetworkStats(const HostPortPair& host_port_pair, | 120 void SetServerNetworkStats(const HostPortPair& host_port_pair, |
| 119 ServerNetworkStats stats) override; | 121 ServerNetworkStats stats) override; |
| 120 const ServerNetworkStats* GetServerNetworkStats( | 122 const ServerNetworkStats* GetServerNetworkStats( |
| 121 const HostPortPair& host_port_pair) override; | 123 const HostPortPair& host_port_pair) override; |
| 122 const ServerNetworkStatsMap& server_network_stats_map() const override; | 124 const ServerNetworkStatsMap& server_network_stats_map() const override; |
| 123 | 125 |
| 124 private: | 126 private: |
| 127 friend class HttpServerPropertiesImplPeer; |
| 128 |
| 125 // |spdy_servers_map_| has flattened representation of servers (host, port) | 129 // |spdy_servers_map_| has flattened representation of servers (host, port) |
| 126 // that either support or not support SPDY protocol. | 130 // that either support or not support SPDY protocol. |
| 127 typedef base::MRUCache<std::string, bool> SpdyServerHostPortMap; | 131 typedef base::MRUCache<std::string, bool> SpdyServerHostPortMap; |
| 128 typedef std::map<HostPortPair, HostPortPair> CanonicalHostMap; | 132 typedef std::map<HostPortPair, HostPortPair> CanonicalHostMap; |
| 129 typedef std::vector<std::string> CanonicalSufficList; | 133 typedef std::vector<std::string> CanonicalSufficList; |
| 130 typedef std::set<HostPortPair> Http11ServerHostPortSet; | 134 typedef std::set<HostPortPair> Http11ServerHostPortSet; |
| 131 | 135 |
| 132 // Linked hash map from AlternativeService to expiration time. This container | 136 // Linked hash map from AlternativeService to expiration time. This container |
| 133 // is a queue with O(1) enqueue and dequeue, and a hash_map with O(1) lookup | 137 // is a queue with O(1) enqueue and dequeue, and a hash_map with O(1) lookup |
| 134 // at the same time. | 138 // at the same time. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 double alternate_protocol_probability_threshold_; | 175 double alternate_protocol_probability_threshold_; |
| 172 | 176 |
| 173 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; | 177 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; |
| 174 | 178 |
| 175 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | 179 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); |
| 176 }; | 180 }; |
| 177 | 181 |
| 178 } // namespace net | 182 } // namespace net |
| 179 | 183 |
| 180 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 184 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| OLD | NEW |