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

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

Issue 1425363002: Factor QuicCryptoClientStream APIs into QuicCryptoClientStreamBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106313860
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « net/quic/quic_crypto_client_stream.cc ('k') | net/tools/quic/quic_client_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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. 5 // A client specific QuicSession subclass.
6 6
7 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ 7 #ifndef NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
8 #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ 8 #define NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
9 9
10 #include <string> 10 #include <string>
(...skipping 12 matching lines...) Expand all
23 23
24 namespace tools { 24 namespace tools {
25 25
26 class QuicClientSession : public QuicClientSessionBase { 26 class QuicClientSession : public QuicClientSessionBase {
27 public: 27 public:
28 QuicClientSession(const QuicConfig& config, 28 QuicClientSession(const QuicConfig& config,
29 QuicConnection* connection, 29 QuicConnection* connection,
30 const QuicServerId& server_id, 30 const QuicServerId& server_id,
31 QuicCryptoClientConfig* crypto_config); 31 QuicCryptoClientConfig* crypto_config);
32 ~QuicClientSession() override; 32 ~QuicClientSession() override;
33 // Set up the QuicClientSession. Must be called prior to use.
34 void Initialize() override;
33 35
34 // QuicSession methods: 36 // QuicSession methods:
35 QuicSpdyClientStream* CreateOutgoingDynamicStream() override; 37 QuicSpdyClientStream* CreateOutgoingDynamicStream() override;
36 QuicCryptoClientStream* GetCryptoStream() override; 38 QuicCryptoClientStreamBase* GetCryptoStream() override;
37 39
38 // QuicClientSessionBase methods: 40 // QuicClientSessionBase methods:
39 void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override; 41 void OnProofValid(const QuicCryptoClientConfig::CachedState& cached) override;
40 void OnProofVerifyDetailsAvailable( 42 void OnProofVerifyDetailsAvailable(
41 const ProofVerifyDetails& verify_details) override; 43 const ProofVerifyDetails& verify_details) override;
42 44
43 // Performs a crypto handshake with the server. 45 // Performs a crypto handshake with the server.
44 void CryptoConnect(); 46 void CryptoConnect();
45 47
46 // Returns the number of client hello messages that have been sent on the 48 // Returns the number of client hello messages that have been sent on the
47 // crypto stream. If the handshake has completed then this is one greater 49 // crypto stream. If the handshake has completed then this is one greater
48 // than the number of round-trips needed for the handshake. 50 // than the number of round-trips needed for the handshake.
49 int GetNumSentClientHellos() const; 51 int GetNumSentClientHellos() const;
50 52
51 void set_respect_goaway(bool respect_goaway) { 53 void set_respect_goaway(bool respect_goaway) {
52 respect_goaway_ = respect_goaway; 54 respect_goaway_ = respect_goaway;
53 } 55 }
54 56
55 protected: 57 protected:
56 // QuicSession methods: 58 // QuicSession methods:
57 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override; 59 QuicSpdyStream* CreateIncomingDynamicStream(QuicStreamId id) override;
58 60
61 // Create the crypto stream. Called by Initialize()
62 virtual QuicCryptoClientStreamBase* CreateQuicCryptoStream();
63
59 // Unlike CreateOutgoingDynamicStream, which applies a bunch of sanity checks, 64 // Unlike CreateOutgoingDynamicStream, which applies a bunch of sanity checks,
60 // this simply returns a new QuicSpdyClientStream. This may be used by 65 // this simply returns a new QuicSpdyClientStream. This may be used by
61 // subclasses which want to use a subclass of QuicSpdyClientStream for streams 66 // subclasses which want to use a subclass of QuicSpdyClientStream for streams
62 // but wish to use the sanity checks in CreateOutgoingDynamicStream. 67 // but wish to use the sanity checks in CreateOutgoingDynamicStream.
63 virtual QuicSpdyClientStream* CreateClientStream(); 68 virtual QuicSpdyClientStream* CreateClientStream();
64 69
70 const QuicServerId& server_id() { return server_id_; }
71 QuicCryptoClientConfig* crypto_config() { return crypto_config_; }
72
65 private: 73 private:
66 scoped_ptr<QuicCryptoClientStream> crypto_stream_; 74 scoped_ptr<QuicCryptoClientStreamBase> crypto_stream_;
75 QuicServerId server_id_;
76 QuicCryptoClientConfig* crypto_config_;
67 77
68 // If this is set to false, the client will ignore server GOAWAYs and allow 78 // If this is set to false, the client will ignore server GOAWAYs and allow
69 // the creation of streams regardless of the high chance they will fail. 79 // the creation of streams regardless of the high chance they will fail.
70 bool respect_goaway_; 80 bool respect_goaway_;
71 81
72 DISALLOW_COPY_AND_ASSIGN(QuicClientSession); 82 DISALLOW_COPY_AND_ASSIGN(QuicClientSession);
73 }; 83 };
74 84
75 } // namespace tools 85 } // namespace tools
76 } // namespace net 86 } // namespace net
77 87
78 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_ 88 #endif // NET_TOOLS_QUIC_QUIC_CLIENT_SESSION_H_
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_client_stream.cc ('k') | net/tools/quic/quic_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698