Chromium Code Reviews| 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_CLIENT_SESSION_H_ | 10 #ifndef NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 | 167 |
| 168 const BoundNetLog& net_log() const { return net_log_; } | 168 const BoundNetLog& net_log() const { return net_log_; } |
| 169 | 169 |
| 170 base::WeakPtr<QuicClientSession> GetWeakPtr(); | 170 base::WeakPtr<QuicClientSession> GetWeakPtr(); |
| 171 | 171 |
| 172 // Returns the number of client hello messages that have been sent on the | 172 // Returns the number of client hello messages that have been sent on the |
| 173 // crypto stream. If the handshake has completed then this is one greater | 173 // crypto stream. If the handshake has completed then this is one greater |
| 174 // than the number of round-trips needed for the handshake. | 174 // than the number of round-trips needed for the handshake. |
| 175 int GetNumSentClientHellos() const; | 175 int GetNumSentClientHellos() const; |
| 176 | 176 |
| 177 // Return connection's overall packet loss rate in 1/10th of percent. | |
| 178 int PacketLossRate() const; | |
|
Ryan Hamilton
2015/03/21 00:04:46
I wonder if a float would be more clear?
ramant (doing other things)
2015/03/21 03:46:05
Done.
| |
| 179 | |
| 177 // Returns true if |hostname| may be pooled onto this session. If this | 180 // Returns true if |hostname| may be pooled onto this session. If this |
| 178 // is a secure QUIC session, then |hostname| must match the certificate | 181 // is a secure QUIC session, then |hostname| must match the certificate |
| 179 // presented during the handshake. | 182 // presented during the handshake. |
| 180 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const; | 183 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const; |
| 181 | 184 |
| 182 const QuicServerId& server_id() const { return server_id_; } | 185 const QuicServerId& server_id() const { return server_id_; } |
| 183 | 186 |
| 184 protected: | 187 protected: |
| 185 // QuicSession methods: | 188 // QuicSession methods: |
| 186 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; | 189 QuicDataStream* CreateIncomingDataStream(QuicStreamId id) override; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 scoped_refptr<IOBufferWithSize> read_buffer_; | 234 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 232 TransportSecurityState* transport_security_state_; | 235 TransportSecurityState* transport_security_state_; |
| 233 scoped_ptr<QuicServerInfo> server_info_; | 236 scoped_ptr<QuicServerInfo> server_info_; |
| 234 scoped_ptr<CertVerifyResult> cert_verify_result_; | 237 scoped_ptr<CertVerifyResult> cert_verify_result_; |
| 235 std::string pinning_failure_log_; | 238 std::string pinning_failure_log_; |
| 236 ObserverSet observers_; | 239 ObserverSet observers_; |
| 237 StreamRequestQueue stream_requests_; | 240 StreamRequestQueue stream_requests_; |
| 238 bool read_pending_; | 241 bool read_pending_; |
| 239 CompletionCallback callback_; | 242 CompletionCallback callback_; |
| 240 size_t num_total_streams_; | 243 size_t num_total_streams_; |
| 244 size_t number_of_handshakes_; | |
| 241 base::TaskRunner* task_runner_; | 245 base::TaskRunner* task_runner_; |
| 242 BoundNetLog net_log_; | 246 BoundNetLog net_log_; |
| 243 base::TimeTicks dns_resolution_end_time_; | 247 base::TimeTicks dns_resolution_end_time_; |
| 244 base::TimeTicks handshake_start_; // Time the handshake was started. | 248 base::TimeTicks handshake_start_; // Time the handshake was started. |
| 245 scoped_ptr<QuicConnectionLogger> logger_; | 249 scoped_ptr<QuicConnectionLogger> logger_; |
| 246 // Number of packets read in the current read loop. | 250 // Number of packets read in the current read loop. |
| 247 size_t num_packets_read_; | 251 size_t num_packets_read_; |
| 248 // True when the session is going away, and streams may no longer be created | 252 // True when the session is going away, and streams may no longer be created |
| 249 // on this session. Existing stream will continue to be processed. | 253 // on this session. Existing stream will continue to be processed. |
| 250 bool going_away_; | 254 bool going_away_; |
| 251 base::WeakPtrFactory<QuicClientSession> weak_factory_; | 255 base::WeakPtrFactory<QuicClientSession> weak_factory_; |
| 252 | 256 |
| 253 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); | 257 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); |
| 254 }; | 258 }; |
| 255 | 259 |
| 256 } // namespace net | 260 } // namespace net |
| 257 | 261 |
| 258 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ | 262 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ |
| OLD | NEW |