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

Unified Diff: net/quic/core/quic_error_codes.h

Issue 2517513004: Move QUIC error code utility methods to quic_error_codes.{h,cc}, and rename them slightly. No beha… (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_crypto_stream.cc ('k') | net/quic/core/quic_error_codes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_error_codes.h
diff --git a/net/quic/core/quic_error_codes.h b/net/quic/core/quic_error_codes.h
index b409e6c7fdf2f75f44162f0f542a8abe4a6b374f..41968791193e44724ef1d13359ef59f9837bf26f 100644
--- a/net/quic/core/quic_error_codes.h
+++ b/net/quic/core/quic_error_codes.h
@@ -9,6 +9,8 @@
#include <limits>
+#include "net/base/net_export.h"
+
namespace net {
enum QuicRstStreamErrorCode {
@@ -53,10 +55,10 @@ enum QuicRstStreamErrorCode {
// No error. Used as bound while iterating.
QUIC_STREAM_LAST_ERROR,
};
-// QUIC error codes are encoded to a single octet on-the-wire.
+// QuicRstStreamErrorCode is encoded as a single octet on-the-wire.
static_assert(static_cast<int>(QUIC_STREAM_LAST_ERROR) <=
std::numeric_limits<uint8_t>::max(),
- "QuicErrorCode exceeds single octet");
+ "QuicRstStreamErrorCode exceeds single octet");
// These values must remain stable as they are uploaded to UMA histograms.
// To add a new error code, use the current value of QUIC_LAST_ERROR and
@@ -275,6 +277,17 @@ enum QuicErrorCode {
// No error. Used as bound while iterating.
QUIC_LAST_ERROR = 97,
};
+// QuicErrorCodes is encoded as a single octet on-the-wire.
+static_assert(static_cast<int>(QUIC_LAST_ERROR) <=
+ std::numeric_limits<uint8_t>::max(),
+ "QuicErrorCode exceeds single octet");
+
+// Returns the name of the QuicRstStreamErrorCode as a char*
+NET_EXPORT_PRIVATE const char* QuicRstStreamErrorCodeToString(
+ QuicRstStreamErrorCode error);
+
+// Returns the name of the QuicErrorCode as a char*
+NET_EXPORT_PRIVATE const char* QuicErrorCodeToString(QuicErrorCode error);
} // namespace net
« no previous file with comments | « net/quic/core/quic_crypto_stream.cc ('k') | net/quic/core/quic_error_codes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698