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

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

Issue 1208933004: QUIC - disable QUIC under recent pathological connection errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 // 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 23 matching lines...) Expand all
34 class QuicServerId; 34 class QuicServerId;
35 class QuicServerInfo; 35 class QuicServerInfo;
36 class QuicStreamFactory; 36 class QuicStreamFactory;
37 class SSLInfo; 37 class SSLInfo;
38 class TransportSecurityState; 38 class TransportSecurityState;
39 39
40 namespace test { 40 namespace test {
41 class QuicClientSessionPeer; 41 class QuicClientSessionPeer;
42 } // namespace test 42 } // namespace test
43 43
44 // Epitaphs will be used to track the most recent departed sessions,
Ryan Hamilton 2015/06/30 18:55:31 Can you define "epitath" in this context?
Buck 2015/07/01 19:06:19 I've dropped epitaph everywhere, and switched to D
45 // to enable certain policies for when to disable QUIC, based on K
46 // of N type thresholds.
47 // Note: these values must be kept in sync with the corresponding values
48 // of QuicDisabledReason in: tools/metrics/histograms/histograms.xml
49 enum QuicClientSessionEpitaph {
Ryan Hamilton 2015/06/30 18:55:31 nit: might as well nest this enum inside of QuicCl
Buck 2015/07/01 19:06:19 I've moved it (enum QuicDisabledReason) to quic_ty
Ryan Hamilton 2015/07/06 18:25:41 quic_types.h is part of the shared code. Since the
Buck 2015/07/06 21:39:32 Ok, QuicClientSession::DisabledReason it is.
50 QUIC_EPITAPH_RIP = 0,
Ryan Hamilton 2015/06/30 18:55:31 What does "RIP" mean in this context? Perhaps add
Buck 2015/07/01 19:06:19 Corresponding entry in QuicDisabledReason has a co
51 QUIC_EPITAPH_PUBLIC_RESET_POST_HANDSHAKE = 1,
52 QUIC_EPITAPH_TIMEOUT_STREAMS_OPEN = 2,
53 QUIC_EPITAPH_MAX = 3,
Ryan Hamilton 2015/06/30 18:55:31 Could the packet loss code take advantage of this,
Buck 2015/07/01 19:06:19 Somewhat. As per above, I've moved it and also ad
54 };
55
44 class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase, 56 class NET_EXPORT_PRIVATE QuicClientSession : public QuicClientSessionBase,
45 public QuicPacketReader::Visitor { 57 public QuicPacketReader::Visitor {
46 public: 58 public:
47 // An interface for observing events on a session. 59 // An interface for observing events on a session.
48 class NET_EXPORT_PRIVATE Observer { 60 class NET_EXPORT_PRIVATE Observer {
49 public: 61 public:
50 virtual ~Observer() {} 62 virtual ~Observer() {}
51 virtual void OnCryptoHandshakeConfirmed() = 0; 63 virtual void OnCryptoHandshakeConfirmed() = 0;
52 virtual void OnSessionClosed(int error) = 0; 64 virtual void OnSessionClosed(int error) = 0;
53 }; 65 };
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 // than the number of round-trips needed for the handshake. 199 // than the number of round-trips needed for the handshake.
188 int GetNumSentClientHellos() const; 200 int GetNumSentClientHellos() const;
189 201
190 // Returns true if |hostname| may be pooled onto this session. If this 202 // Returns true if |hostname| may be pooled onto this session. If this
191 // is a secure QUIC session, then |hostname| must match the certificate 203 // is a secure QUIC session, then |hostname| must match the certificate
192 // presented during the handshake. 204 // presented during the handshake.
193 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const; 205 bool CanPool(const std::string& hostname, PrivacyMode privacy_mode) const;
194 206
195 const QuicServerId& server_id() const { return server_id_; } 207 const QuicServerId& server_id() const { return server_id_; }
196 208
209 const QuicClientSessionEpitaph epitaph() const { return epitaph_; }
210
197 protected: 211 protected:
198 // QuicSession methods: 212 // QuicSession methods:
199 QuicDataStream* CreateIncomingDynamicStream(QuicStreamId id) override; 213 QuicDataStream* CreateIncomingDynamicStream(QuicStreamId id) override;
200 214
201 private: 215 private:
202 friend class test::QuicClientSessionPeer; 216 friend class test::QuicClientSessionPeer;
203 217
204 typedef std::set<Observer*> ObserverSet; 218 typedef std::set<Observer*> ObserverSet;
205 typedef std::list<StreamRequest*> StreamRequestQueue; 219 typedef std::list<StreamRequest*> StreamRequestQueue;
206 220
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 size_t num_total_streams_; 268 size_t num_total_streams_;
255 base::TaskRunner* task_runner_; 269 base::TaskRunner* task_runner_;
256 BoundNetLog net_log_; 270 BoundNetLog net_log_;
257 QuicPacketReader packet_reader_; 271 QuicPacketReader packet_reader_;
258 base::TimeTicks dns_resolution_end_time_; 272 base::TimeTicks dns_resolution_end_time_;
259 base::TimeTicks handshake_start_; // Time the handshake was started. 273 base::TimeTicks handshake_start_; // Time the handshake was started.
260 scoped_ptr<QuicConnectionLogger> logger_; 274 scoped_ptr<QuicConnectionLogger> logger_;
261 // True when the session is going away, and streams may no longer be created 275 // True when the session is going away, and streams may no longer be created
262 // on this session. Existing stream will continue to be processed. 276 // on this session. Existing stream will continue to be processed.
263 bool going_away_; 277 bool going_away_;
278 QuicClientSessionEpitaph epitaph_;
264 base::WeakPtrFactory<QuicClientSession> weak_factory_; 279 base::WeakPtrFactory<QuicClientSession> weak_factory_;
265 280
266 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); 281 DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
267 }; 282 };
268 283
269 } // namespace net 284 } // namespace net
270 285
271 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_ 286 #endif // NET_QUIC_QUIC_CLIENT_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698