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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 2002083002: Add QuicSentPacketManagerInterface, and QuicSentPacketManager implements it. No functional change e… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/end_to_end_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/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/sha1.h" 9 #include "base/sha1.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 PacketSavingConnection::~PacketSavingConnection() { 331 PacketSavingConnection::~PacketSavingConnection() {
332 STLDeleteElements(&encrypted_packets_); 332 STLDeleteElements(&encrypted_packets_);
333 } 333 }
334 334
335 void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) { 335 void PacketSavingConnection::SendOrQueuePacket(SerializedPacket* packet) {
336 encrypted_packets_.push_back(new QuicEncryptedPacket( 336 encrypted_packets_.push_back(new QuicEncryptedPacket(
337 QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true)); 337 QuicUtils::CopyBuffer(*packet), packet->encrypted_length, true));
338 // Transfer ownership of the packet to the SentPacketManager and the 338 // Transfer ownership of the packet to the SentPacketManager and the
339 // ack notifier to the AckNotifierManager. 339 // ack notifier to the AckNotifierManager.
340 sent_packet_manager_.OnPacketSent(packet, kInvalidPathId, 0, QuicTime::Zero(), 340 sent_packet_manager_->OnPacketSent(packet, kInvalidPathId, 0,
341 NOT_RETRANSMISSION, 341 QuicTime::Zero(), NOT_RETRANSMISSION,
342 HAS_RETRANSMITTABLE_DATA); 342 HAS_RETRANSMITTABLE_DATA);
343 } 343 }
344 344
345 MockQuicSession::MockQuicSession(QuicConnection* connection) 345 MockQuicSession::MockQuicSession(QuicConnection* connection)
346 : QuicSession(connection, DefaultQuicConfig()) { 346 : QuicSession(connection, DefaultQuicConfig()) {
347 crypto_stream_.reset(new QuicCryptoStream(this)); 347 crypto_stream_.reset(new QuicCryptoStream(this));
348 Initialize(); 348 Initialize();
349 ON_CALL(*this, WritevData(_, _, _, _, _, _)) 349 ON_CALL(*this, WritevData(_, _, _, _, _, _))
350 .WillByDefault(testing::Return(QuicConsumedData(0, false))); 350 .WillByDefault(testing::Return(QuicConsumedData(0, false)));
351 } 351 }
352 352
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 // strike register worries that we've just overflowed a uint32_t time. 884 // strike register worries that we've just overflowed a uint32_t time.
885 (*server_connection)->AdvanceTime(connection_start_time); 885 (*server_connection)->AdvanceTime(connection_start_time);
886 } 886 }
887 887
888 QuicStreamId QuicClientDataStreamId(int i) { 888 QuicStreamId QuicClientDataStreamId(int i) {
889 return kClientDataStreamId1 + 2 * i; 889 return kClientDataStreamId1 + 2 * i;
890 } 890 }
891 891
892 } // namespace test 892 } // namespace test
893 } // namespace net 893 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698