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

Unified Diff: remoting/webapp/crd/js/server_log_entry.js

Issue 955283002: Converted remoting.Error from an enum to a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Requested changes. Created 5 years, 10 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: remoting/webapp/crd/js/server_log_entry.js
diff --git a/remoting/webapp/crd/js/server_log_entry.js b/remoting/webapp/crd/js/server_log_entry.js
index 7d848aa5b5a4a089f8909778f7108508fd933a75..d9fe6c8a4dfc9be0c710085f36680c9352efba4b 100644
--- a/remoting/webapp/crd/js/server_log_entry.js
+++ b/remoting/webapp/crd/js/server_log_entry.js
@@ -85,34 +85,34 @@ remoting.ServerLogEntry.KEY_CONNECTION_ERROR_ = 'connection-error';
/**
* @private
- * @param {remoting.Error} connectionError
+ * @param {!remoting.Error} connectionError
* @return {string}
*/
remoting.ServerLogEntry.getValueForError_ = function(connectionError) {
// Directory service should be updated if a new string is added here as
// otherwise the error code will be ignored (i.e. recorded as 0 instead).
- switch(connectionError) {
- case remoting.Error.NONE:
+ switch (connectionError.tag) {
+ case remoting.Error.Tag.NONE:
return 'none';
- case remoting.Error.INVALID_ACCESS_CODE:
+ case remoting.Error.Tag.INVALID_ACCESS_CODE:
return 'invalid-access-code';
- case remoting.Error.MISSING_PLUGIN:
+ case remoting.Error.Tag.MISSING_PLUGIN:
return 'missing_plugin';
- case remoting.Error.AUTHENTICATION_FAILED:
+ case remoting.Error.Tag.AUTHENTICATION_FAILED:
return 'authentication-failed';
- case remoting.Error.HOST_IS_OFFLINE:
+ case remoting.Error.Tag.HOST_IS_OFFLINE:
return 'host-is-offline';
- case remoting.Error.INCOMPATIBLE_PROTOCOL:
+ case remoting.Error.Tag.INCOMPATIBLE_PROTOCOL:
return 'incompatible-protocol';
- case remoting.Error.BAD_PLUGIN_VERSION:
+ case remoting.Error.Tag.BAD_PLUGIN_VERSION:
return 'bad-plugin-version';
- case remoting.Error.NETWORK_FAILURE:
+ case remoting.Error.Tag.NETWORK_FAILURE:
return 'network-failure';
- case remoting.Error.HOST_OVERLOAD:
+ case remoting.Error.Tag.HOST_OVERLOAD:
return 'host-overload';
- case remoting.Error.P2P_FAILURE:
+ case remoting.Error.Tag.P2P_FAILURE:
return 'p2p-failure';
- case remoting.Error.UNEXPECTED:
+ case remoting.Error.Tag.UNEXPECTED:
return 'unexpected';
default:
return 'unknown-' + connectionError;
@@ -220,7 +220,7 @@ remoting.ServerLogEntry.prototype.toDebugLog = function(indentLevel) {
* Makes a log entry for a change of client session state.
*
* @param {remoting.ClientSession.State} state
- * @param {remoting.Error} connectionError
+ * @param {!remoting.Error} connectionError
* @param {remoting.DesktopConnectedView.Mode} mode
* @return {remoting.ServerLogEntry}
*/
@@ -233,7 +233,7 @@ remoting.ServerLogEntry.makeClientSessionStateChange = function(state,
remoting.ServerLogEntry.VALUE_EVENT_NAME_SESSION_STATE_);
entry.set_(remoting.ServerLogEntry.KEY_SESSION_STATE_,
remoting.ServerLogEntry.getValueForSessionState_(state));
- if (connectionError != remoting.Error.NONE) {
+ if (connectionError.tag != remoting.Error.NONE) {
entry.set_(remoting.ServerLogEntry.KEY_CONNECTION_ERROR_,
remoting.ServerLogEntry.getValueForError_(connectionError));
}

Powered by Google App Engine
This is Rietveld 408576698