diff options
author | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-24 01:19:25 +0000 |
---|---|---|
committer | lambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-24 01:19:25 +0000 |
commit | 83660851d119a578b5c1720853fed617bd012386 (patch) | |
tree | e81cf7f8381a7c26abc810548147227507d1b6df /remoting/webapp | |
parent | 55472715e60d59afa2ad90bf2d0f761f584e9c0d (diff) | |
download | chromium_src-83660851d119a578b5c1720853fed617bd012386.zip chromium_src-83660851d119a578b5c1720853fed617bd012386.tar.gz chromium_src-83660851d119a578b5c1720853fed617bd012386.tar.bz2 |
Style cleanup: Rename callback -> onDone in chromoting webapp.
This makes host_dispatcher.js and host_native_messaging.js consistent
with the rest of the webapp. Also fix function declaration style.
Review URL: https://chromiumcodereview.appspot.com/19597006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213311 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/webapp')
-rw-r--r-- | remoting/webapp/host_dispatcher.js | 127 | ||||
-rw-r--r-- | remoting/webapp/host_native_messaging.js | 110 |
2 files changed, 115 insertions, 122 deletions
diff --git a/remoting/webapp/host_dispatcher.js b/remoting/webapp/host_dispatcher.js index c05cf3f..02ca1ac 100644 --- a/remoting/webapp/host_dispatcher.js +++ b/remoting/webapp/host_dispatcher.js @@ -75,22 +75,22 @@ remoting.HostDispatcher.State = { }; /** - * @param {function(string):void} callback + * @param {function(string):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getHostName = function(callback, onError) { +remoting.HostDispatcher.prototype.getHostName = function(onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getHostName.bind(this, callback, onError)); + this.getHostName.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.getHostName(callback, onError); + this.nativeMessagingHost_.getHostName(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.getHostName(callback); + this.npapiHost_.getHostName(onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -101,23 +101,23 @@ remoting.HostDispatcher.prototype.getHostName = function(callback, onError) { /** * @param {string} hostId * @param {string} pin - * @param {function(string):void} callback + * @param {function(string):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getPinHash = function(hostId, pin, callback, - onError) { +remoting.HostDispatcher.prototype.getPinHash = + function(hostId, pin, onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getPinHash.bind(this, hostId, pin, callback, onError)); + this.getPinHash.bind(this, hostId, pin, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.getPinHash(hostId, pin, callback, onError); + this.nativeMessagingHost_.getPinHash(hostId, pin, onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.getPinHash(hostId, pin, callback); + this.npapiHost_.getPinHash(hostId, pin, onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -126,23 +126,22 @@ remoting.HostDispatcher.prototype.getPinHash = function(hostId, pin, callback, }; /** - * @param {function(string, string):void} callback + * @param {function(string, string):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.generateKeyPair = function(callback, - onError) { +remoting.HostDispatcher.prototype.generateKeyPair = function(onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.generateKeyPair.bind(this, callback, onError)); + this.generateKeyPair.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.generateKeyPair(callback, onError); + this.nativeMessagingHost_.generateKeyPair(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.generateKeyPair(callback); + this.npapiHost_.generateKeyPair(onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -152,24 +151,23 @@ remoting.HostDispatcher.prototype.generateKeyPair = function(callback, /** * @param {Object} config - * @param {function(remoting.HostController.AsyncResult):void} callback + * @param {function(remoting.HostController.AsyncResult):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.updateDaemonConfig = function(config, - callback, - onError) { +remoting.HostDispatcher.prototype.updateDaemonConfig = + function(config, onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.updateDaemonConfig.bind(this, config, callback, onError)); + this.updateDaemonConfig.bind(this, config, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.updateDaemonConfig(config, callback, onError); + this.nativeMessagingHost_.updateDaemonConfig(config, onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.updateDaemonConfig(JSON.stringify(config), callback); + this.npapiHost_.updateDaemonConfig(JSON.stringify(config), onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -178,15 +176,14 @@ remoting.HostDispatcher.prototype.updateDaemonConfig = function(config, }; /** - * @param {function(Object):void} callback + * @param {function(Object):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getDaemonConfig = function(callback, - onError) { +remoting.HostDispatcher.prototype.getDaemonConfig = function(onDone, onError) { /** * Converts the config string from the NPAPI plugin to an Object, to pass to - * |callback|. + * |onDone|. * @param {string} configStr * @return {void} */ @@ -195,17 +192,17 @@ remoting.HostDispatcher.prototype.getDaemonConfig = function(callback, if (typeof(config) != 'object') { onError(remoting.Error.UNEXPECTED); } else { - callback(/** @type {Object} */ (config)); + onDone(/** @type {Object} */ (config)); } } switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getDaemonConfig.bind(this, callback, onError)); + this.getDaemonConfig.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.getDaemonConfig(callback, onError); + this.nativeMessagingHost_.getDaemonConfig(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { @@ -218,23 +215,22 @@ remoting.HostDispatcher.prototype.getDaemonConfig = function(callback, }; /** - * @param {function(string):void} callback + * @param {function(string):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getDaemonVersion = function(callback, - onError) { +remoting.HostDispatcher.prototype.getDaemonVersion = function(onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getDaemonVersion.bind(this, callback, onError)); + this.getDaemonVersion.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - callback(this.nativeMessagingHost_.getDaemonVersion()); + onDone(this.nativeMessagingHost_.getDaemonVersion()); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.getDaemonVersion(callback); + this.npapiHost_.getDaemonVersion(onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -243,23 +239,23 @@ remoting.HostDispatcher.prototype.getDaemonVersion = function(callback, }; /** - * @param {function(boolean, boolean, boolean):void} callback + * @param {function(boolean, boolean, boolean):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getUsageStatsConsent = function(callback, - onError) { +remoting.HostDispatcher.prototype.getUsageStatsConsent = + function(onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getUsageStatsConsent.bind(this, callback, onError)); + this.getUsageStatsConsent.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.getUsageStatsConsent(callback, onError); + this.nativeMessagingHost_.getUsageStatsConsent(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.getUsageStatsConsent(callback); + this.npapiHost_.getUsageStatsConsent(onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -270,23 +266,23 @@ remoting.HostDispatcher.prototype.getUsageStatsConsent = function(callback, /** * @param {Object} config * @param {boolean} consent - * @param {function(remoting.HostController.AsyncResult):void} callback + * @param {function(remoting.HostController.AsyncResult):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.startDaemon = function(config, consent, - callback, onError) { +remoting.HostDispatcher.prototype.startDaemon = + function(config, consent, onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.startDaemon.bind(this, config, consent, callback, onError)); + this.startDaemon.bind(this, config, consent, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.startDaemon(config, consent, callback, onError); + this.nativeMessagingHost_.startDaemon(config, consent, onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.startDaemon(JSON.stringify(config), consent, callback); + this.npapiHost_.startDaemon(JSON.stringify(config), consent, onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -295,21 +291,21 @@ remoting.HostDispatcher.prototype.startDaemon = function(config, consent, }; /** - * @param {function(remoting.HostController.AsyncResult):void} callback + * @param {function(remoting.HostController.AsyncResult):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.stopDaemon = function(callback, onError) { +remoting.HostDispatcher.prototype.stopDaemon = function(onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: - this.pendingRequests_.push(this.stopDaemon.bind(this, callback, onError)); + this.pendingRequests_.push(this.stopDaemon.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.stopDaemon(callback, onError); + this.nativeMessagingHost_.stopDaemon(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { - this.npapiHost_.stopDaemon(callback); + this.npapiHost_.stopDaemon(onDone); } catch (err) { onError(remoting.Error.MISSING_PLUGIN); } @@ -318,18 +314,18 @@ remoting.HostDispatcher.prototype.stopDaemon = function(callback, onError) { }; /** - * @param {function(remoting.HostController.State):void} callback + * @param {function(remoting.HostController.State):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getDaemonState = function(callback, onError) { +remoting.HostDispatcher.prototype.getDaemonState = function(onDone, onError) { switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getDaemonState.bind(this, callback, onError)); + this.getDaemonState.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.getDaemonState(callback, onError); + this.nativeMessagingHost_.getDaemonState(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: // Call the callback directly, since NPAPI exposes the state directly as @@ -338,22 +334,21 @@ remoting.HostDispatcher.prototype.getDaemonState = function(callback, onError) { if (state === undefined) { onError(remoting.Error.MISSING_PLUGIN); } else { - callback(state); + onDone(state); } break; } }; /** - * @param {function(Array.<remoting.PairedClient>):void} callback + * @param {function(Array.<remoting.PairedClient>):void} onDone * @param {function(remoting.Error):void} onError * @return {void} */ -remoting.HostDispatcher.prototype.getPairedClients = function(callback, - onError) { +remoting.HostDispatcher.prototype.getPairedClients = function(onDone, onError) { /** * Converts the JSON string from the NPAPI plugin to Array.<PairedClient>, to - * pass to |callback|. + * pass to |onDone|. * @param {string} pairedClientsJson * @return {void} */ @@ -361,7 +356,7 @@ remoting.HostDispatcher.prototype.getPairedClients = function(callback, var pairedClients = remoting.PairedClient.convertToPairedClientArray( jsonParseSafe(pairedClientsJson)); if (pairedClients != null) { - callback(pairedClients); + onDone(pairedClients); } else { onError(remoting.Error.UNEXPECTED); } @@ -370,10 +365,10 @@ remoting.HostDispatcher.prototype.getPairedClients = function(callback, switch (this.state_) { case remoting.HostDispatcher.State.UNKNOWN: this.pendingRequests_.push( - this.getPairedClients.bind(this, callback, onError)); + this.getPairedClients.bind(this, onDone, onError)); break; case remoting.HostDispatcher.State.NATIVE_MESSAGING: - this.nativeMessagingHost_.getPairedClients(callback, onError); + this.nativeMessagingHost_.getPairedClients(onDone, onError); break; case remoting.HostDispatcher.State.NPAPI: try { diff --git a/remoting/webapp/host_native_messaging.js b/remoting/webapp/host_native_messaging.js index 3da45c3..c6ce36a 100644 --- a/remoting/webapp/host_native_messaging.js +++ b/remoting/webapp/host_native_messaging.js @@ -39,15 +39,15 @@ remoting.HostNativeMessaging = function() { * Type used for entries of |pendingReplies_| list. * * @param {string} type Type of the originating request. - * @param {?function(...):void} callback The callback, if any, to be triggered + * @param {?function(...):void} onDone The callback, if any, to be triggered * on response. The actual parameters depend on the original request type. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @constructor */ -remoting.HostNativeMessaging.PendingReply = function(type, callback, onError) { +remoting.HostNativeMessaging.PendingReply = function(type, onDone, onError) { this.type = type; - this.callback = callback; + this.onDone = onDone; this.onError = onError; }; @@ -148,25 +148,24 @@ function asHostState_(result) { /** * Attaches a new ID to the supplied message, and posts it to the Native - * Messaging port, adding |callback| to the list of pending replies. + * Messaging port, adding |onDone| to the list of pending replies. * |message| should have its 'type' field set, and any other fields set * depending on the message type. * * @param {{type: string}} message The message to post. - * @param {?function(...):void} callback The callback, if any, to be triggered + * @param {?function(...):void} onDone The callback, if any, to be triggered * on response. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. * @private */ -remoting.HostNativeMessaging.prototype.postMessage_ = function(message, - callback, - onError) { +remoting.HostNativeMessaging.prototype.postMessage_ = + function(message, onDone, onError) { var id = this.nextId_++; message['id'] = id; this.pendingReplies_[id] = new remoting.HostNativeMessaging.PendingReply( - message.type + 'Response', callback, onError); + message.type + 'Response', onDone, onError); this.port_.postMessage(message); }; @@ -191,7 +190,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { } delete this.pendingReplies_[id]; - var callback = reply.callback; + var onDone = reply.onDone; var onError = reply.onError; /** @type {string} */ @@ -213,7 +212,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { var version = message['version']; if (checkType_('version', version, 'string')) { this.version_ = version; - callback(); + onDone(); } else { onError(remoting.Error.UNEXPECTED); } @@ -223,7 +222,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { /** @type {*} */ var hostname = message['hostname']; if (checkType_('hostname', hostname, 'string')) { - callback(hostname); + onDone(hostname); } else { onError(remoting.Error.UNEXPECTED); } @@ -233,7 +232,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { /** @type {*} */ var hash = message['hash']; if (checkType_('hash', hash, 'string')) { - callback(hash); + onDone(hash); } else { onError(remoting.Error.UNEXPECTED); } @@ -246,7 +245,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { var publicKey = message['publicKey']; if (checkType_('privateKey', privateKey, 'string') && checkType_('publicKey', publicKey, 'string')) { - callback(privateKey, publicKey); + onDone(privateKey, publicKey); } else { onError(remoting.Error.UNEXPECTED); } @@ -255,7 +254,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { case 'updateDaemonConfigResponse': var result = asAsyncResult_(message['result']); if (result != null) { - callback(result); + onDone(result); } else { onError(remoting.Error.UNEXPECTED); } @@ -265,7 +264,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { /** @type {*} */ var config = message['config']; if (checkType_('config', config, 'object')) { - callback(config); + onDone(config); } else { onError(remoting.Error.UNEXPECTED); } @@ -281,7 +280,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { if (checkType_('supported', supported, 'boolean') && checkType_('allowed', allowed, 'boolean') && checkType_('setByPolicy', setByPolicy, 'boolean')) { - callback(supported, allowed, setByPolicy); + onDone(supported, allowed, setByPolicy); } else { onError(remoting.Error.UNEXPECTED); } @@ -291,7 +290,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { case 'stopDaemonResponse': var result = asAsyncResult_(message['result']); if (result != null) { - callback(result); + onDone(result); } else { onError(remoting.Error.UNEXPECTED); } @@ -300,7 +299,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { case 'getDaemonStateResponse': var state = asHostState_(message['state']); if (state != null) { - callback(state); + onDone(state); } else { onError(remoting.Error.UNEXPECTED); } @@ -310,7 +309,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { var pairedClients = remoting.PairedClient.convertToPairedClientArray( message['pairedClients']); if (pairedClients != null) { - callback(pairedClients); + onDone(pairedClients); } else { onError(remoting.Error.UNEXPECTED); } @@ -321,7 +320,7 @@ remoting.HostNativeMessaging.prototype.onIncomingMessage_ = function(message) { /** @type {boolean} */ var success = message['result']; if (checkType_('success', success, 'boolean')) { - callback(success); + onDone(success); } else { onError(remoting.Error.UNEXPECTED); } @@ -349,15 +348,15 @@ remoting.HostNativeMessaging.prototype.onDisconnect_ = function() { } /** - * @param {function(string):void} callback Callback to be called with the + * @param {function(string):void} onDone Callback to be called with the * local hostname. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.getHostName = function(callback, - onError) { - this.postMessage_({type: 'getHostName'}, callback, onError); +remoting.HostNativeMessaging.prototype.getHostName = + function(onDone, onError) { + this.postMessage_({type: 'getHostName'}, onDone, onError); }; /** @@ -366,19 +365,18 @@ remoting.HostNativeMessaging.prototype.getHostName = function(callback, * * @param {string} hostId The host ID. * @param {string} pin The PIN. - * @param {function(string):void} callback Callback. + * @param {function(string):void} onDone Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.getPinHash = function(hostId, pin, - callback, - onError) { +remoting.HostNativeMessaging.prototype.getPinHash = + function(hostId, pin, onDone, onError) { this.postMessage_({ type: 'getPinHash', hostId: hostId, pin: pin - }, callback, onError); + }, onDone, onError); }; /** @@ -386,14 +384,14 @@ remoting.HostNativeMessaging.prototype.getPinHash = function(hostId, pin, * when the key is generated. The key is returned in format understood by the * host (PublicKeyInfo structure encoded with ASN.1 DER, and then BASE64). * - * @param {function(string, string):void} callback Callback. + * @param {function(string, string):void} onDone Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.generateKeyPair = function(callback, - onError) { - this.postMessage_({type: 'generateKeyPair'}, callback, onError); +remoting.HostNativeMessaging.prototype.generateKeyPair = + function(onDone, onError) { + this.postMessage_({type: 'generateKeyPair'}, onDone, onError); }; /** @@ -405,32 +403,32 @@ remoting.HostNativeMessaging.prototype.generateKeyPair = function(callback, * is called. * * @param {Object} config The new config parameters. - * @param {function(remoting.HostController.AsyncResult):void} callback + * @param {function(remoting.HostController.AsyncResult):void} onDone * Callback to be called when finished. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ remoting.HostNativeMessaging.prototype.updateDaemonConfig = - function(config, callback, onError) { + function(config, onDone, onError) { this.postMessage_({ type: 'updateDaemonConfig', config: config - }, callback, onError); + }, onDone, onError); }; /** * Loads daemon config. The config is passed as a JSON formatted string to the * callback. * - * @param {function(Object):void} callback Callback. + * @param {function(Object):void} onDone Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.getDaemonConfig = function(callback, - onError) { - this.postMessage_({type: 'getDaemonConfig'}, callback, onError); +remoting.HostNativeMessaging.prototype.getDaemonConfig = + function(onDone, onError) { + this.postMessage_({type: 'getDaemonConfig'}, onDone, onError); }; /** @@ -447,14 +445,14 @@ remoting.HostNativeMessaging.prototype.getDaemonVersion = function() { * Get the user's consent to crash reporting. The consent flags are passed to * the callback as booleans: supported, allowed, set-by-policy. * - * @param {function(boolean, boolean, boolean):void} callback Callback. + * @param {function(boolean, boolean, boolean):void} onDone Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ remoting.HostNativeMessaging.prototype.getUsageStatsConsent = - function(callback, onError) { - this.postMessage_({type: 'getUsageStatsConsent'}, callback, onError); + function(onDone, onError) { + this.postMessage_({type: 'getUsageStatsConsent'}, onDone, onError); }; /** @@ -462,46 +460,46 @@ remoting.HostNativeMessaging.prototype.getUsageStatsConsent = * * @param {Object} config Host configuration. * @param {boolean} consent Consent to report crash dumps. - * @param {function(remoting.HostController.AsyncResult):void} callback + * @param {function(remoting.HostController.AsyncResult):void} onDone * Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.startDaemon = function( - config, consent, callback, onError) { +remoting.HostNativeMessaging.prototype.startDaemon = + function(config, consent, onDone, onError) { this.postMessage_({ type: 'startDaemon', config: config, consent: consent - }, callback, onError); + }, onDone, onError); }; /** * Stops the daemon process. * - * @param {function(remoting.HostController.AsyncResult):void} callback + * @param {function(remoting.HostController.AsyncResult):void} onDone * Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.stopDaemon = function(callback, - onError) { - this.postMessage_({type: 'stopDaemon'}, callback, onError); +remoting.HostNativeMessaging.prototype.stopDaemon = + function(onDone, onError) { + this.postMessage_({type: 'stopDaemon'}, onDone, onError); }; /** * Gets the installed/running state of the Host process. * - * @param {function(remoting.HostController.State):void} callback Callback. + * @param {function(remoting.HostController.State):void} onDone Callback. * @param {function(remoting.Error):void} onError The callback to be triggered * on error. * @return {void} Nothing. */ -remoting.HostNativeMessaging.prototype.getDaemonState = function(callback, - onError) { - this.postMessage_({type: 'getDaemonState'}, callback, onError); +remoting.HostNativeMessaging.prototype.getDaemonState = + function(onDone, onError) { + this.postMessage_({type: 'getDaemonState'}, onDone, onError); } /** |