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

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

Issue 2393233002: Remove OnDataAvailable() notification when trailers are to be delivered (Closed)
Patch Set: Address Andrei's comments Created 4 years, 2 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_stream.h" 5 #include "net/quic/chromium/quic_chromium_client_stream.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 session_->HandlePromised(id(), promised_id, promise_headers); 130 session_->HandlePromised(id(), promised_id, promise_headers);
131 } 131 }
132 132
133 void QuicChromiumClientStream::OnDataAvailable() { 133 void QuicChromiumClientStream::OnDataAvailable() {
134 if (!FinishedReadingHeaders() || !headers_delivered_) { 134 if (!FinishedReadingHeaders() || !headers_delivered_) {
135 // Buffer the data in the sequencer until the headers have been read. 135 // Buffer the data in the sequencer until the headers have been read.
136 return; 136 return;
137 } 137 }
138 138
139 if (!sequencer()->HasBytesToRead() && !FinishedReadingTrailers()) {
140 // If there is no data to read, wait until either FIN is received or
141 // trailers are delivered.
142 return;
143 }
144
139 // The delegate will read the data via a posted task, and 145 // The delegate will read the data via a posted task, and
140 // will be able to, potentially, read all data which has queued up. 146 // will be able to, potentially, read all data which has queued up.
141 NotifyDelegateOfDataAvailableLater(); 147 NotifyDelegateOfDataAvailableLater();
142 } 148 }
143 149
144 void QuicChromiumClientStream::OnClose() { 150 void QuicChromiumClientStream::OnClose() {
145 if (delegate_) { 151 if (delegate_) {
146 delegate_->OnClose(); 152 delegate_->OnClose();
147 delegate_ = nullptr; 153 delegate_ = nullptr;
148 delegate_tasks_.clear(); 154 delegate_tasks_.clear();
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 322
317 void QuicChromiumClientStream::DisableConnectionMigration() { 323 void QuicChromiumClientStream::DisableConnectionMigration() {
318 can_migrate_ = false; 324 can_migrate_ = false;
319 } 325 }
320 326
321 bool QuicChromiumClientStream::IsFirstStream() { 327 bool QuicChromiumClientStream::IsFirstStream() {
322 return id() == kHeadersStreamId + 2; 328 return id() == kHeadersStreamId + 2;
323 } 329 }
324 330
325 } // namespace net 331 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698