| 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_ |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 void CloseSessionOnError(int error, QuicErrorCode quic_error); | 218 void CloseSessionOnError(int error, QuicErrorCode quic_error); |
| 219 | 219 |
| 220 // Close the session because of |error| and notifies the factory later that | 220 // Close the session because of |error| and notifies the factory later that |
| 221 // this session has been closed, which will delete the session. | 221 // this session has been closed, which will delete the session. |
| 222 void CloseSessionOnErrorAndNotifyFactoryLater(int error, | 222 void CloseSessionOnErrorAndNotifyFactoryLater(int error, |
| 223 QuicErrorCode quic_error); | 223 QuicErrorCode quic_error); |
| 224 | 224 |
| 225 std::unique_ptr<base::Value> GetInfoAsValue( | 225 std::unique_ptr<base::Value> GetInfoAsValue( |
| 226 const std::set<HostPortPair>& aliases); | 226 const std::set<HostPortPair>& aliases); |
| 227 | 227 |
| 228 const BoundNetLog& net_log() const { return net_log_; } | 228 const NetLogWithSource& net_log() const { return net_log_; } |
| 229 | 229 |
| 230 base::WeakPtr<QuicChromiumClientSession> GetWeakPtr(); | 230 base::WeakPtr<QuicChromiumClientSession> GetWeakPtr(); |
| 231 | 231 |
| 232 // Returns the number of client hello messages that have been sent on the | 232 // Returns the number of client hello messages that have been sent on the |
| 233 // crypto stream. If the handshake has completed then this is one greater | 233 // crypto stream. If the handshake has completed then this is one greater |
| 234 // than the number of round-trips needed for the handshake. | 234 // than the number of round-trips needed for the handshake. |
| 235 int GetNumSentClientHellos() const; | 235 int GetNumSentClientHellos() const; |
| 236 | 236 |
| 237 // Returns true if |hostname| may be pooled onto this session. If this | 237 // Returns true if |hostname| may be pooled onto this session. If this |
| 238 // is a secure QUIC session, then |hostname| must match the certificate | 238 // is a secure QUIC session, then |hostname| must match the certificate |
| (...skipping 19 matching lines...) Expand all Loading... |
| 258 // kMaxReadersPerQuicSession. Takes ownership of |socket|, |reader|, | 258 // kMaxReadersPerQuicSession. Takes ownership of |socket|, |reader|, |
| 259 // and |writer|. | 259 // and |writer|. |
| 260 bool MigrateToSocket(std::unique_ptr<DatagramClientSocket> socket, | 260 bool MigrateToSocket(std::unique_ptr<DatagramClientSocket> socket, |
| 261 std::unique_ptr<QuicChromiumPacketReader> reader, | 261 std::unique_ptr<QuicChromiumPacketReader> reader, |
| 262 std::unique_ptr<QuicChromiumPacketWriter> writer); | 262 std::unique_ptr<QuicChromiumPacketWriter> writer); |
| 263 | 263 |
| 264 // Called when NetworkChangeNotifier notifies observers of a newly | 264 // Called when NetworkChangeNotifier notifies observers of a newly |
| 265 // connected network. Migrates this session to the newly connected | 265 // connected network. Migrates this session to the newly connected |
| 266 // network if the session has a pending migration. | 266 // network if the session has a pending migration. |
| 267 void OnNetworkConnected(NetworkChangeNotifier::NetworkHandle network, | 267 void OnNetworkConnected(NetworkChangeNotifier::NetworkHandle network, |
| 268 const BoundNetLog& bound_net_log); | 268 const NetLogWithSource& bound_net_log); |
| 269 | 269 |
| 270 // Schedules a migration alarm to wait for a new network. | 270 // Schedules a migration alarm to wait for a new network. |
| 271 void OnNoNewNetwork(); | 271 void OnNoNewNetwork(); |
| 272 | 272 |
| 273 // Called when migration alarm fires. If migration has not occurred | 273 // Called when migration alarm fires. If migration has not occurred |
| 274 // since alarm was set, closes session with error. | 274 // since alarm was set, closes session with error. |
| 275 void OnMigrationTimeout(size_t num_sockets); | 275 void OnMigrationTimeout(size_t num_sockets); |
| 276 | 276 |
| 277 // Populates network error details for this session. | 277 // Populates network error details for this session. |
| 278 void PopulateNetErrorDetails(NetErrorDetails* details); | 278 void PopulateNetErrorDetails(NetErrorDetails* details); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 std::unique_ptr<QuicServerInfo> server_info_; | 352 std::unique_ptr<QuicServerInfo> server_info_; |
| 353 std::unique_ptr<CertVerifyResult> cert_verify_result_; | 353 std::unique_ptr<CertVerifyResult> cert_verify_result_; |
| 354 std::unique_ptr<ct::CTVerifyResult> ct_verify_result_; | 354 std::unique_ptr<ct::CTVerifyResult> ct_verify_result_; |
| 355 std::string pinning_failure_log_; | 355 std::string pinning_failure_log_; |
| 356 bool pkp_bypassed_; | 356 bool pkp_bypassed_; |
| 357 ObserverSet observers_; | 357 ObserverSet observers_; |
| 358 StreamRequestQueue stream_requests_; | 358 StreamRequestQueue stream_requests_; |
| 359 CompletionCallback callback_; | 359 CompletionCallback callback_; |
| 360 size_t num_total_streams_; | 360 size_t num_total_streams_; |
| 361 base::TaskRunner* task_runner_; | 361 base::TaskRunner* task_runner_; |
| 362 BoundNetLog net_log_; | 362 NetLogWithSource net_log_; |
| 363 std::vector<std::unique_ptr<QuicChromiumPacketReader>> packet_readers_; | 363 std::vector<std::unique_ptr<QuicChromiumPacketReader>> packet_readers_; |
| 364 LoadTimingInfo::ConnectTiming connect_timing_; | 364 LoadTimingInfo::ConnectTiming connect_timing_; |
| 365 std::unique_ptr<QuicConnectionLogger> logger_; | 365 std::unique_ptr<QuicConnectionLogger> logger_; |
| 366 // True when the session is going away, and streams may no longer be created | 366 // True when the session is going away, and streams may no longer be created |
| 367 // on this session. Existing stream will continue to be processed. | 367 // on this session. Existing stream will continue to be processed. |
| 368 bool going_away_; | 368 bool going_away_; |
| 369 // True when the session receives a go away from server due to port migration. | 369 // True when the session receives a go away from server due to port migration. |
| 370 bool port_migration_detected_; | 370 bool port_migration_detected_; |
| 371 TokenBindingSignatureMap token_binding_signatures_; | 371 TokenBindingSignatureMap token_binding_signatures_; |
| 372 // UMA histogram counters for streams pushed to this session. | 372 // UMA histogram counters for streams pushed to this session. |
| 373 int streams_pushed_count_; | 373 int streams_pushed_count_; |
| 374 int streams_pushed_and_claimed_count_; | 374 int streams_pushed_and_claimed_count_; |
| 375 // Stores packet that witnesses socket write error. This packet is | 375 // Stores packet that witnesses socket write error. This packet is |
| 376 // written to a new socket after migration completes. | 376 // written to a new socket after migration completes. |
| 377 scoped_refptr<StringIOBuffer> packet_; | 377 scoped_refptr<StringIOBuffer> packet_; |
| 378 // TODO(jri): Replace use of migration_pending_ sockets_.size(). | 378 // TODO(jri): Replace use of migration_pending_ sockets_.size(). |
| 379 // When a task is posted for MigrateSessionOnError, pass in | 379 // When a task is posted for MigrateSessionOnError, pass in |
| 380 // sockets_.size(). Then in MigrateSessionOnError, check to see if | 380 // sockets_.size(). Then in MigrateSessionOnError, check to see if |
| 381 // the current sockets_.size() == the passed in value. | 381 // the current sockets_.size() == the passed in value. |
| 382 bool migration_pending_; // True while migration is underway. | 382 bool migration_pending_; // True while migration is underway. |
| 383 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; | 383 base::WeakPtrFactory<QuicChromiumClientSession> weak_factory_; |
| 384 | 384 |
| 385 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); | 385 DISALLOW_COPY_AND_ASSIGN(QuicChromiumClientSession); |
| 386 }; | 386 }; |
| 387 | 387 |
| 388 } // namespace net | 388 } // namespace net |
| 389 | 389 |
| 390 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ | 390 #endif // NET_QUIC_QUIC_CHROMIUM_CLIENT_SESSION_H_ |
| OLD | NEW |