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

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

Issue 1015553003: Added more typechecking functions and unit tests for existing code. (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
« no previous file with comments | « remoting/webapp/crd/js/host_list_api_impl.js ('k') | remoting/webapp/crd/js/typecheck.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/it2me_host_facade.js
diff --git a/remoting/webapp/crd/js/it2me_host_facade.js b/remoting/webapp/crd/js/it2me_host_facade.js
index 2106ec8560350c4dace7eb138120027529a96c2a..99800f393cc16962e8e292752db53a9d89ebfc7f 100644
--- a/remoting/webapp/crd/js/it2me_host_facade.js
+++ b/remoting/webapp/crd/js/it2me_host_facade.js
@@ -208,11 +208,11 @@ remoting.It2MeHostFacade.prototype.getClient = function() {
*/
remoting.It2MeHostFacade.prototype.onIncomingMessage_ =
function(message) {
- var type = getStringAttr(message, 'type');
+ var type = base.getStringAttr(message, 'type');
switch (type) {
case 'helloResponse':
- var version = getStringAttr(message, 'version');
+ var version = base.getStringAttr(message, 'version');
console.log('Host version: ', version);
this.initialized_ = true;
// A "hello" request is sent immediately after the native messaging host
@@ -236,19 +236,20 @@ remoting.It2MeHostFacade.prototype.onIncomingMessage_ =
break;
case 'hostStateChanged':
- var stateString = getStringAttr(message, 'state');
+ var stateString = base.getStringAttr(message, 'state');
console.log('hostStateChanged received: ', stateString);
var state = remoting.HostSession.State.fromString(stateString);
switch (state) {
case remoting.HostSession.State.RECEIVED_ACCESS_CODE:
- var accessCode = getStringAttr(message, 'accessCode');
- var accessCodeLifetime = getNumberAttr(message, 'accessCodeLifetime');
+ var accessCode = base.getStringAttr(message, 'accessCode');
+ var accessCodeLifetime =
+ base.getNumberAttr(message, 'accessCodeLifetime');
this.onReceivedAccessCode_(accessCode, accessCodeLifetime);
break;
case remoting.HostSession.State.CONNECTED:
- var client = getStringAttr(message, 'client');
+ var client = base.getStringAttr(message, 'client');
this.onConnected_(client);
break;
}
@@ -260,13 +261,13 @@ remoting.It2MeHostFacade.prototype.onIncomingMessage_ =
case 'natPolicyChanged':
if (this.onNatPolicyChanged_) {
var natTraversalEnabled =
- getBooleanAttr(message, 'natTraversalEnabled');
+ base.getBooleanAttr(message, 'natTraversalEnabled');
this.onNatPolicyChanged_(natTraversalEnabled);
}
break;
case 'error':
- console.error(getStringAttr(message, 'description'));
+ console.error(base.getStringAttr(message, 'description'));
if (this.onError_) {
this.onError_(remoting.Error.unexpected());
}
« no previous file with comments | « remoting/webapp/crd/js/host_list_api_impl.js ('k') | remoting/webapp/crd/js/typecheck.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698