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

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: Fix enum/int conversion problems. 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 5dc1aa649baa918a660844173f8427ead6e89cfc..8cbd37c4ddfdf6e74661d461d35c0773afe10160 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;
@@ -303,6 +305,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;
@@ -331,7 +335,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.
@@ -344,6 +348,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.
« no previous file with comments | « chrome/browser/resources/net_internals/log_view_painter.js ('k') | chrome/browser/ui/webui/net_internals/net_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698