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

Side by Side Diff: net/quic/quic_chromium_client_session.cc

Issue 1692253004: QUIC - chromium server push support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review feedback round 2. Created 4 years, 9 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
« no previous file with comments | « net/quic/quic_chromium_client_session.h ('k') | net/quic/quic_client_promised_info_test.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 #include "net/quic/quic_chromium_client_session.h" 5 #include "net/quic/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 SSLInfo ssl_info; 615 SSLInfo ssl_info;
616 if (!GetSSLInfo(&ssl_info) || !ssl_info.cert.get()) { 616 if (!GetSSLInfo(&ssl_info) || !ssl_info.cert.get()) {
617 NOTREACHED() << "QUIC should always have certificates."; 617 NOTREACHED() << "QUIC should always have certificates.";
618 return false; 618 return false;
619 } 619 }
620 620
621 return SpdySession::CanPool(transport_security_state_, ssl_info, 621 return SpdySession::CanPool(transport_security_state_, ssl_info,
622 server_id_.host(), hostname); 622 server_id_.host(), hostname);
623 } 623 }
624 624
625 QuicSpdyStream* QuicChromiumClientSession::CreateIncomingDynamicStream( 625 QuicChromiumClientStream*
626 QuicStreamId id) { 626 QuicChromiumClientSession::CreateIncomingDynamicStream(QuicStreamId id) {
627 DLOG(ERROR) << "Server push not supported"; 627 if (!connection()->connected()) {
628 return nullptr; 628 LOG(DFATAL) << "ShouldCreateIncomingDynamicStream called when disconnected";
629 return nullptr;
630 }
631 if (goaway_received()) {
632 DVLOG(1) << "Failed to create a new outgoing stream. "
633 << "Already received goaway.";
634 return nullptr;
635 }
636 if (going_away_) {
637 return nullptr;
638 }
639 if (id % 2 != 0) {
640 LOG(WARNING) << "Received invalid push stream id " << id;
641 connection()->SendConnectionCloseWithDetails(
642 QUIC_INVALID_STREAM_ID, "Server created odd numbered stream");
643 return nullptr;
644 }
645 return CreateIncomingReliableStreamImpl(id);
646 }
647
648 QuicChromiumClientStream*
649 QuicChromiumClientSession::CreateIncomingReliableStreamImpl(QuicStreamId id) {
650 DCHECK(connection()->connected());
651 QuicChromiumClientStream* stream =
652 new QuicChromiumClientStream(id, this, net_log_);
653 stream->CloseWriteSide();
654 ++num_total_streams_;
655 return stream;
629 } 656 }
630 657
631 void QuicChromiumClientSession::CloseStream(QuicStreamId stream_id) { 658 void QuicChromiumClientSession::CloseStream(QuicStreamId stream_id) {
632 ReliableQuicStream* stream = GetStream(stream_id); 659 ReliableQuicStream* stream = GetStream(stream_id);
633 if (stream) { 660 if (stream) {
634 logger_->UpdateReceivedFrameCounts(stream_id, stream->num_frames_received(), 661 logger_->UpdateReceivedFrameCounts(stream_id, stream->num_frames_received(),
635 stream->num_duplicate_frames_received()); 662 stream->num_duplicate_frames_received());
636 } 663 }
637 QuicSpdySession::CloseStream(stream_id); 664 QuicSpdySession::CloseStream(stream_id);
638 OnClosedStream(); 665 OnClosedStream();
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
1075 DCHECK(sockets_.back().get() != nullptr); 1102 DCHECK(sockets_.back().get() != nullptr);
1076 // The most recently added socket is the currently active one. 1103 // The most recently added socket is the currently active one.
1077 return sockets_.back().get(); 1104 return sockets_.back().get();
1078 } 1105 }
1079 1106
1080 bool QuicChromiumClientSession::IsAuthorized(const std::string& hostname) { 1107 bool QuicChromiumClientSession::IsAuthorized(const std::string& hostname) {
1081 return CanPool(hostname, server_id_.privacy_mode()); 1108 return CanPool(hostname, server_id_.privacy_mode());
1082 } 1109 }
1083 1110
1084 } // namespace net 1111 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_chromium_client_session.h ('k') | net/quic/quic_client_promised_info_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698