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

Side by Side Diff: components/domain_reliability/quic_error_mapping.cc

Issue 2547583002: Landing Recent QUIC changes until Fri Nov 18 23:21:04 2016 +0000 (Closed)
Patch Set: Remove explicit HTTP/2 enum usage Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/domain_reliability/quic_error_mapping.h" 5 #include "components/domain_reliability/quic_error_mapping.h"
6 6
7 namespace domain_reliability { 7 namespace domain_reliability {
8 8
9 namespace { 9 namespace {
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 "quic.stream_sequencer_invalid_state" }, 248 "quic.stream_sequencer_invalid_state" },
249 // Connection closed because of server hits max number of sessions allowed. 249 // Connection closed because of server hits max number of sessions allowed.
250 { net::QUIC_TOO_MANY_SESSIONS_ON_SERVER, 250 { net::QUIC_TOO_MANY_SESSIONS_ON_SERVER,
251 "quic.too_many_sessions_on_server" }, 251 "quic.too_many_sessions_on_server" },
252 252
253 // No error. Used as bound while iterating. 253 // No error. Used as bound while iterating.
254 { net::QUIC_LAST_ERROR, "quic.last_error"} 254 { net::QUIC_LAST_ERROR, "quic.last_error"}
255 }; 255 };
256 256
257 // Must be updated any time a net::QuicErrorCode is deprecated in 257 // Must be updated any time a net::QuicErrorCode is deprecated in
258 // net/quic/core/quic_protocol.h. 258 // net/quic/core/quic_packets.h.
259 const int kDeprecatedQuicErrorCount = 4; 259 const int kDeprecatedQuicErrorCount = 4;
260 const int kActiveQuicErrorCount = 260 const int kActiveQuicErrorCount =
261 net::QUIC_LAST_ERROR - kDeprecatedQuicErrorCount; 261 net::QUIC_LAST_ERROR - kDeprecatedQuicErrorCount;
262 262
263 static_assert(arraysize(kQuicErrorMap) == kActiveQuicErrorCount, 263 static_assert(arraysize(kQuicErrorMap) == kActiveQuicErrorCount,
264 "quic_error_map is not in sync with quic protocol!"); 264 "quic_error_map is not in sync with quic protocol!");
265 265
266 } // namespace 266 } // namespace
267 267
268 // static 268 // static
269 bool GetDomainReliabilityBeaconQuicError(net::QuicErrorCode quic_error, 269 bool GetDomainReliabilityBeaconQuicError(net::QuicErrorCode quic_error,
270 std::string* beacon_quic_error_out) { 270 std::string* beacon_quic_error_out) {
271 if (quic_error != net::QUIC_NO_ERROR) { 271 if (quic_error != net::QUIC_NO_ERROR) {
272 // Convert a QUIC error. 272 // Convert a QUIC error.
273 // TODO(juliatuttle): Consider sorting and using binary search? 273 // TODO(juliatuttle): Consider sorting and using binary search?
274 for (size_t i = 0; i < arraysize(kQuicErrorMap); i++) { 274 for (size_t i = 0; i < arraysize(kQuicErrorMap); i++) {
275 if (kQuicErrorMap[i].quic_error == quic_error) { 275 if (kQuicErrorMap[i].quic_error == quic_error) {
276 *beacon_quic_error_out = kQuicErrorMap[i].beacon_quic_error; 276 *beacon_quic_error_out = kQuicErrorMap[i].beacon_quic_error;
277 return true; 277 return true;
278 } 278 }
279 } 279 }
280 } 280 }
281 beacon_quic_error_out->clear(); 281 beacon_quic_error_out->clear();
282 return false; 282 return false;
283 } 283 }
284 284
285 } // namespace domain_reliability 285 } // namespace domain_reliability
OLDNEW
« no previous file with comments | « components/domain_reliability/quic_error_mapping.h ('k') | components/grpc_support/test/quic_test_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698