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

Side by Side Diff: net/quic/quic_stream_factory.h

Issue 1572753003: QUIC - Allow cronet apps to specify how many server configs are to be (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: load all server configs from disk Created 4 years, 11 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
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_QUIC_QUIC_STREAM_FACTORY_H_ 5 #ifndef NET_QUIC_QUIC_STREAM_FACTORY_H_
6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_ 6 #define NET_QUIC_QUIC_STREAM_FACTORY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 bool enable_non_blocking_io, 138 bool enable_non_blocking_io,
139 bool disable_disk_cache, 139 bool disable_disk_cache,
140 bool prefer_aes, 140 bool prefer_aes,
141 int max_number_of_lossy_connections, 141 int max_number_of_lossy_connections,
142 float packet_loss_threshold, 142 float packet_loss_threshold,
143 int max_recent_disabled_reasons, 143 int max_recent_disabled_reasons,
144 int threshold_timeouts_with_streams_open, 144 int threshold_timeouts_with_streams_open,
145 int threshold_public_resets_post_handshake, 145 int threshold_public_resets_post_handshake,
146 int socket_receive_buffer_size, 146 int socket_receive_buffer_size,
147 bool delay_tcp_race, 147 bool delay_tcp_race,
148 bool store_server_configs_in_properties, 148 int number_of_server_configs_stored_in_properties,
149 bool close_sessions_on_ip_change, 149 bool close_sessions_on_ip_change,
150 int idle_connection_timeout_seconds, 150 int idle_connection_timeout_seconds,
151 const QuicTagVector& connection_options); 151 const QuicTagVector& connection_options);
152 ~QuicStreamFactory() override; 152 ~QuicStreamFactory() override;
153 153
154 // Creates a new QuicHttpStream to |host_port_pair| which will be 154 // Creates a new QuicHttpStream to |host_port_pair| which will be
155 // owned by |request|. 155 // owned by |request|.
156 // If a matching session already exists, this method will return OK. If no 156 // If a matching session already exists, this method will return OK. If no
157 // matching session exists, this will return ERR_IO_PENDING and will invoke 157 // matching session exists, this will return ERR_IO_PENDING and will invoke
158 // OnRequestComplete asynchronously. 158 // OnRequestComplete asynchronously.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 248
249 bool enable_connection_racing() const { return enable_connection_racing_; } 249 bool enable_connection_racing() const { return enable_connection_racing_; }
250 void set_enable_connection_racing(bool enable_connection_racing) { 250 void set_enable_connection_racing(bool enable_connection_racing) {
251 enable_connection_racing_ = enable_connection_racing; 251 enable_connection_racing_ = enable_connection_racing;
252 } 252 }
253 253
254 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; } 254 int socket_receive_buffer_size() const { return socket_receive_buffer_size_; }
255 255
256 bool delay_tcp_race() const { return delay_tcp_race_; } 256 bool delay_tcp_race() const { return delay_tcp_race_; }
257 257
258 bool store_server_configs_in_properties() const { 258 int number_of_server_configs_stored_in_properties() const {
259 return store_server_configs_in_properties_; 259 return number_of_server_configs_stored_in_properties_;
260 } 260 }
261 261
262 private: 262 private:
263 class Job; 263 class Job;
264 friend class test::QuicStreamFactoryPeer; 264 friend class test::QuicStreamFactoryPeer;
265 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad); 265 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryTest, QuicLossyProxyMarkedAsBad);
266 266
267 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap; 267 typedef std::map<QuicServerId, QuicChromiumClientSession*> SessionMap;
268 typedef std::map<QuicChromiumClientSession*, QuicServerId> SessionIdMap; 268 typedef std::map<QuicChromiumClientSession*, QuicServerId> SessionIdMap;
269 typedef std::set<QuicServerId> AliasSet; 269 typedef std::set<QuicServerId> AliasSet;
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 // Set if we do want to delay TCP connection when it is racing with QUIC. 440 // Set if we do want to delay TCP connection when it is racing with QUIC.
441 bool delay_tcp_race_; 441 bool delay_tcp_race_;
442 442
443 // If more than |yield_after_packets_| packets have been read or more than 443 // If more than |yield_after_packets_| packets have been read or more than
444 // |yield_after_duration_| time has passed, then 444 // |yield_after_duration_| time has passed, then
445 // QuicPacketReader::StartReading() yields by doing a PostTask(). 445 // QuicPacketReader::StartReading() yields by doing a PostTask().
446 int yield_after_packets_; 446 int yield_after_packets_;
447 QuicTime::Delta yield_after_duration_; 447 QuicTime::Delta yield_after_duration_;
448 448
449 // Set if server configs are to be stored in HttpServerProperties. 449 // Number of server configs that are to be stored in HttpServerProperties.
450 bool store_server_configs_in_properties_; 450 int number_of_server_configs_stored_in_properties_;
451 451
452 // Set if all sessions should be closed when any local IP address changes. 452 // Set if all sessions should be closed when any local IP address changes.
453 const bool close_sessions_on_ip_change_; 453 const bool close_sessions_on_ip_change_;
454 454
455 // Each profile will (probably) have a unique port_seed_ value. This value 455 // Each profile will (probably) have a unique port_seed_ value. This value
456 // is used to help seed a pseudo-random number generator (PortSuggester) so 456 // is used to help seed a pseudo-random number generator (PortSuggester) so
457 // that we consistently (within this profile) suggest the same ephemeral 457 // that we consistently (within this profile) suggest the same ephemeral
458 // port when we re-connect to any given server/port. The differences between 458 // port when we re-connect to any given server/port. The differences between
459 // profiles (probablistically) prevent two profiles from colliding in their 459 // profiles (probablistically) prevent two profiles from colliding in their
460 // ephemeral port requests. 460 // ephemeral port requests.
(...skipping 10 matching lines...) Expand all
471 base::TaskRunner* task_runner_; 471 base::TaskRunner* task_runner_;
472 472
473 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; 473 base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
474 474
475 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); 475 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
476 }; 476 };
477 477
478 } // namespace net 478 } // namespace net
479 479
480 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ 480 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698