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

Unified Diff: net/quic/test_tools/quic_test_packet_maker.cc

Issue 1421853006: Landing Recent QUIC changes until: Fri Oct 30 22:23:58 2015 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/test_tools/quic_session_peer.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/quic_test_packet_maker.cc
diff --git a/net/quic/test_tools/quic_test_packet_maker.cc b/net/quic/test_tools/quic_test_packet_maker.cc
index e3f30fdc9ae7d296e480817aaa89fb2b248381ae..adecf9c30a4089113d2d66948887cf48aec2ede1 100644
--- a/net/quic/test_tools/quic_test_packet_maker.cc
+++ b/net/quic/test_tools/quic_test_packet_maker.cc
@@ -92,10 +92,11 @@ scoped_ptr<QuicEncryptedPacket> QuicTestPacketMaker::MakeAckAndRstPacket(
scoped_ptr<QuicPacket> packet(
BuildUnsizedDataPacket(&framer, header, frames));
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> encrypted(framer.EncryptPayload(
- ENCRYPTION_NONE, header.packet_number, *packet, buffer, kMaxPacketSize));
- EXPECT_TRUE(encrypted != nullptr);
- return scoped_ptr<QuicEncryptedPacket>(encrypted->Clone());
+ size_t encrypted_size = framer.EncryptPayload(
+ ENCRYPTION_NONE, header.packet_number, *packet, buffer, kMaxPacketSize);
+ EXPECT_NE(0u, encrypted_size);
+ QuicEncryptedPacket encrypted(buffer, encrypted_size, false);
+ return scoped_ptr<QuicEncryptedPacket>(encrypted.Clone());
}
scoped_ptr<QuicEncryptedPacket> QuicTestPacketMaker::MakeConnectionClosePacket(
@@ -149,10 +150,11 @@ scoped_ptr<QuicEncryptedPacket> QuicTestPacketMaker::MakeAckPacket(
scoped_ptr<QuicPacket> packet(
BuildUnsizedDataPacket(&framer, header, frames));
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> encrypted(framer.EncryptPayload(
- ENCRYPTION_NONE, header.packet_number, *packet, buffer, kMaxPacketSize));
- EXPECT_TRUE(encrypted != nullptr);
- return scoped_ptr<QuicEncryptedPacket>(encrypted->Clone());
+ size_t encrypted_size = framer.EncryptPayload(
+ ENCRYPTION_NONE, header.packet_number, *packet, buffer, kMaxPacketSize);
+ EXPECT_NE(0u, encrypted_size);
+ QuicEncryptedPacket encrypted(buffer, encrypted_size, false);
+ return scoped_ptr<QuicEncryptedPacket>(encrypted.Clone());
}
// Returns a newly created packet to send kData on stream 1.
@@ -282,10 +284,11 @@ scoped_ptr<QuicEncryptedPacket> QuicTestPacketMaker::MakePacket(
scoped_ptr<QuicPacket> packet(
BuildUnsizedDataPacket(&framer, header, frames));
char buffer[kMaxPacketSize];
- scoped_ptr<QuicEncryptedPacket> encrypted(framer.EncryptPayload(
- ENCRYPTION_NONE, header.packet_number, *packet, buffer, kMaxPacketSize));
- EXPECT_TRUE(encrypted != nullptr);
- return scoped_ptr<QuicEncryptedPacket>(encrypted->Clone());
+ size_t encrypted_size = framer.EncryptPayload(
+ ENCRYPTION_NONE, header.packet_number, *packet, buffer, kMaxPacketSize);
+ EXPECT_NE(0u, encrypted_size);
+ QuicEncryptedPacket encrypted(buffer, encrypted_size, false);
+ return scoped_ptr<QuicEncryptedPacket>(encrypted.Clone());
}
void QuicTestPacketMaker::InitializeHeader(QuicPacketNumber packet_number,
« no previous file with comments | « net/quic/test_tools/quic_session_peer.cc ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698