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

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

Issue 2862563003: Landing Recent QUIC changes until Sat Apr 29 00:22:04 2017 +0000 (Closed)
Patch Set: rebase and fix test bugs detected by swarm bot. Created 3 years, 7 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
« no previous file with comments | « net/tools/quic/quic_client_session.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d1808d729767396370277f69f5a84898bbcf16c5..a7408da68946cd7ca14608919414005dad5812aa 100644
--- a/net/tools/quic/quic_client_session.cc
+++ b/net/tools/quic/quic_client_session.cc
@@ -8,6 +8,7 @@
#include "net/quic/chromium/crypto/proof_verifier_chromium.h"
#include "net/quic/core/crypto/crypto_protocol.h"
#include "net/quic/core/quic_server_id.h"
+#include "net/quic/core/spdy_utils.h"
#include "net/quic/platform/api/quic_bug_tracker.h"
#include "net/quic/platform/api/quic_logging.h"
#include "net/quic/platform/api/quic_ptr_util.h"
@@ -25,8 +26,7 @@ QuicClientSession::QuicClientSession(
QuicClientPushPromiseIndex* push_promise_index)
: QuicClientSessionBase(connection, push_promise_index, config),
server_id_(server_id),
- crypto_config_(crypto_config),
- respect_goaway_(true) {}
+ crypto_config_(crypto_config) {}
QuicClientSession::~QuicClientSession() {}
@@ -42,6 +42,7 @@ void QuicClientSession::OnProofVerifyDetailsAvailable(
const ProofVerifyDetails& /*verify_details*/) {}
bool QuicClientSession::ShouldCreateOutgoingDynamicStream() {
+ DCHECK(!FLAGS_quic_reloadable_flag_quic_refactor_stream_creation);
if (!crypto_stream_->encryption_established()) {
QUIC_DLOG(INFO) << "Encryption not active so no outgoing stream created.";
return false;
@@ -51,7 +52,7 @@ bool QuicClientSession::ShouldCreateOutgoingDynamicStream() {
<< "Already " << GetNumOpenOutgoingStreams() << " open.";
return false;
}
- if (goaway_received() && respect_goaway_) {
+ if (goaway_received() && respect_goaway()) {
QUIC_DLOG(INFO) << "Failed to create a new outgoing stream. "
<< "Already received goaway.";
return false;
@@ -97,11 +98,12 @@ int QuicClientSession::GetNumReceivedServerConfigUpdates() const {
}
bool QuicClientSession::ShouldCreateIncomingDynamicStream(QuicStreamId id) {
+ DCHECK(!FLAGS_quic_reloadable_flag_quic_refactor_stream_creation);
if (!connection()->connected()) {
QUIC_BUG << "ShouldCreateIncomingDynamicStream called when disconnected";
return false;
}
- if (goaway_received() && respect_goaway_) {
+ if (goaway_received() && respect_goaway()) {
QUIC_DLOG(INFO) << "Failed to create a new outgoing stream. "
<< "Already received goaway.";
return false;
@@ -138,4 +140,25 @@ bool QuicClientSession::IsAuthorized(const string& authority) {
return true;
}
+QuicSpdyClientStream* QuicClientSession::MaybeCreateOutgoingDynamicStream(
+ SpdyPriority priority) {
+ return static_cast<QuicSpdyClientStream*>(
+ QuicSpdySession::MaybeCreateOutgoingDynamicStream(priority));
+}
+
+QuicSpdyStream* QuicClientSession::MaybeCreateIncomingDynamicStream(
+ QuicStreamId id) {
+ QuicSpdyStream* stream =
+ QuicSpdySession::MaybeCreateIncomingDynamicStream(id);
+ if (stream) {
+ // Push streams start half-closed.
+ stream->CloseWriteSide();
+ }
+ return stream;
+}
+
+std::unique_ptr<QuicStream> QuicClientSession::CreateStream(QuicStreamId id) {
+ return QuicMakeUnique<QuicSpdyClientStream>(id, this);
+}
+
} // namespace net
« no previous file with comments | « net/tools/quic/quic_client_session.h ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698