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

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

Issue 2325733004: Makes QuicChromiumPacketWriter use the delegate for interacting with the connection. (Closed)
Patch Set: Nits fixed. Created 4 years, 3 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 #include "net/quic/chromium/quic_chromium_client_session.h" 5 #include "net/quic/chromium/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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after
941 CloseAllObservers(ERR_UNEXPECTED); 941 CloseAllObservers(ERR_UNEXPECTED);
942 NotifyFactoryOfSessionClosedLater(); 942 NotifyFactoryOfSessionClosedLater();
943 } 943 }
944 944
945 void QuicChromiumClientSession::OnSuccessfulVersionNegotiation( 945 void QuicChromiumClientSession::OnSuccessfulVersionNegotiation(
946 const QuicVersion& version) { 946 const QuicVersion& version) {
947 logger_->OnSuccessfulVersionNegotiation(version); 947 logger_->OnSuccessfulVersionNegotiation(version);
948 QuicSpdySession::OnSuccessfulVersionNegotiation(version); 948 QuicSpdySession::OnSuccessfulVersionNegotiation(version);
949 } 949 }
950 950
951 int QuicChromiumClientSession::OnWriteError( 951 int QuicChromiumClientSession::HandleWriteError(
952 int error_code, 952 int error_code,
953 scoped_refptr<StringIOBuffer> packet) { 953 scoped_refptr<StringIOBuffer> packet) {
954 DCHECK(packet != nullptr); 954 DCHECK(packet != nullptr);
955 use_error_code_from_rewrite_ = false; 955 use_error_code_from_rewrite_ = false;
956 if (stream_factory_) { 956 if (stream_factory_) {
957 stream_factory_->MaybeMigrateSingleSession(this, WRITE_ERROR, packet); 957 stream_factory_->MaybeMigrateSingleSession(this, WRITE_ERROR, packet);
958 } 958 }
959 return use_error_code_from_rewrite_ ? error_code_from_rewrite_ : error_code; 959 return use_error_code_from_rewrite_ ? error_code_from_rewrite_ : error_code;
960 } 960 }
961 961
962 void QuicChromiumClientSession::OnWriteError(int error_code) {
963 DCHECK_NE(ERR_IO_PENDING, error_code);
964 DCHECK_GT(0, error_code);
965 connection()->OnWriteError(error_code);
966 }
967
968 void QuicChromiumClientSession::OnWriteUnblocked() {
969 connection()->OnCanWrite();
970 }
971
962 void QuicChromiumClientSession::OnPathDegrading() { 972 void QuicChromiumClientSession::OnPathDegrading() {
963 if (stream_factory_) { 973 if (stream_factory_) {
964 stream_factory_->MaybeMigrateSingleSession(this, EARLY_MIGRATION, nullptr); 974 stream_factory_->MaybeMigrateSingleSession(this, EARLY_MIGRATION, nullptr);
965 } 975 }
966 } 976 }
967 977
968 bool QuicChromiumClientSession::HasOpenDynamicStreams() const { 978 bool QuicChromiumClientSession::HasOpenDynamicStreams() const {
969 return QuicSession::HasOpenDynamicStreams() || 979 return QuicSession::HasOpenDynamicStreams() ||
970 GetNumDrainingOutgoingStreams() > 0; 980 GetNumDrainingOutgoingStreams() > 0;
971 } 981 }
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 } 1237 }
1228 1238
1229 void QuicChromiumClientSession::DeletePromised( 1239 void QuicChromiumClientSession::DeletePromised(
1230 QuicClientPromisedInfo* promised) { 1240 QuicClientPromisedInfo* promised) {
1231 if (IsOpenStream(promised->id())) 1241 if (IsOpenStream(promised->id()))
1232 streams_pushed_and_claimed_count_++; 1242 streams_pushed_and_claimed_count_++;
1233 QuicClientSessionBase::DeletePromised(promised); 1243 QuicClientSessionBase::DeletePromised(promised);
1234 } 1244 }
1235 1245
1236 } // namespace net 1246 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/chromium/quic_chromium_client_session.h ('k') | net/quic/chromium/quic_chromium_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698