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

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

Issue 2870453002: Make ReleaseStream() take a Delegate (Closed)
Patch Set: quic_chromium_client_session_test.cc 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/chromium/quic_chromium_client_session.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/bidirectional_stream_quic_impl.h" 5 #include "net/quic/chromium/bidirectional_stream_quic_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 } 286 }
287 287
288 void BidirectionalStreamQuicImpl::OnError(int error) { 288 void BidirectionalStreamQuicImpl::OnError(int error) {
289 NotifyError(error); 289 NotifyError(error);
290 } 290 }
291 291
292 void BidirectionalStreamQuicImpl::OnStreamReady(int rv) { 292 void BidirectionalStreamQuicImpl::OnStreamReady(int rv) {
293 DCHECK_NE(ERR_IO_PENDING, rv); 293 DCHECK_NE(ERR_IO_PENDING, rv);
294 DCHECK(rv == OK || !stream_); 294 DCHECK(rv == OK || !stream_);
295 if (rv == OK) { 295 if (rv == OK) {
296 stream_ = session_->ReleaseStream(); 296 stream_ = session_->ReleaseStream(this);
297 stream_->SetDelegate(this);
298 NotifyStreamReady(); 297 NotifyStreamReady();
299 } else { 298 } else {
300 NotifyError(rv); 299 NotifyError(rv);
301 } 300 }
302 } 301 }
303 302
304 void BidirectionalStreamQuicImpl::OnSendDataComplete(int rv) { 303 void BidirectionalStreamQuicImpl::OnSendDataComplete(int rv) {
305 DCHECK(rv == OK || !stream_); 304 DCHECK(rv == OK || !stream_);
306 if (rv == OK) { 305 if (rv == OK) {
307 if (delegate_) 306 if (delegate_)
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 if (!stream_) 338 if (!stream_)
340 return; 339 return;
341 closed_stream_received_bytes_ = stream_->stream_bytes_read(); 340 closed_stream_received_bytes_ = stream_->stream_bytes_read();
342 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); 341 closed_stream_sent_bytes_ = stream_->stream_bytes_written();
343 closed_is_first_stream_ = stream_->IsFirstStream(); 342 closed_is_first_stream_ = stream_->IsFirstStream();
344 stream_->SetDelegate(nullptr); 343 stream_->SetDelegate(nullptr);
345 stream_ = nullptr; 344 stream_ = nullptr;
346 } 345 }
347 346
348 } // namespace net 347 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/chromium/quic_chromium_client_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698