| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/quic/quic_config.h" | 5 #include "net/quic/quic_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "net/quic/crypto/crypto_handshake_message.h" | 10 #include "net/quic/crypto/crypto_handshake_message.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 | 125 |
| 126 QuicNegotiableTag::~QuicNegotiableTag() {} | 126 QuicNegotiableTag::~QuicNegotiableTag() {} |
| 127 | 127 |
| 128 void QuicNegotiableTag::set(const QuicTagVector& possible, | 128 void QuicNegotiableTag::set(const QuicTagVector& possible, |
| 129 QuicTag default_value) { | 129 QuicTag default_value) { |
| 130 DCHECK(ContainsQuicTag(possible, default_value)); | 130 DCHECK(ContainsQuicTag(possible, default_value)); |
| 131 possible_values_ = possible; | 131 possible_values_ = possible; |
| 132 default_value_ = default_value; | 132 default_value_ = default_value; |
| 133 } | 133 } |
| 134 | 134 |
| 135 QuicTag QuicNegotiableTag::GetTag() const { | |
| 136 if (negotiated()) { | |
| 137 return negotiated_tag_; | |
| 138 } | |
| 139 return default_value_; | |
| 140 } | |
| 141 | |
| 142 void QuicNegotiableTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const { | 135 void QuicNegotiableTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const { |
| 143 if (negotiated()) { | 136 if (negotiated()) { |
| 144 // Because of the way we serialize and parse handshake messages we can | 137 // Because of the way we serialize and parse handshake messages we can |
| 145 // serialize this as value and still parse it as a vector. | 138 // serialize this as value and still parse it as a vector. |
| 146 out->SetValue(tag_, negotiated_tag_); | 139 out->SetValue(tag_, negotiated_tag_); |
| 147 } else { | 140 } else { |
| 148 out->SetVector(tag_, possible_values_); | 141 out->SetVector(tag_, possible_values_); |
| 149 } | 142 } |
| 150 } | 143 } |
| 151 | 144 |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 peer_hello, hello_type, error_details); | 595 peer_hello, hello_type, error_details); |
| 603 } | 596 } |
| 604 if (error == QUIC_NO_ERROR) { | 597 if (error == QUIC_NO_ERROR) { |
| 605 error = connection_options_.ProcessPeerHello( | 598 error = connection_options_.ProcessPeerHello( |
| 606 peer_hello, hello_type, error_details); | 599 peer_hello, hello_type, error_details); |
| 607 } | 600 } |
| 608 return error; | 601 return error; |
| 609 } | 602 } |
| 610 | 603 |
| 611 } // namespace net | 604 } // namespace net |
| OLD | NEW |