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

Unified Diff: net/tools/quic/quic_client_session.cc

Issue 393953009: Moving the work currently done in the QuicSession constructor to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/tools/quic/quic_client_session.cc
diff --git a/net/tools/quic/quic_client_session.cc b/net/tools/quic/quic_client_session.cc
index aca5418ac377668b25aa06f9710715b062e97634..0e7a7a25ce0eadc303f73b0c3e25a56ca7b6d0c5 100644
--- a/net/tools/quic/quic_client_session.cc
+++ b/net/tools/quic/quic_client_session.cc
@@ -14,18 +14,22 @@ using std::string;
namespace net {
namespace tools {
-QuicClientSession::QuicClientSession(
- const QuicServerId& server_id,
- const QuicConfig& config,
- QuicConnection* connection,
- QuicCryptoClientConfig* crypto_config)
- : QuicClientSessionBase(connection, config),
- crypto_stream_(server_id, this, NULL, crypto_config) {
+QuicClientSession::QuicClientSession(const QuicConfig& config,
+ QuicConnection* connection)
+ : QuicClientSessionBase(connection, config) {
}
QuicClientSession::~QuicClientSession() {
}
+void QuicClientSession::InitializeSession(
+ const QuicServerId& server_id,
+ QuicCryptoClientConfig* crypto_config) {
+ QuicClientSessionBase::InitializeSession();
+ crypto_stream_.reset(
+ new QuicCryptoClientStream(server_id, this, NULL, crypto_config));
+}
+
void QuicClientSession::OnProofValid(
const QuicCryptoClientConfig::CachedState& /*cached*/) {
}
@@ -35,7 +39,7 @@ void QuicClientSession::OnProofVerifyDetailsAvailable(
}
QuicSpdyClientStream* QuicClientSession::CreateOutgoingDataStream() {
- if (!crypto_stream_.encryption_established()) {
+ if (!crypto_stream_->encryption_established()) {
DVLOG(1) << "Encryption not active so no outgoing stream created.";
return NULL;
}
@@ -56,15 +60,16 @@ QuicSpdyClientStream* QuicClientSession::CreateOutgoingDataStream() {
}
QuicCryptoClientStream* QuicClientSession::GetCryptoStream() {
- return &crypto_stream_;
+ return crypto_stream_.get();
}
bool QuicClientSession::CryptoConnect() {
- return crypto_stream_.CryptoConnect();
+ DCHECK(flow_controller());
+ return crypto_stream_->CryptoConnect();
}
int QuicClientSession::GetNumSentClientHellos() const {
- return crypto_stream_.num_sent_client_hellos();
+ return crypto_stream_->num_sent_client_hellos();
}
QuicDataStream* QuicClientSession::CreateIncomingDataStream(

Powered by Google App Engine
This is Rietveld 408576698