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

Unified Diff: net/quic/core/quic_config.cc

Issue 2505223004: Delete unused QuicNegotiableTag class. No behavior change. (Closed)
Patch Set: Created 4 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/core/quic_config.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_config.cc
diff --git a/net/quic/core/quic_config.cc b/net/quic/core/quic_config.cc
index 5a3bccbd90d2350fad5b4f509d6ddeae5c144e6f..784add587329a3858d5828bf338fdbe4d4d00a0c 100644
--- a/net/quic/core/quic_config.cc
+++ b/net/quic/core/quic_config.cc
@@ -114,91 +114,6 @@ QuicErrorCode QuicNegotiableUint32::ProcessPeerHello(
return QUIC_NO_ERROR;
}
-QuicNegotiableTag::QuicNegotiableTag(QuicTag tag, QuicConfigPresence presence)
- : QuicNegotiableValue(tag, presence),
- negotiated_tag_(0),
- default_value_(0) {}
-
-QuicNegotiableTag::~QuicNegotiableTag() {}
-
-void QuicNegotiableTag::set(const QuicTagVector& possible,
- QuicTag default_value) {
- DCHECK(ContainsQuicTag(possible, default_value));
- possible_values_ = possible;
- default_value_ = default_value;
-}
-
-void QuicNegotiableTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
- if (negotiated()) {
- // Because of the way we serialize and parse handshake messages we can
- // serialize this as value and still parse it as a vector.
- out->SetValue(tag_, negotiated_tag_);
- } else {
- out->SetVector(tag_, possible_values_);
- }
-}
-
-QuicErrorCode QuicNegotiableTag::ReadVector(const CryptoHandshakeMessage& msg,
- const QuicTag** out,
- size_t* out_length,
- string* error_details) const {
- DCHECK(error_details != nullptr);
- QuicErrorCode error = msg.GetTaglist(tag_, out, out_length);
- switch (error) {
- case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
- if (presence_ == PRESENCE_REQUIRED) {
- *error_details = "Missing " + QuicUtils::TagToString(tag_);
- break;
- }
- error = QUIC_NO_ERROR;
- *out_length = 1;
- *out = &default_value_;
-
- case QUIC_NO_ERROR:
- break;
- default:
- *error_details = "Bad " + QuicUtils::TagToString(tag_);
- break;
- }
- return error;
-}
-
-QuicErrorCode QuicNegotiableTag::ProcessPeerHello(
- const CryptoHandshakeMessage& peer_hello,
- HelloType hello_type,
- string* error_details) {
- DCHECK(!negotiated());
- DCHECK(error_details != nullptr);
- const QuicTag* received_tags;
- size_t received_tags_length;
- QuicErrorCode error = ReadVector(peer_hello, &received_tags,
- &received_tags_length, error_details);
- if (error != QUIC_NO_ERROR) {
- return error;
- }
-
- if (hello_type == SERVER) {
- if (received_tags_length != 1 ||
- !ContainsQuicTag(possible_values_, *received_tags)) {
- *error_details = "Invalid " + QuicUtils::TagToString(tag_);
- return QUIC_INVALID_NEGOTIATED_VALUE;
- }
- negotiated_tag_ = *received_tags;
- } else {
- QuicTag negotiated_tag;
- if (!QuicUtils::FindMutualTag(
- possible_values_, received_tags, received_tags_length,
- QuicUtils::LOCAL_PRIORITY, &negotiated_tag, nullptr)) {
- *error_details = "Unsupported " + QuicUtils::TagToString(tag_);
- return QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP;
- }
- negotiated_tag_ = negotiated_tag;
- }
-
- set_negotiated(true);
- return QUIC_NO_ERROR;
-}
-
QuicFixedUint32::QuicFixedUint32(QuicTag tag, QuicConfigPresence presence)
: QuicConfigValue(tag, presence),
has_send_value_(false),
« no previous file with comments | « net/quic/core/quic_config.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698