Remove now unneeded AnimateNow calls
[chromium-blink-merge.git] / net / quic / quic_config.cc
blob55ea08271e167a3d43043ce96d3691386ef93f5c
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
3 // found in the LICENSE file.
5 #include "net/quic/quic_config.h"
7 #include <algorithm>
9 #include "base/logging.h"
10 #include "net/quic/crypto/crypto_handshake_message.h"
11 #include "net/quic/crypto/crypto_protocol.h"
12 #include "net/quic/quic_flags.h"
13 #include "net/quic/quic_utils.h"
15 using std::min;
16 using std::string;
18 namespace net {
20 // Reads the value corresponding to |name_| from |msg| into |out|. If the
21 // |name_| is absent in |msg| and |presence| is set to OPTIONAL |out| is set
22 // to |default_value|.
23 QuicErrorCode ReadUint32(const CryptoHandshakeMessage& msg,
24 QuicTag tag,
25 QuicConfigPresence presence,
26 uint32 default_value,
27 uint32* out,
28 string* error_details) {
29 DCHECK(error_details != NULL);
30 QuicErrorCode error = msg.GetUint32(tag, out);
31 switch (error) {
32 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
33 if (presence == PRESENCE_REQUIRED) {
34 *error_details = "Missing " + QuicUtils::TagToString(tag);
35 break;
37 error = QUIC_NO_ERROR;
38 *out = default_value;
39 break;
40 case QUIC_NO_ERROR:
41 break;
42 default:
43 *error_details = "Bad " + QuicUtils::TagToString(tag);
44 break;
46 return error;
50 QuicConfigValue::QuicConfigValue(QuicTag tag,
51 QuicConfigPresence presence)
52 : tag_(tag),
53 presence_(presence) {
55 QuicConfigValue::~QuicConfigValue() {}
57 QuicNegotiableValue::QuicNegotiableValue(QuicTag tag,
58 QuicConfigPresence presence)
59 : QuicConfigValue(tag, presence),
60 negotiated_(false) {
62 QuicNegotiableValue::~QuicNegotiableValue() {}
64 QuicNegotiableUint32::QuicNegotiableUint32(QuicTag tag,
65 QuicConfigPresence presence)
66 : QuicNegotiableValue(tag, presence),
67 max_value_(0),
68 default_value_(0) {
70 QuicNegotiableUint32::~QuicNegotiableUint32() {}
72 void QuicNegotiableUint32::set(uint32 max, uint32 default_value) {
73 DCHECK_LE(default_value, max);
74 max_value_ = max;
75 default_value_ = default_value;
78 uint32 QuicNegotiableUint32::GetUint32() const {
79 if (negotiated_) {
80 return negotiated_value_;
82 return default_value_;
85 void QuicNegotiableUint32::ToHandshakeMessage(
86 CryptoHandshakeMessage* out) const {
87 if (negotiated_) {
88 out->SetValue(tag_, negotiated_value_);
89 } else {
90 out->SetValue(tag_, max_value_);
94 QuicErrorCode QuicNegotiableUint32::ProcessPeerHello(
95 const CryptoHandshakeMessage& peer_hello,
96 HelloType hello_type,
97 string* error_details) {
98 DCHECK(!negotiated_);
99 DCHECK(error_details != NULL);
100 uint32 value;
101 QuicErrorCode error = ReadUint32(peer_hello,
102 tag_,
103 presence_,
104 default_value_,
105 &value,
106 error_details);
107 if (error != QUIC_NO_ERROR) {
108 return error;
110 if (hello_type == SERVER && value > max_value_) {
111 *error_details =
112 "Invalid value received for " + QuicUtils::TagToString(tag_);
113 return QUIC_INVALID_NEGOTIATED_VALUE;
116 negotiated_ = true;
117 negotiated_value_ = min(value, max_value_);
118 return QUIC_NO_ERROR;
121 QuicNegotiableTag::QuicNegotiableTag(QuicTag tag, QuicConfigPresence presence)
122 : QuicNegotiableValue(tag, presence),
123 negotiated_tag_(0),
124 default_value_(0) {
127 QuicNegotiableTag::~QuicNegotiableTag() {}
129 void QuicNegotiableTag::set(const QuicTagVector& possible,
130 QuicTag default_value) {
131 DCHECK(ContainsQuicTag(possible, default_value));
132 possible_values_ = possible;
133 default_value_ = default_value;
136 QuicTag QuicNegotiableTag::GetTag() const {
137 if (negotiated_) {
138 return negotiated_tag_;
140 return default_value_;
143 void QuicNegotiableTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
144 if (negotiated_) {
145 // Because of the way we serialize and parse handshake messages we can
146 // serialize this as value and still parse it as a vector.
147 out->SetValue(tag_, negotiated_tag_);
148 } else {
149 out->SetVector(tag_, possible_values_);
153 QuicErrorCode QuicNegotiableTag::ReadVector(
154 const CryptoHandshakeMessage& msg,
155 const QuicTag** out,
156 size_t* out_length,
157 string* error_details) const {
158 DCHECK(error_details != NULL);
159 QuicErrorCode error = msg.GetTaglist(tag_, out, out_length);
160 switch (error) {
161 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
162 if (presence_ == PRESENCE_REQUIRED) {
163 *error_details = "Missing " + QuicUtils::TagToString(tag_);
164 break;
166 error = QUIC_NO_ERROR;
167 *out_length = 1;
168 *out = &default_value_;
170 case QUIC_NO_ERROR:
171 break;
172 default:
173 *error_details = "Bad " + QuicUtils::TagToString(tag_);
174 break;
176 return error;
179 QuicErrorCode QuicNegotiableTag::ProcessPeerHello(
180 const CryptoHandshakeMessage& peer_hello,
181 HelloType hello_type,
182 string* error_details) {
183 DCHECK(!negotiated_);
184 DCHECK(error_details != NULL);
185 const QuicTag* received_tags;
186 size_t received_tags_length;
187 QuicErrorCode error = ReadVector(peer_hello, &received_tags,
188 &received_tags_length, error_details);
189 if (error != QUIC_NO_ERROR) {
190 return error;
193 if (hello_type == SERVER) {
194 if (received_tags_length != 1 ||
195 !ContainsQuicTag(possible_values_, *received_tags)) {
196 *error_details = "Invalid " + QuicUtils::TagToString(tag_);
197 return QUIC_INVALID_NEGOTIATED_VALUE;
199 negotiated_tag_ = *received_tags;
200 } else {
201 QuicTag negotiated_tag;
202 if (!QuicUtils::FindMutualTag(possible_values_,
203 received_tags,
204 received_tags_length,
205 QuicUtils::LOCAL_PRIORITY,
206 &negotiated_tag,
207 NULL)) {
208 *error_details = "Unsupported " + QuicUtils::TagToString(tag_);
209 return QUIC_CRYPTO_MESSAGE_PARAMETER_NO_OVERLAP;
211 negotiated_tag_ = negotiated_tag;
214 negotiated_ = true;
215 return QUIC_NO_ERROR;
218 QuicFixedUint32::QuicFixedUint32(QuicTag tag, QuicConfigPresence presence)
219 : QuicConfigValue(tag, presence),
220 has_send_value_(false),
221 has_receive_value_(false) {
223 QuicFixedUint32::~QuicFixedUint32() {}
225 bool QuicFixedUint32::HasSendValue() const {
226 return has_send_value_;
229 uint32 QuicFixedUint32::GetSendValue() const {
230 LOG_IF(DFATAL, !has_send_value_)
231 << "No send value to get for tag:" << QuicUtils::TagToString(tag_);
232 return send_value_;
235 void QuicFixedUint32::SetSendValue(uint32 value) {
236 has_send_value_ = true;
237 send_value_ = value;
240 bool QuicFixedUint32::HasReceivedValue() const {
241 return has_receive_value_;
244 uint32 QuicFixedUint32::GetReceivedValue() const {
245 LOG_IF(DFATAL, !has_receive_value_)
246 << "No receive value to get for tag:" << QuicUtils::TagToString(tag_);
247 return receive_value_;
250 void QuicFixedUint32::SetReceivedValue(uint32 value) {
251 has_receive_value_ = true;
252 receive_value_ = value;
255 void QuicFixedUint32::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
256 if (has_send_value_) {
257 out->SetValue(tag_, send_value_);
261 QuicErrorCode QuicFixedUint32::ProcessPeerHello(
262 const CryptoHandshakeMessage& peer_hello,
263 HelloType hello_type,
264 string* error_details) {
265 DCHECK(error_details != NULL);
266 QuicErrorCode error = peer_hello.GetUint32(tag_, &receive_value_);
267 switch (error) {
268 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
269 if (presence_ == PRESENCE_OPTIONAL) {
270 return QUIC_NO_ERROR;
272 *error_details = "Missing " + QuicUtils::TagToString(tag_);
273 break;
274 case QUIC_NO_ERROR:
275 has_receive_value_ = true;
276 break;
277 default:
278 *error_details = "Bad " + QuicUtils::TagToString(tag_);
279 break;
281 return error;
284 QuicFixedTag::QuicFixedTag(QuicTag name,
285 QuicConfigPresence presence)
286 : QuicConfigValue(name, presence),
287 has_send_value_(false),
288 has_receive_value_(false) {
291 QuicFixedTag::~QuicFixedTag() {}
293 bool QuicFixedTag::HasSendValue() const {
294 return has_send_value_;
297 uint32 QuicFixedTag::GetSendValue() const {
298 LOG_IF(DFATAL, !has_send_value_)
299 << "No send value to get for tag:" << QuicUtils::TagToString(tag_);
300 return send_value_;
303 void QuicFixedTag::SetSendValue(uint32 value) {
304 has_send_value_ = true;
305 send_value_ = value;
308 bool QuicFixedTag::HasReceivedValue() const {
309 return has_receive_value_;
312 uint32 QuicFixedTag::GetReceivedValue() const {
313 LOG_IF(DFATAL, !has_receive_value_)
314 << "No receive value to get for tag:" << QuicUtils::TagToString(tag_);
315 return receive_value_;
318 void QuicFixedTag::SetReceivedValue(uint32 value) {
319 has_receive_value_ = true;
320 receive_value_ = value;
323 void QuicFixedTag::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
324 if (has_send_value_) {
325 out->SetValue(tag_, send_value_);
329 QuicErrorCode QuicFixedTag::ProcessPeerHello(
330 const CryptoHandshakeMessage& peer_hello,
331 HelloType hello_type,
332 string* error_details) {
333 DCHECK(error_details != NULL);
334 QuicErrorCode error = peer_hello.GetUint32(tag_, &receive_value_);
335 switch (error) {
336 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
337 if (presence_ == PRESENCE_OPTIONAL) {
338 return QUIC_NO_ERROR;
340 *error_details = "Missing " + QuicUtils::TagToString(tag_);
341 break;
342 case QUIC_NO_ERROR:
343 has_receive_value_ = true;
344 break;
345 default:
346 *error_details = "Bad " + QuicUtils::TagToString(tag_);
347 break;
349 return error;
352 QuicFixedTagVector::QuicFixedTagVector(QuicTag name,
353 QuicConfigPresence presence)
354 : QuicConfigValue(name, presence),
355 has_send_values_(false),
356 has_receive_values_(false) {
359 QuicFixedTagVector::~QuicFixedTagVector() {}
361 bool QuicFixedTagVector::HasSendValues() const {
362 return has_send_values_;
365 QuicTagVector QuicFixedTagVector::GetSendValues() const {
366 LOG_IF(DFATAL, !has_send_values_)
367 << "No send values to get for tag:" << QuicUtils::TagToString(tag_);
368 return send_values_;
371 void QuicFixedTagVector::SetSendValues(const QuicTagVector& values) {
372 has_send_values_ = true;
373 send_values_ = values;
376 bool QuicFixedTagVector::HasReceivedValues() const {
377 return has_receive_values_;
380 QuicTagVector QuicFixedTagVector::GetReceivedValues() const {
381 LOG_IF(DFATAL, !has_receive_values_)
382 << "No receive value to get for tag:" << QuicUtils::TagToString(tag_);
383 return receive_values_;
386 void QuicFixedTagVector::SetReceivedValues(const QuicTagVector& values) {
387 has_receive_values_ = true;
388 receive_values_ = values;
391 void QuicFixedTagVector::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
392 if (has_send_values_) {
393 out->SetVector(tag_, send_values_);
397 QuicErrorCode QuicFixedTagVector::ProcessPeerHello(
398 const CryptoHandshakeMessage& peer_hello,
399 HelloType hello_type,
400 string* error_details) {
401 DCHECK(error_details != NULL);
402 const QuicTag* received_tags;
403 size_t received_tags_length;
404 QuicErrorCode error =
405 peer_hello.GetTaglist(tag_, &received_tags, &received_tags_length);
406 switch (error) {
407 case QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND:
408 if (presence_ == PRESENCE_OPTIONAL) {
409 return QUIC_NO_ERROR;
411 *error_details = "Missing " + QuicUtils::TagToString(tag_);
412 break;
413 case QUIC_NO_ERROR:
414 DVLOG(1) << "Received Connection Option tags from receiver.";
415 has_receive_values_ = true;
416 for (size_t i = 0; i < received_tags_length; ++i) {
417 receive_values_.push_back(received_tags[i]);
419 break;
420 default:
421 *error_details = "Bad " + QuicUtils::TagToString(tag_);
422 break;
424 return error;
427 QuicConfig::QuicConfig()
428 : max_time_before_crypto_handshake_(QuicTime::Delta::Zero()),
429 max_idle_time_before_crypto_handshake_(QuicTime::Delta::Zero()),
430 congestion_feedback_(kCGST, PRESENCE_REQUIRED),
431 connection_options_(kCOPT, PRESENCE_OPTIONAL),
432 idle_connection_state_lifetime_seconds_(kICSL, PRESENCE_REQUIRED),
433 keepalive_timeout_seconds_(kKATO, PRESENCE_OPTIONAL),
434 max_streams_per_connection_(kMSPC, PRESENCE_REQUIRED),
435 initial_congestion_window_(kSWND, PRESENCE_OPTIONAL),
436 initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL),
437 // TODO(rjshade): Remove this when retiring QUIC_VERSION_19.
438 initial_flow_control_window_bytes_(kIFCW, PRESENCE_OPTIONAL),
439 // TODO(rjshade): Make this PRESENCE_REQUIRED when retiring
440 // QUIC_VERSION_19.
441 initial_stream_flow_control_window_bytes_(kSFCW, PRESENCE_OPTIONAL),
442 // TODO(rjshade): Make this PRESENCE_REQUIRED when retiring
443 // QUIC_VERSION_19.
444 initial_session_flow_control_window_bytes_(kCFCW, PRESENCE_OPTIONAL),
445 socket_receive_buffer_(kSRBF, PRESENCE_OPTIONAL) {
448 QuicConfig::~QuicConfig() {}
450 void QuicConfig::SetCongestionFeedback(
451 const QuicTagVector& congestion_feedback,
452 QuicTag default_congestion_feedback) {
453 congestion_feedback_.set(congestion_feedback, default_congestion_feedback);
456 QuicTag QuicConfig::CongestionFeedback() const {
457 return congestion_feedback_.GetTag();
460 void QuicConfig::SetConnectionOptionsToSend(
461 const QuicTagVector& connection_options) {
462 connection_options_.SetSendValues(connection_options);
465 bool QuicConfig::HasReceivedConnectionOptions() const {
466 return connection_options_.HasReceivedValues();
469 QuicTagVector QuicConfig::ReceivedConnectionOptions() const {
470 return connection_options_.GetReceivedValues();
473 bool QuicConfig::HasSendConnectionOptions() const {
474 return connection_options_.HasSendValues();
477 QuicTagVector QuicConfig::SendConnectionOptions() const {
478 return connection_options_.GetSendValues();
481 void QuicConfig::SetIdleConnectionStateLifetime(
482 QuicTime::Delta max_idle_connection_state_lifetime,
483 QuicTime::Delta default_idle_conection_state_lifetime) {
484 idle_connection_state_lifetime_seconds_.set(
485 max_idle_connection_state_lifetime.ToSeconds(),
486 default_idle_conection_state_lifetime.ToSeconds());
489 QuicTime::Delta QuicConfig::IdleConnectionStateLifetime() const {
490 return QuicTime::Delta::FromSeconds(
491 idle_connection_state_lifetime_seconds_.GetUint32());
494 QuicTime::Delta QuicConfig::KeepaliveTimeout() const {
495 return QuicTime::Delta::FromSeconds(
496 keepalive_timeout_seconds_.GetUint32());
499 void QuicConfig::SetMaxStreamsPerConnection(size_t max_streams,
500 size_t default_streams) {
501 max_streams_per_connection_.set(max_streams, default_streams);
504 uint32 QuicConfig::MaxStreamsPerConnection() const {
505 return max_streams_per_connection_.GetUint32();
508 void QuicConfig::SetInitialCongestionWindowToSend(size_t initial_window) {
509 initial_congestion_window_.SetSendValue(initial_window);
512 bool QuicConfig::HasReceivedInitialCongestionWindow() const {
513 return initial_congestion_window_.HasReceivedValue();
516 uint32 QuicConfig::ReceivedInitialCongestionWindow() const {
517 return initial_congestion_window_.GetReceivedValue();
520 void QuicConfig::SetInitialRoundTripTimeUsToSend(size_t rtt) {
521 initial_round_trip_time_us_.SetSendValue(rtt);
524 bool QuicConfig::HasReceivedInitialRoundTripTimeUs() const {
525 return initial_round_trip_time_us_.HasReceivedValue();
528 uint32 QuicConfig::ReceivedInitialRoundTripTimeUs() const {
529 return initial_round_trip_time_us_.GetReceivedValue();
532 bool QuicConfig::HasInitialRoundTripTimeUsToSend() const {
533 return initial_round_trip_time_us_.HasSendValue();
536 uint32 QuicConfig::GetInitialRoundTripTimeUsToSend() const {
537 return initial_round_trip_time_us_.GetSendValue();
540 void QuicConfig::SetInitialFlowControlWindowToSend(uint32 window_bytes) {
541 if (window_bytes < kDefaultFlowControlSendWindow) {
542 LOG(DFATAL) << "Initial flow control receive window (" << window_bytes
543 << ") cannot be set lower than default ("
544 << kDefaultFlowControlSendWindow << ").";
545 window_bytes = kDefaultFlowControlSendWindow;
547 initial_flow_control_window_bytes_.SetSendValue(window_bytes);
550 uint32 QuicConfig::GetInitialFlowControlWindowToSend() const {
551 return initial_flow_control_window_bytes_.GetSendValue();
554 bool QuicConfig::HasReceivedInitialFlowControlWindowBytes() const {
555 return initial_flow_control_window_bytes_.HasReceivedValue();
558 uint32 QuicConfig::ReceivedInitialFlowControlWindowBytes() const {
559 return initial_flow_control_window_bytes_.GetReceivedValue();
562 void QuicConfig::SetInitialStreamFlowControlWindowToSend(uint32 window_bytes) {
563 if (window_bytes < kDefaultFlowControlSendWindow) {
564 LOG(DFATAL) << "Initial stream flow control receive window ("
565 << window_bytes << ") cannot be set lower than default ("
566 << kDefaultFlowControlSendWindow << ").";
567 window_bytes = kDefaultFlowControlSendWindow;
569 initial_stream_flow_control_window_bytes_.SetSendValue(window_bytes);
572 uint32 QuicConfig::GetInitialStreamFlowControlWindowToSend() const {
573 return initial_stream_flow_control_window_bytes_.GetSendValue();
576 bool QuicConfig::HasReceivedInitialStreamFlowControlWindowBytes() const {
577 return initial_stream_flow_control_window_bytes_.HasReceivedValue();
580 uint32 QuicConfig::ReceivedInitialStreamFlowControlWindowBytes() const {
581 return initial_stream_flow_control_window_bytes_.GetReceivedValue();
584 void QuicConfig::SetInitialSessionFlowControlWindowToSend(uint32 window_bytes) {
585 if (window_bytes < kDefaultFlowControlSendWindow) {
586 LOG(DFATAL) << "Initial session flow control receive window ("
587 << window_bytes << ") cannot be set lower than default ("
588 << kDefaultFlowControlSendWindow << ").";
589 window_bytes = kDefaultFlowControlSendWindow;
591 initial_session_flow_control_window_bytes_.SetSendValue(window_bytes);
594 uint32 QuicConfig::GetInitialSessionFlowControlWindowToSend() const {
595 return initial_session_flow_control_window_bytes_.GetSendValue();
598 bool QuicConfig::HasReceivedInitialSessionFlowControlWindowBytes() const {
599 return initial_session_flow_control_window_bytes_.HasReceivedValue();
602 uint32 QuicConfig::ReceivedInitialSessionFlowControlWindowBytes() const {
603 return initial_session_flow_control_window_bytes_.GetReceivedValue();
606 void QuicConfig::SetSocketReceiveBufferToSend(uint32 tcp_receive_window) {
607 socket_receive_buffer_.SetSendValue(tcp_receive_window);
610 uint32 QuicConfig::GetSocketReceiveBufferToSend() const {
611 return socket_receive_buffer_.GetSendValue();
614 bool QuicConfig::HasReceivedSocketReceiveBuffer() const {
615 return socket_receive_buffer_.HasReceivedValue();
618 uint32 QuicConfig::ReceivedSocketReceiveBuffer() const {
619 return socket_receive_buffer_.GetReceivedValue();
622 bool QuicConfig::negotiated() const {
623 // TODO(ianswett): Add the negotiated parameters once and iterate over all
624 // of them in negotiated, ToHandshakeMessage, ProcessClientHello, and
625 // ProcessServerHello.
626 return congestion_feedback_.negotiated() &&
627 idle_connection_state_lifetime_seconds_.negotiated() &&
628 keepalive_timeout_seconds_.negotiated() &&
629 max_streams_per_connection_.negotiated();
632 void QuicConfig::SetDefaults() {
633 QuicTagVector congestion_feedback;
634 congestion_feedback.push_back(kQBIC);
635 congestion_feedback_.set(congestion_feedback, kQBIC);
636 idle_connection_state_lifetime_seconds_.set(kMaximumIdleTimeoutSecs,
637 kDefaultIdleTimeoutSecs);
638 // kKATO is optional. Return 0 if not negotiated.
639 keepalive_timeout_seconds_.set(0, 0);
640 SetMaxStreamsPerConnection(kDefaultMaxStreamsPerConnection,
641 kDefaultMaxStreamsPerConnection);
642 max_time_before_crypto_handshake_ =
643 QuicTime::Delta::FromSeconds(kMaxTimeForCryptoHandshakeSecs);
644 max_idle_time_before_crypto_handshake_ =
645 QuicTime::Delta::FromSeconds(kInitialIdleTimeoutSecs);
647 SetInitialFlowControlWindowToSend(kDefaultFlowControlSendWindow);
648 SetInitialStreamFlowControlWindowToSend(kDefaultFlowControlSendWindow);
649 SetInitialSessionFlowControlWindowToSend(kDefaultFlowControlSendWindow);
652 void QuicConfig::ToHandshakeMessage(CryptoHandshakeMessage* out) const {
653 congestion_feedback_.ToHandshakeMessage(out);
654 idle_connection_state_lifetime_seconds_.ToHandshakeMessage(out);
655 keepalive_timeout_seconds_.ToHandshakeMessage(out);
656 max_streams_per_connection_.ToHandshakeMessage(out);
657 initial_congestion_window_.ToHandshakeMessage(out);
658 initial_round_trip_time_us_.ToHandshakeMessage(out);
659 initial_flow_control_window_bytes_.ToHandshakeMessage(out);
660 initial_stream_flow_control_window_bytes_.ToHandshakeMessage(out);
661 initial_session_flow_control_window_bytes_.ToHandshakeMessage(out);
662 socket_receive_buffer_.ToHandshakeMessage(out);
663 connection_options_.ToHandshakeMessage(out);
666 QuicErrorCode QuicConfig::ProcessPeerHello(
667 const CryptoHandshakeMessage& peer_hello,
668 HelloType hello_type,
669 string* error_details) {
670 DCHECK(error_details != NULL);
672 QuicErrorCode error = QUIC_NO_ERROR;
673 if (error == QUIC_NO_ERROR) {
674 error = congestion_feedback_.ProcessPeerHello(
675 peer_hello, hello_type, error_details);
677 if (error == QUIC_NO_ERROR) {
678 error = idle_connection_state_lifetime_seconds_.ProcessPeerHello(
679 peer_hello, hello_type, error_details);
681 if (error == QUIC_NO_ERROR) {
682 error = keepalive_timeout_seconds_.ProcessPeerHello(
683 peer_hello, hello_type, error_details);
685 if (error == QUIC_NO_ERROR) {
686 error = max_streams_per_connection_.ProcessPeerHello(
687 peer_hello, hello_type, error_details);
689 if (error == QUIC_NO_ERROR) {
690 error = initial_congestion_window_.ProcessPeerHello(
691 peer_hello, hello_type, error_details);
693 if (error == QUIC_NO_ERROR) {
694 error = initial_round_trip_time_us_.ProcessPeerHello(
695 peer_hello, hello_type, error_details);
697 if (error == QUIC_NO_ERROR) {
698 error = initial_flow_control_window_bytes_.ProcessPeerHello(
699 peer_hello, hello_type, error_details);
701 if (error == QUIC_NO_ERROR) {
702 error = initial_stream_flow_control_window_bytes_.ProcessPeerHello(
703 peer_hello, hello_type, error_details);
705 if (error == QUIC_NO_ERROR) {
706 error = initial_session_flow_control_window_bytes_.ProcessPeerHello(
707 peer_hello, hello_type, error_details);
709 if (error == QUIC_NO_ERROR) {
710 error = socket_receive_buffer_.ProcessPeerHello(
711 peer_hello, hello_type, error_details);
713 if (error == QUIC_NO_ERROR) {
714 error = connection_options_.ProcessPeerHello(
715 peer_hello, hello_type, error_details);
717 return error;
720 } // namespace net