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

Unified Diff: net/quic/core/crypto/crypto_handshake_message.cc

Issue 2907743003: Change CryptoHandshakeMessage::GetTaglist to tag a QuicTagVector* (Closed)
Patch Set: fix QuicConfig Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/crypto/crypto_handshake_message.h ('k') | net/quic/core/crypto/crypto_server_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/crypto_handshake_message.cc
diff --git a/net/quic/core/crypto/crypto_handshake_message.cc b/net/quic/core/crypto/crypto_handshake_message.cc
index 220c46adfc0d3e2e9551e88adab078dd1afac6d7..0d0813abb843e9570f0ac517458689809a476c47 100644
--- a/net/quic/core/crypto/crypto_handshake_message.cc
+++ b/net/quic/core/crypto/crypto_handshake_message.cc
@@ -79,9 +79,9 @@ void CryptoHandshakeMessage::Erase(QuicTag tag) {
tag_value_map_.erase(tag);
}
-QuicErrorCode CryptoHandshakeMessage::GetTaglist(QuicTag tag,
- const QuicTag** out_tags,
- size_t* out_len) const {
+QuicErrorCode CryptoHandshakeMessage::GetTaglist(
+ QuicTag tag,
+ QuicTagVector* out_tags) const {
QuicTagValueMap::const_iterator it = tag_value_map_.find(tag);
QuicErrorCode ret = QUIC_NO_ERROR;
@@ -92,13 +92,17 @@ QuicErrorCode CryptoHandshakeMessage::GetTaglist(QuicTag tag,
}
if (ret != QUIC_NO_ERROR) {
- *out_tags = nullptr;
- *out_len = 0;
+ out_tags->clear();
return ret;
}
- *out_tags = reinterpret_cast<const QuicTag*>(it->second.data());
- *out_len = it->second.size() / sizeof(QuicTag);
+ size_t num_tags = it->second.size() / sizeof(QuicTag);
+ out_tags->resize(num_tags);
+ for (size_t i = 0; i < num_tags; ++i) {
+ QuicTag tag;
+ memcpy(&tag, it->second.data() + i * sizeof(tag), sizeof(tag));
Nico 2017/06/12 20:32:31 A few short weeks later, I suddenly remembered thi
Ryan Hamilton 2017/06/12 20:48:41 Ooo! That's good to know. We can depend on base (t
+ (*out_tags)[i] = tag;
+ }
return ret;
}
« no previous file with comments | « net/quic/core/crypto/crypto_handshake_message.h ('k') | net/quic/core/crypto/crypto_server_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698