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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
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 | « net/quic/crypto/chacha20_poly1305_decrypter_test.cc ('k') | net/quic/crypto/crypto_secret_boxer.cc » ('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..7f81f3639775c24e15b2e515a6a80ae5cd34d4d3 100644
--- a/net/quic/crypto/crypto_framer.cc
+++ b/net/quic/crypto/crypto_framer.cc
@@ -9,7 +9,6 @@
#include "net/quic/quic_data_writer.h"
using base::StringPiece;
-using std::make_pair;
using std::pair;
using std::vector;
@@ -106,8 +105,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 +180,7 @@ QuicData* CryptoFramer::ConstructHandshakeMessage(
}
}
- return new QuicData(writer.take(), len, true);
+ return new QuicData(buffer.release(), len, true);
}
void CryptoFramer::Clear() {
@@ -242,8 +241,8 @@ QuicErrorCode CryptoFramer::Process(StringPiece input) {
if (end_offset < last_end_offset) {
return QUIC_CRYPTO_TAGS_OUT_OF_ORDER;
}
- tags_and_lengths_.push_back(
- make_pair(tag, static_cast<size_t>(end_offset - last_end_offset)));
+ tags_and_lengths_.push_back(std::make_pair(
+ tag, static_cast<size_t>(end_offset - last_end_offset)));
last_end_offset = end_offset;
}
values_len_ = last_end_offset;
« no previous file with comments | « net/quic/crypto/chacha20_poly1305_decrypter_test.cc ('k') | net/quic/crypto/crypto_secret_boxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698