| 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_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 |
| 11 #include <list> | 11 #include <list> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "net/base/address_list.h" | 21 #include "net/base/address_list.h" |
| 22 #include "net/base/completion_callback.h" | 22 #include "net/base/completion_callback.h" |
| 23 #include "net/base/host_port_pair.h" | 23 #include "net/base/host_port_pair.h" |
| 24 #include "net/base/net_error_details.h" |
| 24 #include "net/base/network_change_notifier.h" | 25 #include "net/base/network_change_notifier.h" |
| 25 #include "net/cert/cert_database.h" | 26 #include "net/cert/cert_database.h" |
| 26 #include "net/http/http_server_properties.h" | 27 #include "net/http/http_server_properties.h" |
| 27 #include "net/log/net_log.h" | 28 #include "net/log/net_log.h" |
| 28 #include "net/proxy/proxy_server.h" | 29 #include "net/proxy/proxy_server.h" |
| 29 #include "net/quic/network_connection.h" | 30 #include "net/quic/network_connection.h" |
| 30 #include "net/quic/quic_chromium_client_session.h" | 31 #include "net/quic/quic_chromium_client_session.h" |
| 31 #include "net/quic/quic_client_push_promise_index.h" | 32 #include "net/quic/quic_client_push_promise_index.h" |
| 32 #include "net/quic/quic_config.h" | 33 #include "net/quic/quic_config.h" |
| 33 #include "net/quic/quic_crypto_stream.h" | 34 #include "net/quic/quic_crypto_stream.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // returns empty string if QUIC is not disabled. | 200 // returns empty string if QUIC is not disabled. |
| 200 const char* QuicDisabledReasonString() const; | 201 const char* QuicDisabledReasonString() const; |
| 201 | 202 |
| 202 // Called by a session when it becomes idle. | 203 // Called by a session when it becomes idle. |
| 203 void OnIdleSession(QuicChromiumClientSession* session); | 204 void OnIdleSession(QuicChromiumClientSession* session); |
| 204 | 205 |
| 205 // Called by a session when it is going away and no more streams should be | 206 // Called by a session when it is going away and no more streams should be |
| 206 // created on it. | 207 // created on it. |
| 207 void OnSessionGoingAway(QuicChromiumClientSession* session); | 208 void OnSessionGoingAway(QuicChromiumClientSession* session); |
| 208 | 209 |
| 210 // Called by a session when it is going away due to connection migration. |
| 211 // Log it to net error details. |
| 212 void OnSessionGoingAwayForConnectionMigration(); |
| 213 |
| 209 // Called by a session after it shuts down. | 214 // Called by a session after it shuts down. |
| 210 void OnSessionClosed(QuicChromiumClientSession* session); | 215 void OnSessionClosed(QuicChromiumClientSession* session); |
| 211 | 216 |
| 212 // Called by a session whose connection has timed out. | 217 // Called by a session whose connection has timed out. |
| 213 void OnSessionConnectTimeout(QuicChromiumClientSession* session); | 218 void OnSessionConnectTimeout(QuicChromiumClientSession* session); |
| 214 | 219 |
| 215 // Cancels a pending request. | 220 // Cancels a pending request. |
| 216 void CancelRequest(QuicStreamRequest* request); | 221 void CancelRequest(QuicStreamRequest* request); |
| 217 | 222 |
| 218 // Closes all current sessions with specified network and QUIC error codes. | 223 // Closes all current sessions with specified network and QUIC error codes. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 | 281 |
| 277 // We perform the same flushing as described above when SSL settings change. | 282 // We perform the same flushing as described above when SSL settings change. |
| 278 void OnSSLConfigChanged() override; | 283 void OnSSLConfigChanged() override; |
| 279 | 284 |
| 280 // CertDatabase::Observer methods: | 285 // CertDatabase::Observer methods: |
| 281 | 286 |
| 282 // We close all sessions when certificate database is changed. | 287 // We close all sessions when certificate database is changed. |
| 283 void OnCertAdded(const X509Certificate* cert) override; | 288 void OnCertAdded(const X509Certificate* cert) override; |
| 284 void OnCACertChanged(const X509Certificate* cert) override; | 289 void OnCACertChanged(const X509Certificate* cert) override; |
| 285 | 290 |
| 291 // Populates network error details for this stream factory. |
| 292 void PopulateNetErrorDetails(NetErrorDetails* details); |
| 293 |
| 286 bool require_confirmation() const { return require_confirmation_; } | 294 bool require_confirmation() const { return require_confirmation_; } |
| 287 | 295 |
| 288 void set_require_confirmation(bool require_confirmation); | 296 void set_require_confirmation(bool require_confirmation); |
| 289 | 297 |
| 290 bool ZeroRTTEnabledFor(const QuicServerId& server_id); | 298 bool ZeroRTTEnabledFor(const QuicServerId& server_id); |
| 291 | 299 |
| 292 // It returns the amount of time waiting job should be delayed. | 300 // It returns the amount of time waiting job should be delayed. |
| 293 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); | 301 base::TimeDelta GetTimeDelayForWaitingJob(const QuicServerId& server_id); |
| 294 | 302 |
| 295 QuicChromiumConnectionHelper* helper() { return helper_.get(); } | 303 QuicChromiumConnectionHelper* helper() { return helper_.get(); } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // cache to 'smoothed RTT'. This ratio is used to calculate the timeout in | 457 // cache to 'smoothed RTT'. This ratio is used to calculate the timeout in |
| 450 // milliseconds to wait for loading of QUIC server information. If we don't | 458 // milliseconds to wait for loading of QUIC server information. If we don't |
| 451 // want to timeout, set |load_server_info_timeout_srtt_multiplier_| to 0. | 459 // want to timeout, set |load_server_info_timeout_srtt_multiplier_| to 0. |
| 452 float load_server_info_timeout_srtt_multiplier_; | 460 float load_server_info_timeout_srtt_multiplier_; |
| 453 | 461 |
| 454 // Set if we want to race connections - one connection that sends | 462 // Set if we want to race connections - one connection that sends |
| 455 // INCHOATE_HELLO and another connection that sends CHLO after loading server | 463 // INCHOATE_HELLO and another connection that sends CHLO after loading server |
| 456 // config from the disk cache. | 464 // config from the disk cache. |
| 457 bool enable_connection_racing_; | 465 bool enable_connection_racing_; |
| 458 | 466 |
| 467 bool goaway_received_for_connection_mirgation_; |
| 468 |
| 459 // Set if experimental non-blocking IO should be used on windows sockets. | 469 // Set if experimental non-blocking IO should be used on windows sockets. |
| 460 bool enable_non_blocking_io_; | 470 bool enable_non_blocking_io_; |
| 461 | 471 |
| 462 // Set if we do not want to load server config from the disk cache. | 472 // Set if we do not want to load server config from the disk cache. |
| 463 bool disable_disk_cache_; | 473 bool disable_disk_cache_; |
| 464 | 474 |
| 465 // Set if AES-GCM should be preferred, even if there is no hardware support. | 475 // Set if AES-GCM should be preferred, even if there is no hardware support. |
| 466 bool prefer_aes_; | 476 bool prefer_aes_; |
| 467 | 477 |
| 468 // Set if we want to disable QUIC when there is high packet loss rate. | 478 // Set if we want to disable QUIC when there is high packet loss rate. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 base::TaskRunner* task_runner_; | 546 base::TaskRunner* task_runner_; |
| 537 | 547 |
| 538 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; | 548 base::WeakPtrFactory<QuicStreamFactory> weak_factory_; |
| 539 | 549 |
| 540 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); | 550 DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory); |
| 541 }; | 551 }; |
| 542 | 552 |
| 543 } // namespace net | 553 } // namespace net |
| 544 | 554 |
| 545 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ | 555 #endif // NET_QUIC_QUIC_STREAM_FACTORY_H_ |
| OLD | NEW |