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

Unified Diff: chrome/browser/resources/net_internals/main.js

Issue 17333003: Pretty-print QUIC CONNECTION_CLOSE and RST_STREAM error codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wrap Created 7 years, 6 months 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
Index: chrome/browser/resources/net_internals/main.js
diff --git a/chrome/browser/resources/net_internals/main.js b/chrome/browser/resources/net_internals/main.js
index 22221aebd883d3fbea40c698f15cf2131a14c6f4..5eb8bc46aef5a73d6bc912c804b50a8c5f64a17d 100644
--- a/chrome/browser/resources/net_internals/main.js
+++ b/chrome/browser/resources/net_internals/main.js
@@ -15,6 +15,8 @@ var EventSourceTypeNames = null;
var LogLevelType = null;
var ClientInfo = null;
var NetError = null;
+var QuicError = null;
+var QuicRstStreamError = null;
var LoadFlag = null;
var LoadState = null;
var AddressFamily = null;
@@ -301,6 +303,8 @@ ConstantsObserver.prototype.onReceivedConstants = function(receivedConstants) {
ClientInfo = Constants.clientInfo;
LoadFlag = Constants.loadFlag;
NetError = Constants.netError;
+ QuicError = Constants.quicError;
+ QuicRstStreamError = Constants.quicRstStreamError;
AddressFamily = Constants.addressFamily;
LoadState = Constants.loadState;
@@ -329,7 +333,7 @@ function areValidConstants(receivedConstants) {
/**
* Returns the name for netError.
*
- * Example: netErrorToString(-105) would return
+ * Example: netErrorToString(-105) should return
* "ERR_NAME_NOT_RESOLVED".
* @param {number} netError The net error code.
* @return {string} The name of the given error.
@@ -342,6 +346,30 @@ function netErrorToString(netError) {
}
/**
+ * Returns the name for quicError.
+ *
+ * Example: quicErrorToString(25) should return
+ * "TIMED_OUT".
+ * @param {number} quicError The QUIC error code.
+ * @return {string} The name of the given error.
+ */
+function quicErrorToString(quicError) {
+ return getKeyWithValue(QuicError, quicError);
+}
+
+/**
+ * Returns the name for quicRstStreamError.
+ *
+ * Example: quicRstStreamErrorToString(3) should return
+ * "BAD_APPLICATION_PAYLOAD".
+ * @param {number} quicRstStreamError The QUIC RST_STREAM error code.
+ * @return {string} The name of the given error.
+ */
+function quicRstStreamErrorToString(quicRstStreamError) {
+ return getKeyWithValue(QuicRstStreamError, quicRstStreamError);
+}
+
+/**
* Returns a string representation of |family|.
* @param {number} family An AddressFamily
* @return {string} A representation of the given family.

Powered by Google App Engine
This is Rietveld 408576698