| Index: net/quic/quic_config.cc
|
| diff --git a/net/quic/quic_config.cc b/net/quic/quic_config.cc
|
| index 9c606714ecefd0225acd658a8387abebc5fa83cc..298e2802fb15c6bbe92855ddb3b70b4a75c47243 100644
|
| --- a/net/quic/quic_config.cc
|
| +++ b/net/quic/quic_config.cc
|
| @@ -47,28 +47,25 @@ QuicErrorCode ReadUint32(const CryptoHandshakeMessage& msg,
|
| return error;
|
| }
|
|
|
| -
|
| -QuicConfigValue::QuicConfigValue(QuicTag tag,
|
| - QuicConfigPresence presence)
|
| - : tag_(tag),
|
| - presence_(presence) {
|
| +QuicConfigValue::QuicConfigValue(QuicTag tag, QuicConfigPresence presence)
|
| + : tag_(tag), presence_(presence) {
|
| +}
|
| +QuicConfigValue::~QuicConfigValue() {
|
| }
|
| -QuicConfigValue::~QuicConfigValue() {}
|
|
|
| QuicNegotiableValue::QuicNegotiableValue(QuicTag tag,
|
| QuicConfigPresence presence)
|
| - : QuicConfigValue(tag, presence),
|
| - negotiated_(false) {
|
| + : QuicConfigValue(tag, presence), negotiated_(false) {
|
| +}
|
| +QuicNegotiableValue::~QuicNegotiableValue() {
|
| }
|
| -QuicNegotiableValue::~QuicNegotiableValue() {}
|
|
|
| QuicNegotiableUint32::QuicNegotiableUint32(QuicTag tag,
|
| QuicConfigPresence presence)
|
| - : QuicNegotiableValue(tag, presence),
|
| - max_value_(0),
|
| - default_value_(0) {
|
| + : QuicNegotiableValue(tag, presence), max_value_(0), default_value_(0) {
|
| +}
|
| +QuicNegotiableUint32::~QuicNegotiableUint32() {
|
| }
|
| -QuicNegotiableUint32::~QuicNegotiableUint32() {}
|
|
|
| void QuicNegotiableUint32::set(uint32 max, uint32 default_value) {
|
| DCHECK_LE(default_value, max);
|
| @@ -99,18 +96,14 @@ QuicErrorCode QuicNegotiableUint32::ProcessPeerHello(
|
| DCHECK(!negotiated_);
|
| DCHECK(error_details != NULL);
|
| uint32 value;
|
| - QuicErrorCode error = ReadUint32(peer_hello,
|
| - tag_,
|
| - presence_,
|
| - default_value_,
|
| - &value,
|
| - error_details);
|
| + QuicErrorCode error = ReadUint32(
|
| + peer_hello, tag_, presence_, default_value_, &value, error_details);
|
| if (error != QUIC_NO_ERROR) {
|
| return error;
|
| }
|
| if (hello_type == SERVER && value > max_value_) {
|
| - *error_details = "Invalid value received for " +
|
| - QuicUtils::TagToString(tag_);
|
| + *error_details =
|
| + "Invalid value received for " + QuicUtils::TagToString(tag_);
|
| return QUIC_INVALID_NEGOTIATED_VALUE;
|
| }
|
|
|
| @@ -125,12 +118,13 @@ QuicNegotiableTag::QuicNegotiableTag(QuicTag tag, QuicConfigPresence presence)
|
| default_value_(0) {
|
| }
|
|
|
| -QuicNegotiableTag::~QuicNegotiableTag() {}
|
| +QuicNegotiableTag::~QuicNegotiableTag() {
|
| +}
|
|
|
| void QuicNegotiableTag::set(const QuicTagVector& possible,
|
| QuicTag default_value) {
|
| DCHECK(std::find(possible.begin(), possible.end(), default_value) !=
|
| - possible.end());
|
| + possible.end());
|
| possible_values_ = possible;
|
| default_value_ = default_value;
|
| }
|
| @@ -152,11 +146,10 @@ void QuicNegotiableTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
|
| }
|
| }
|
|
|
| -QuicErrorCode QuicNegotiableTag::ReadVector(
|
| - const CryptoHandshakeMessage& msg,
|
| - const QuicTag** out,
|
| - size_t* out_length,
|
| - string* error_details) const {
|
| +QuicErrorCode QuicNegotiableTag::ReadVector(const CryptoHandshakeMessage& msg,
|
| + const QuicTag** out,
|
| + size_t* out_length,
|
| + string* error_details) const {
|
| DCHECK(error_details != NULL);
|
| QuicErrorCode error = msg.GetTaglist(tag_, out, out_length);
|
| switch (error) {
|
| @@ -186,15 +179,16 @@ QuicErrorCode QuicNegotiableTag::ProcessPeerHello(
|
| DCHECK(error_details != NULL);
|
| const QuicTag* received_tags;
|
| size_t received_tags_length;
|
| - QuicErrorCode error = ReadVector(peer_hello, &received_tags,
|
| - &received_tags_length, error_details);
|
| + 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 ||
|
| - std::find(possible_values_.begin(), possible_values_.end(),
|
| + std::find(possible_values_.begin(),
|
| + possible_values_.end(),
|
| *received_tags) == possible_values_.end()) {
|
| *error_details = "Invalid " + QuicUtils::TagToString(tag_);
|
| return QUIC_INVALID_NEGOTIATED_VALUE;
|
| @@ -223,7 +217,8 @@ QuicFixedUint32::QuicFixedUint32(QuicTag tag, QuicConfigPresence presence)
|
| has_send_value_(false),
|
| has_receive_value_(false) {
|
| }
|
| -QuicFixedUint32::~QuicFixedUint32() {}
|
| +QuicFixedUint32::~QuicFixedUint32() {
|
| +}
|
|
|
| bool QuicFixedUint32::HasSendValue() const {
|
| return has_send_value_;
|
| @@ -284,14 +279,14 @@ QuicErrorCode QuicFixedUint32::ProcessPeerHello(
|
| return error;
|
| }
|
|
|
| -QuicFixedTag::QuicFixedTag(QuicTag name,
|
| - QuicConfigPresence presence)
|
| +QuicFixedTag::QuicFixedTag(QuicTag name, QuicConfigPresence presence)
|
| : QuicConfigValue(name, presence),
|
| has_send_value_(false),
|
| has_receive_value_(false) {
|
| }
|
|
|
| -QuicFixedTag::~QuicFixedTag() {}
|
| +QuicFixedTag::~QuicFixedTag() {
|
| +}
|
|
|
| bool QuicFixedTag::HasSendValue() const {
|
| return has_send_value_;
|
| @@ -366,11 +361,11 @@ QuicConfig::QuicConfig()
|
| initial_flow_control_window_bytes_(kIFCW, PRESENCE_OPTIONAL) {
|
| }
|
|
|
| -QuicConfig::~QuicConfig() {}
|
| +QuicConfig::~QuicConfig() {
|
| +}
|
|
|
| -void QuicConfig::set_congestion_control(
|
| - const QuicTagVector& congestion_control,
|
| - QuicTag default_congestion_control) {
|
| +void QuicConfig::set_congestion_control(const QuicTagVector& congestion_control,
|
| + QuicTag default_congestion_control) {
|
| congestion_control_.set(congestion_control, default_congestion_control);
|
| }
|
|
|
| @@ -404,8 +399,7 @@ QuicTime::Delta QuicConfig::idle_connection_state_lifetime() const {
|
| }
|
|
|
| QuicTime::Delta QuicConfig::keepalive_timeout() const {
|
| - return QuicTime::Delta::FromSeconds(
|
| - keepalive_timeout_seconds_.GetUint32());
|
| + return QuicTime::Delta::FromSeconds(keepalive_timeout_seconds_.GetUint32());
|
| }
|
|
|
| void QuicConfig::set_max_streams_per_connection(size_t max_streams,
|
| @@ -455,7 +449,8 @@ void QuicConfig::SetInitialFlowControlWindowToSend(uint32 window_bytes) {
|
| }
|
|
|
| bool QuicConfig::HasReceivedInitialFlowControlWindowBytes() const {
|
| - return initial_flow_control_window_bytes_.HasReceivedValue();;
|
| + return initial_flow_control_window_bytes_.HasReceivedValue();
|
| + ;
|
| }
|
|
|
| uint32 QuicConfig::ReceivedInitialFlowControlWindowBytes() const {
|
| @@ -467,9 +462,9 @@ bool QuicConfig::negotiated() {
|
| // of them in negotiated, ToHandshakeMessage, ProcessClientHello, and
|
| // ProcessServerHello.
|
| return congestion_control_.negotiated() &&
|
| - idle_connection_state_lifetime_seconds_.negotiated() &&
|
| - keepalive_timeout_seconds_.negotiated() &&
|
| - max_streams_per_connection_.negotiated();
|
| + idle_connection_state_lifetime_seconds_.negotiated() &&
|
| + keepalive_timeout_seconds_.negotiated() &&
|
| + max_streams_per_connection_.negotiated();
|
| }
|
|
|
| void QuicConfig::SetDefaults() {
|
| @@ -485,8 +480,8 @@ void QuicConfig::SetDefaults() {
|
| keepalive_timeout_seconds_.set(0, 0);
|
| max_streams_per_connection_.set(kDefaultMaxStreamsPerConnection,
|
| kDefaultMaxStreamsPerConnection);
|
| - max_time_before_crypto_handshake_ = QuicTime::Delta::FromSeconds(
|
| - kDefaultMaxTimeForCryptoHandshakeSecs);
|
| + max_time_before_crypto_handshake_ =
|
| + QuicTime::Delta::FromSeconds(kDefaultMaxTimeForCryptoHandshakeSecs);
|
| }
|
|
|
| void QuicConfig::EnablePacing(bool enable_pacing) {
|
| @@ -518,7 +513,7 @@ QuicErrorCode QuicConfig::ProcessPeerHello(
|
| QuicErrorCode error = QUIC_NO_ERROR;
|
| if (error == QUIC_NO_ERROR) {
|
| error = congestion_control_.ProcessPeerHello(
|
| - peer_hello, hello_type, error_details);
|
| + peer_hello, hello_type, error_details);
|
| }
|
| if (error == QUIC_NO_ERROR) {
|
| error = idle_connection_state_lifetime_seconds_.ProcessPeerHello(
|
| @@ -545,8 +540,8 @@ QuicErrorCode QuicConfig::ProcessPeerHello(
|
| peer_hello, hello_type, error_details);
|
| }
|
| if (error == QUIC_NO_ERROR) {
|
| - error = loss_detection_.ProcessPeerHello(
|
| - peer_hello, hello_type, error_details);
|
| + error =
|
| + loss_detection_.ProcessPeerHello(peer_hello, hello_type, error_details);
|
| }
|
| return error;
|
| }
|
|
|