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

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

Issue 1004513002: Eliminated named constants for instances of remoting.Error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/xmpp_connection.js
diff --git a/remoting/webapp/crd/js/xmpp_connection.js b/remoting/webapp/crd/js/xmpp_connection.js
index eba06f72a1fded5ce153b3f45fa1fa68b0093859..2284dadf9dbe96adc96f08e6d8ca7fd77459401a 100644
--- a/remoting/webapp/crd/js/xmpp_connection.js
+++ b/remoting/webapp/crd/js/xmpp_connection.js
@@ -46,7 +46,7 @@ remoting.XmppConnection = function() {
/** @private */
this.jid_ = '';
/** @private */
- this.error_ = remoting.Error.NONE;
+ this.error_ = remoting.Error.none();
};
/**
@@ -76,7 +76,7 @@ remoting.XmppConnection.prototype.connect =
base.debug.assert(this.state_ == remoting.SignalStrategy.State.NOT_CONNECTED);
base.debug.assert(this.onStateChangedCallback_ != null);
- this.error_ = remoting.Error.NONE;
+ this.error_ = remoting.Error.none();
var hostnameAndPort = server.split(':', 2);
this.server_ = hostnameAndPort[0];
this.port_ =
@@ -177,7 +177,7 @@ remoting.XmppConnection.prototype.onSocketConnected_ = function(result) {
}
if (result != 0) {
- this.onError_(remoting.Error.NETWORK_FAILURE,
+ this.onError_(new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE),
'Failed to connect to ' + this.server_ + ': ' + result);
return;
}
@@ -218,7 +218,7 @@ remoting.XmppConnection.prototype.onRead_ = function(readInfo) {
}
if (readInfo.resultCode < 0) {
- this.onError_(remoting.Error.NETWORK_FAILURE,
+ this.onError_(new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE),
'Failed to receive from XMPP socket: ' + readInfo.resultCode);
return;
}
@@ -280,7 +280,7 @@ remoting.XmppConnection.prototype.onWrite_ = function(writeInfo) {
}
if (writeInfo.bytesWritten < 0) {
- this.onError_(remoting.Error.NETWORK_FAILURE,
+ this.onError_(new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE),
'TCP write failed with error ' + writeInfo.bytesWritten);
return;
}
@@ -319,7 +319,7 @@ remoting.XmppConnection.prototype.onTlsStarted_ = function(resultCode) {
this.startTlsPending_ = false;
if (resultCode < 0) {
- this.onError_(remoting.Error.NETWORK_FAILURE,
+ this.onError_(new remoting.Error(remoting.Error.Tag.NETWORK_FAILURE),
'Failed to start TLS: ' + resultCode);
return;
}
@@ -357,7 +357,7 @@ remoting.XmppConnection.prototype.onIncomingStanza_ = function(stanza) {
* @private
*/
remoting.XmppConnection.prototype.onParserError_ = function(text) {
- this.onError_(remoting.Error.UNEXPECTED, text);
+ this.onError_(remoting.Error.unexpected(), text);
}
/**

Powered by Google App Engine
This is Rietveld 408576698