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 // A client specific QuicSession subclass. This class owns the underlying | 5 // A client specific QuicSession subclass. This class owns the underlying |
6 // QuicConnection and QuicConnectionHelper objects. The connection stores | 6 // QuicConnection and QuicConnectionHelper objects. The connection stores |
7 // a non-owning pointer to the helper so this session needs to ensure that | 7 // a non-owning pointer to the helper so this session needs to ensure that |
8 // the helper outlives the connection. | 8 // the helper outlives the connection. |
9 | 9 |
10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
11 #define NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 11 #define NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
12 | 12 |
13 #include <stddef.h> | 13 #include <stddef.h> |
14 | 14 |
15 #include <list> | 15 #include <list> |
16 #include <memory> | 16 #include <memory> |
17 #include <set> | 17 #include <set> |
18 #include <string> | 18 #include <string> |
19 #include <vector> | 19 #include <vector> |
20 | 20 |
21 #include "base/containers/mru_cache.h" | 21 #include "base/containers/mru_cache.h" |
22 #include "base/macros.h" | 22 #include "base/macros.h" |
23 #include "base/time/time.h" | 23 #include "base/time/time.h" |
24 #include "net/base/completion_callback.h" | 24 #include "net/base/completion_callback.h" |
25 #include "net/base/load_timing_info.h" | |
26 #include "net/base/net_error_details.h" | 25 #include "net/base/net_error_details.h" |
27 #include "net/cert/ct_verify_result.h" | 26 #include "net/cert/ct_verify_result.h" |
28 #include "net/proxy/proxy_server.h" | 27 #include "net/proxy/proxy_server.h" |
29 #include "net/quic/chromium/quic_chromium_client_stream.h" | 28 #include "net/quic/chromium/quic_chromium_client_stream.h" |
30 #include "net/quic/chromium/quic_chromium_packet_reader.h" | 29 #include "net/quic/chromium/quic_chromium_packet_reader.h" |
31 #include "net/quic/chromium/quic_chromium_packet_writer.h" | 30 #include "net/quic/chromium/quic_chromium_packet_writer.h" |
32 #include "net/quic/chromium/quic_connection_logger.h" | 31 #include "net/quic/chromium/quic_connection_logger.h" |
33 #include "net/quic/core/quic_client_session_base.h" | 32 #include "net/quic/core/quic_client_session_base.h" |
34 #include "net/quic/core/quic_crypto_client_stream.h" | 33 #include "net/quic/core/quic_crypto_client_stream.h" |
35 #include "net/quic/core/quic_protocol.h" | 34 #include "net/quic/core/quic_protocol.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 QuicClock* clock, | 126 QuicClock* clock, |
128 TransportSecurityState* transport_security_state, | 127 TransportSecurityState* transport_security_state, |
129 std::unique_ptr<QuicServerInfo> server_info, | 128 std::unique_ptr<QuicServerInfo> server_info, |
130 const QuicServerId& server_id, | 129 const QuicServerId& server_id, |
131 int yield_after_packets, | 130 int yield_after_packets, |
132 QuicTime::Delta yield_after_duration, | 131 QuicTime::Delta yield_after_duration, |
133 int cert_verify_flags, | 132 int cert_verify_flags, |
134 const QuicConfig& config, | 133 const QuicConfig& config, |
135 QuicCryptoClientConfig* crypto_config, | 134 QuicCryptoClientConfig* crypto_config, |
136 const char* const connection_description, | 135 const char* const connection_description, |
137 base::TimeTicks dns_resolution_start_time, | |
138 base::TimeTicks dns_resolution_end_time, | 136 base::TimeTicks dns_resolution_end_time, |
139 QuicClientPushPromiseIndex* push_promise_index, | 137 QuicClientPushPromiseIndex* push_promise_index, |
140 base::TaskRunner* task_runner, | 138 base::TaskRunner* task_runner, |
141 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 139 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
142 NetLog* net_log); | 140 NetLog* net_log); |
143 ~QuicChromiumClientSession() override; | 141 ~QuicChromiumClientSession() override; |
144 | 142 |
145 void Initialize() override; | 143 void Initialize() override; |
146 | 144 |
147 void AddObserver(Observer* observer); | 145 void AddObserver(Observer* observer); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 277 |
280 // Returns true if session has one ore more streams marked as non-migratable. | 278 // Returns true if session has one ore more streams marked as non-migratable. |
281 bool HasNonMigratableStreams() const; | 279 bool HasNonMigratableStreams() const; |
282 | 280 |
283 void HandlePromised(QuicStreamId associated_id, | 281 void HandlePromised(QuicStreamId associated_id, |
284 QuicStreamId promised_id, | 282 QuicStreamId promised_id, |
285 const SpdyHeaderBlock& headers) override; | 283 const SpdyHeaderBlock& headers) override; |
286 | 284 |
287 void DeletePromised(QuicClientPromisedInfo* promised) override; | 285 void DeletePromised(QuicClientPromisedInfo* promised) override; |
288 | 286 |
289 const LoadTimingInfo::ConnectTiming& GetConnectTiming(); | |
290 | |
291 protected: | 287 protected: |
292 // QuicSession methods: | 288 // QuicSession methods: |
293 bool ShouldCreateIncomingDynamicStream(QuicStreamId id) override; | 289 bool ShouldCreateIncomingDynamicStream(QuicStreamId id) override; |
294 bool ShouldCreateOutgoingDynamicStream() override; | 290 bool ShouldCreateOutgoingDynamicStream() override; |
295 | 291 |
296 QuicChromiumClientStream* CreateIncomingDynamicStream( | 292 QuicChromiumClientStream* CreateIncomingDynamicStream( |
297 QuicStreamId id) override; | 293 QuicStreamId id) override; |
298 | 294 |
299 private: | 295 private: |
300 friend class test::QuicChromiumClientSessionPeer; | 296 friend class test::QuicChromiumClientSessionPeer; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 std::unique_ptr<ct::CTVerifyResult> ct_verify_result_; | 343 std::unique_ptr<ct::CTVerifyResult> ct_verify_result_; |
348 std::string pinning_failure_log_; | 344 std::string pinning_failure_log_; |
349 bool pkp_bypassed_; | 345 bool pkp_bypassed_; |
350 ObserverSet observers_; | 346 ObserverSet observers_; |
351 StreamRequestQueue stream_requests_; | 347 StreamRequestQueue stream_requests_; |
352 CompletionCallback callback_; | 348 CompletionCallback callback_; |
353 size_t num_total_streams_; | 349 size_t num_total_streams_; |
354 base::TaskRunner* task_runner_; | 350 base::TaskRunner* task_runner_; |
355 BoundNetLog net_log_; | 351 BoundNetLog net_log_; |
356 std::vector<std::unique_ptr<QuicChromiumPacketReader>> packet_readers_; | 352 std::vector<std::unique_ptr<QuicChromiumPacketReader>> packet_readers_; |
357 LoadTimingInfo::ConnectTiming connect_timing_; | 353 base::TimeTicks dns_resolution_end_time_; |
| 354 base::TimeTicks handshake_start_; // Time the handshake was started. |
358 std::unique_ptr<QuicConnectionLogger> logger_; | 355 std::unique_ptr<QuicConnectionLogger> logger_; |
359 // True when the session is going away, and streams may no longer be created | 356 // True when the session is going away, and streams may no longer be created |
360 // on this session. Existing stream will continue to be processed. | 357 // on this session. Existing stream will continue to be processed. |
361 bool going_away_; | 358 bool going_away_; |
362 // True when the session receives a go away from server due to port migration. | 359 // True when the session receives a go away from server due to port migration. |
363 bool port_migration_detected_; | 360 bool port_migration_detected_; |
364 QuicDisabledReason disabled_reason_; | 361 QuicDisabledReason disabled_reason_; |
365 TokenBindingSignatureMap token_binding_signatures_; | 362 TokenBindingSignatureMap token_binding_signatures_; |
366 // UMA histogram counters for streams pushed to this session. | 363 // UMA histogram counters for streams pushed to this session. |
367 int streams_pushed_count_; | 364 int streams_pushed_count_; |
368 int streams_pushed_and_claimed_count_; | 365 int streams_pushed_and_claimed_count_; |
369 // Return value from packet rewrite packet on new socket. Used | 366 // Return value from packet rewrite packet on new socket. Used |
370 // during connection migration on socket write error. | 367 // during connection migration on socket write error. |
371 int error_code_from_rewrite_; | 368 int error_code_from_rewrite_; |
372 bool use_error_code_from_rewrite_; | 369 bool use_error_code_from_rewrite_; |
373 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; | 370 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; |
374 | 371 |
375 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); | 372 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); |
376 }; | 373 }; |
377 | 374 |
378 } // namespace net | 375 } // namespace net |
379 | 376 |
380 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 377 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
OLD | NEW |