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

Unified Diff: net/quic/crypto/crypto_framer.cc

Issue 921883003: Change QuicFramer so it accepts a QuicDataWriter rather than allocating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Deprecate_flag_quic_use_std_cbrt
Patch Set: 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 | « no previous file | net/quic/quic_data_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/crypto_framer.cc
diff --git a/net/quic/crypto/crypto_framer.cc b/net/quic/crypto/crypto_framer.cc
index 79e17edbf1b79beffe1d6382d81f135f28c89461..196883765a412ed68511490cb00c362f5183531c 100644
--- a/net/quic/crypto/crypto_framer.cc
+++ b/net/quic/crypto/crypto_framer.cc
@@ -106,8 +106,8 @@ QuicData* CryptoFramer::ConstructHandshakeMessage(
return nullptr;
}
-
- QuicDataWriter writer(len);
+ scoped_ptr<char[]> buffer(new char[len]);
+ QuicDataWriter writer(len, buffer.get());
if (!writer.WriteUInt32(message.tag())) {
DCHECK(false) << "Failed to write message tag.";
return nullptr;
@@ -181,7 +181,7 @@ QuicData* CryptoFramer::ConstructHandshakeMessage(
}
}
- return new QuicData(writer.take(), len, true);
+ return new QuicData(buffer.release(), len, true);
}
void CryptoFramer::Clear() {
« no previous file with comments | « no previous file | net/quic/quic_data_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698