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

Unified Diff: net/quic/quic_framer_test.cc

Issue 912163002: Change the QuicEncrypter to accept a pre-allocated buffer instead of (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Change_QuicPacketCreator_85897935
Patch Set: Reverting logging changes Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_framer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer_test.cc
diff --git a/net/quic/quic_framer_test.cc b/net/quic/quic_framer_test.cc
index 678e69dd90ef4dbb45991e4887266e9eb1a1d8f2..07a351073cd0e3a48266962895798572f5618f47 100644
--- a/net/quic/quic_framer_test.cc
+++ b/net/quic/quic_framer_test.cc
@@ -113,13 +113,18 @@ class TestEncrypter : public QuicEncrypter {
CHECK(false) << "Not implemented";
return false;
}
- QuicData* EncryptPacket(QuicPacketSequenceNumber sequence_number,
- StringPiece associated_data,
- StringPiece plaintext) override {
+ bool EncryptPacket(QuicPacketSequenceNumber sequence_number,
+ StringPiece associated_data,
+ StringPiece plaintext,
+ char* output,
+ size_t* output_length,
+ size_t max_output_length) override {
sequence_number_ = sequence_number;
associated_data_ = associated_data.as_string();
plaintext_ = plaintext.as_string();
- return new QuicData(plaintext.data(), plaintext.length());
+ memcpy(output, plaintext.data(), plaintext.length());
+ *output_length = plaintext.length();
+ return true;
}
size_t GetKeySize() const override { return 0; }
size_t GetNoncePrefixSize() const override { return 0; }
« no previous file with comments | « net/quic/quic_framer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698