Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: net/http/http_server_properties_impl.h

Issue 298683010: QUIC - Persist 1000 MRU alternate protocols to preferences file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed rch's comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_server_properties.cc ('k') | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // unittests. 58 // unittests.
59 static std::string GetFlattenedSpdyServer( 59 static std::string GetFlattenedSpdyServer(
60 const net::HostPortPair& host_port_pair); 60 const net::HostPortPair& host_port_pair);
61 61
62 // Debugging to simulate presence of an AlternateProtocol. 62 // Debugging to simulate presence of an AlternateProtocol.
63 // If we don't have an alternate protocol in the map for any given host/port 63 // If we don't have an alternate protocol in the map for any given host/port
64 // pair, force this ProtocolPortPair. 64 // pair, force this ProtocolPortPair.
65 static void ForceAlternateProtocol(const PortAlternateProtocolPair& pair); 65 static void ForceAlternateProtocol(const PortAlternateProtocolPair& pair);
66 static void DisableForcedAlternateProtocol(); 66 static void DisableForcedAlternateProtocol();
67 67
68 // Returns the canonical host suffix for |server|, or std::string() if none
69 // exists.
70 std::string GetCanonicalSuffix(const net::HostPortPair& server);
71
68 // Changes the number of host/port pairs we remember pipelining capability 72 // Changes the number of host/port pairs we remember pipelining capability
69 // for. A larger number means we're more likely to be able to pipeline 73 // for. A larger number means we're more likely to be able to pipeline
70 // immediately if a host is known good, but uses more memory. This function 74 // immediately if a host is known good, but uses more memory. This function
71 // can only be called if |pipeline_capability_map_| is empty. 75 // can only be called if |pipeline_capability_map_| is empty.
72 void SetNumPipelinedHostsToRemember(int max_size); 76 void SetNumPipelinedHostsToRemember(int max_size);
73 77
74 // ----------------------------- 78 // -----------------------------
75 // HttpServerProperties methods: 79 // HttpServerProperties methods:
76 // ----------------------------- 80 // -----------------------------
77 81
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 115
112 // Confirms that Alternate-Protocol for |server| is working. 116 // Confirms that Alternate-Protocol for |server| is working.
113 virtual void ConfirmAlternateProtocol(const HostPortPair& server) OVERRIDE; 117 virtual void ConfirmAlternateProtocol(const HostPortPair& server) OVERRIDE;
114 118
115 // Clears the Alternate-Protocol for |server|. 119 // Clears the Alternate-Protocol for |server|.
116 virtual void ClearAlternateProtocol(const HostPortPair& server) OVERRIDE; 120 virtual void ClearAlternateProtocol(const HostPortPair& server) OVERRIDE;
117 121
118 // Returns all Alternate-Protocol mappings. 122 // Returns all Alternate-Protocol mappings.
119 virtual const AlternateProtocolMap& alternate_protocol_map() const OVERRIDE; 123 virtual const AlternateProtocolMap& alternate_protocol_map() const OVERRIDE;
120 124
125 virtual void SetAlternateProtocolExperiment(
126 AlternateProtocolExperiment experiment) OVERRIDE;
127
128 virtual AlternateProtocolExperiment GetAlternateProtocolExperiment()
129 const OVERRIDE;
130
121 // Gets a reference to the SettingsMap stored for a host. 131 // Gets a reference to the SettingsMap stored for a host.
122 // If no settings are stored, returns an empty SettingsMap. 132 // If no settings are stored, returns an empty SettingsMap.
123 virtual const SettingsMap& GetSpdySettings( 133 virtual const SettingsMap& GetSpdySettings(
124 const HostPortPair& host_port_pair) OVERRIDE; 134 const HostPortPair& host_port_pair) OVERRIDE;
125 135
126 // Saves an individual SPDY setting for a host. Returns true if SPDY setting 136 // Saves an individual SPDY setting for a host. Returns true if SPDY setting
127 // is to be persisted. 137 // is to be persisted.
128 virtual bool SetSpdySetting(const HostPortPair& host_port_pair, 138 virtual bool SetSpdySetting(const HostPortPair& host_port_pair,
129 SpdySettingsIds id, 139 SpdySettingsIds id,
130 SpdySettingsFlags flags, 140 SpdySettingsFlags flags,
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 CanonicalHostMap::const_iterator GetCanonicalHost(HostPortPair server) const; 190 CanonicalHostMap::const_iterator GetCanonicalHost(HostPortPair server) const;
181 191
182 void ExpireBrokenAlternateProtocolMappings(); 192 void ExpireBrokenAlternateProtocolMappings();
183 void ScheduleBrokenAlternateProtocolMappingsExpiration(); 193 void ScheduleBrokenAlternateProtocolMappingsExpiration();
184 194
185 SpdyServerHostPortMap spdy_servers_map_; 195 SpdyServerHostPortMap spdy_servers_map_;
186 196
187 AlternateProtocolMap alternate_protocol_map_; 197 AlternateProtocolMap alternate_protocol_map_;
188 BrokenAlternateProtocolList broken_alternate_protocol_list_; 198 BrokenAlternateProtocolList broken_alternate_protocol_list_;
189 BrokenAlternateProtocolMap broken_alternate_protocol_map_; 199 BrokenAlternateProtocolMap broken_alternate_protocol_map_;
200 AlternateProtocolExperiment alternate_protocol_experiment_;
190 201
191 SpdySettingsMap spdy_settings_map_; 202 SpdySettingsMap spdy_settings_map_;
192 ServerNetworkStatsMap server_network_stats_map_; 203 ServerNetworkStatsMap server_network_stats_map_;
193 scoped_ptr<CachedPipelineCapabilityMap> pipeline_capability_map_; 204 scoped_ptr<CachedPipelineCapabilityMap> pipeline_capability_map_;
194 // Contains a map of servers which could share the same alternate protocol. 205 // Contains a map of servers which could share the same alternate protocol.
195 // Map from a Canonical host/port (host is some postfix of host names) to an 206 // Map from a Canonical host/port (host is some postfix of host names) to an
196 // actual origin, which has a plausible alternate protocol mapping. 207 // actual origin, which has a plausible alternate protocol mapping.
197 CanonicalHostMap canonical_host_to_origin_map_; 208 CanonicalHostMap canonical_host_to_origin_map_;
198 // Contains list of suffixes (for exmaple ".c.youtube.com", 209 // Contains list of suffixes (for exmaple ".c.youtube.com",
199 // ".googlevideo.com") of canoncial hostnames. 210 // ".googlevideo.com") of canoncial hostnames.
200 CanonicalSufficList canoncial_suffixes_; 211 CanonicalSufficList canoncial_suffixes_;
201 212
202 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; 213 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_;
203 214
204 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); 215 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl);
205 }; 216 };
206 217
207 } // namespace net 218 } // namespace net
208 219
209 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ 220 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_
OLDNEW
« no previous file with comments | « net/http/http_server_properties.cc ('k') | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698