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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Initializes |spdy_servers_map_| with the servers (host/port) from | 36 // Initializes |spdy_servers_map_| with the servers (host/port) from |
37 // |spdy_servers| that either support SPDY or not. | 37 // |spdy_servers| that either support SPDY or not. |
38 void InitializeSpdyServers(std::vector<std::string>* spdy_servers, | 38 void InitializeSpdyServers(std::vector<std::string>* spdy_servers, |
39 bool support_spdy); | 39 bool support_spdy); |
40 | 40 |
41 void InitializeAlternateProtocolServers( | 41 void InitializeAlternateProtocolServers( |
42 AlternateProtocolMap* alternate_protocol_servers); | 42 AlternateProtocolMap* alternate_protocol_servers); |
43 | 43 |
44 void InitializeSpdySettingsServers(SpdySettingsMap* spdy_settings_map); | 44 void InitializeSpdySettingsServers(SpdySettingsMap* spdy_settings_map); |
45 | 45 |
46 void InitializeSupportsQuic(SupportsQuicMap* supports_quic_map); | 46 void InitializeSupportsQuic(IPAddressNumber* last_address); |
47 | 47 |
48 void InitializeServerNetworkStats( | 48 void InitializeServerNetworkStats( |
49 ServerNetworkStatsMap* server_network_stats_map); | 49 ServerNetworkStatsMap* server_network_stats_map); |
50 | 50 |
51 // Get the list of servers (host/port) that support SPDY. The max_size is the | 51 // Get the list of servers (host/port) that support SPDY. The max_size is the |
52 // number of MRU servers that support SPDY that are to be returned. | 52 // number of MRU servers that support SPDY that are to be returned. |
53 void GetSpdyServerList(base::ListValue* spdy_server_list, | 53 void GetSpdyServerList(base::ListValue* spdy_server_list, |
54 size_t max_size) const; | 54 size_t max_size) const; |
55 | 55 |
56 // Returns flattened string representation of the |host_port_pair|. Used by | 56 // Returns flattened string representation of the |host_port_pair|. Used by |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void SetAlternateProtocolProbabilityThreshold(double threshold) override; | 93 void SetAlternateProtocolProbabilityThreshold(double threshold) override; |
94 const SettingsMap& GetSpdySettings( | 94 const SettingsMap& GetSpdySettings( |
95 const HostPortPair& host_port_pair) override; | 95 const HostPortPair& host_port_pair) override; |
96 bool SetSpdySetting(const HostPortPair& host_port_pair, | 96 bool SetSpdySetting(const HostPortPair& host_port_pair, |
97 SpdySettingsIds id, | 97 SpdySettingsIds id, |
98 SpdySettingsFlags flags, | 98 SpdySettingsFlags flags, |
99 uint32 value) override; | 99 uint32 value) override; |
100 void ClearSpdySettings(const HostPortPair& host_port_pair) override; | 100 void ClearSpdySettings(const HostPortPair& host_port_pair) override; |
101 void ClearAllSpdySettings() override; | 101 void ClearAllSpdySettings() override; |
102 const SpdySettingsMap& spdy_settings_map() const override; | 102 const SpdySettingsMap& spdy_settings_map() const override; |
103 SupportsQuic GetSupportsQuic( | 103 bool GetSupportsQuic(IPAddressNumber* last_address) const override; |
104 const HostPortPair& host_port_pair) const override; | 104 void SetSupportsQuic(bool used_quic, const IPAddressNumber& address) override; |
105 void SetSupportsQuic(const HostPortPair& host_port_pair, | |
106 bool used_quic, | |
107 const std::string& address) override; | |
108 const SupportsQuicMap& supports_quic_map() const override; | |
109 void SetServerNetworkStats(const HostPortPair& host_port_pair, | 105 void SetServerNetworkStats(const HostPortPair& host_port_pair, |
110 ServerNetworkStats stats) override; | 106 ServerNetworkStats stats) override; |
111 const ServerNetworkStats* GetServerNetworkStats( | 107 const ServerNetworkStats* GetServerNetworkStats( |
112 const HostPortPair& host_port_pair) override; | 108 const HostPortPair& host_port_pair) override; |
113 const ServerNetworkStatsMap& server_network_stats_map() const override; | 109 const ServerNetworkStatsMap& server_network_stats_map() const override; |
114 | 110 |
115 private: | 111 private: |
116 // |spdy_servers_map_| has flattened representation of servers (host, port) | 112 // |spdy_servers_map_| has flattened representation of servers (host, port) |
117 // that either support or not support SPDY protocol. | 113 // that either support or not support SPDY protocol. |
118 typedef base::MRUCache<std::string, bool> SpdyServerHostPortMap; | 114 typedef base::MRUCache<std::string, bool> SpdyServerHostPortMap; |
(...skipping 22 matching lines...) Expand all Loading... |
141 void ExpireBrokenAlternateProtocolMappings(); | 137 void ExpireBrokenAlternateProtocolMappings(); |
142 void ScheduleBrokenAlternateProtocolMappingsExpiration(); | 138 void ScheduleBrokenAlternateProtocolMappingsExpiration(); |
143 | 139 |
144 SpdyServerHostPortMap spdy_servers_map_; | 140 SpdyServerHostPortMap spdy_servers_map_; |
145 Http11ServerHostPortSet http11_servers_; | 141 Http11ServerHostPortSet http11_servers_; |
146 | 142 |
147 AlternateProtocolMap alternate_protocol_map_; | 143 AlternateProtocolMap alternate_protocol_map_; |
148 BrokenAlternateProtocolList broken_alternate_protocol_list_; | 144 BrokenAlternateProtocolList broken_alternate_protocol_list_; |
149 BrokenAlternateProtocolMap broken_alternate_protocol_map_; | 145 BrokenAlternateProtocolMap broken_alternate_protocol_map_; |
150 | 146 |
| 147 IPAddressNumber last_quic_address_; |
151 SpdySettingsMap spdy_settings_map_; | 148 SpdySettingsMap spdy_settings_map_; |
152 SupportsQuicMap supports_quic_map_; | |
153 ServerNetworkStatsMap server_network_stats_map_; | 149 ServerNetworkStatsMap server_network_stats_map_; |
154 // Contains a map of servers which could share the same alternate protocol. | 150 // Contains a map of servers which could share the same alternate protocol. |
155 // Map from a Canonical host/port (host is some postfix of host names) to an | 151 // Map from a Canonical host/port (host is some postfix of host names) to an |
156 // actual origin, which has a plausible alternate protocol mapping. | 152 // actual origin, which has a plausible alternate protocol mapping. |
157 CanonicalHostMap canonical_host_to_origin_map_; | 153 CanonicalHostMap canonical_host_to_origin_map_; |
158 // Contains list of suffixes (for exmaple ".c.youtube.com", | 154 // Contains list of suffixes (for exmaple ".c.youtube.com", |
159 // ".googlevideo.com", ".googleusercontent.com") of canonical hostnames. | 155 // ".googlevideo.com", ".googleusercontent.com") of canonical hostnames. |
160 CanonicalSufficList canonical_suffixes_; | 156 CanonicalSufficList canonical_suffixes_; |
161 | 157 |
162 double alternate_protocol_probability_threshold_; | 158 double alternate_protocol_probability_threshold_; |
163 | 159 |
164 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; | 160 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; |
165 | 161 |
166 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | 162 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); |
167 }; | 163 }; |
168 | 164 |
169 } // namespace net | 165 } // namespace net |
170 | 166 |
171 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 167 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
OLD | NEW |