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

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

Issue 1119803006: Revert of Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/base/chunked_upload_data_stream.h" 9 #include "net/base/chunked_upload_data_stream.h"
10 #include "net/base/elements_upload_data_stream.h" 10 #include "net/base/elements_upload_data_stream.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void AddWrite(scoped_ptr<QuicEncryptedPacket> packet) { 155 void AddWrite(scoped_ptr<QuicEncryptedPacket> packet) {
156 writes_.push_back(PacketToWrite(SYNCHRONOUS, packet.release())); 156 writes_.push_back(PacketToWrite(SYNCHRONOUS, packet.release()));
157 } 157 }
158 158
159 // Returns the packet to be written at position |pos|. 159 // Returns the packet to be written at position |pos|.
160 QuicEncryptedPacket* GetWrite(size_t pos) { 160 QuicEncryptedPacket* GetWrite(size_t pos) {
161 return writes_[pos].packet; 161 return writes_[pos].packet;
162 } 162 }
163 163
164 bool AtEof() { 164 bool AtEof() {
165 return socket_data_->AllReadDataConsumed() && 165 return socket_data_->at_read_eof() && socket_data_->at_write_eof();
166 socket_data_->AllWriteDataConsumed();
167 } 166 }
168 167
169 void ProcessPacket(scoped_ptr<QuicEncryptedPacket> packet) { 168 void ProcessPacket(scoped_ptr<QuicEncryptedPacket> packet) {
170 connection_->ProcessUdpPacket(self_addr_, peer_addr_, *packet); 169 connection_->ProcessUdpPacket(self_addr_, peer_addr_, *packet);
171 } 170 }
172 171
173 // Configures the test fixture to use the list of expected writes. 172 // Configures the test fixture to use the list of expected writes.
174 void Initialize() { 173 void Initialize() {
175 mock_writes_.reset(new MockWrite[writes_.size()]); 174 mock_writes_.reset(new MockWrite[writes_.size()]);
176 for (size_t i = 0; i < writes_.size(); i++) { 175 for (size_t i = 0; i < writes_.size(); i++) {
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 // Set Delegate to nullptr and make sure EffectivePriority returns highest 752 // Set Delegate to nullptr and make sure EffectivePriority returns highest
754 // priority. 753 // priority.
755 reliable_stream->SetDelegate(nullptr); 754 reliable_stream->SetDelegate(nullptr);
756 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority, 755 DCHECK_EQ(QuicWriteBlockedList::kHighestPriority,
757 reliable_stream->EffectivePriority()); 756 reliable_stream->EffectivePriority());
758 reliable_stream->SetDelegate(delegate); 757 reliable_stream->SetDelegate(delegate);
759 } 758 }
760 759
761 } // namespace test 760 } // namespace test
762 } // namespace net 761 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_network_transaction_unittest.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698