From: Rafal Galka Date: Mon, 12 Jan 2015 10:04:29 +0000 (+0100) Subject: [Common] Async calls performed by sendSyncMessage X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b8de65347868606e4372549fffd03e80cef1bb2e;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Common] Async calls performed by sendSyncMessage [Message] This allows to handle exceptions thrown before async operation starts (eg. SecurityException). This patch replaces: http://168.219.209.56/gerrit/#/c/14446/ http://168.219.209.56/gerrit/#/c/14479/ Change-Id: Ifac6f168580fa4209741ff5f8b4f8a219820d7ef --- diff --git a/src/utils/utils_api.js b/src/utils/utils_api.js index 87c2f71b..87f189e9 100644 --- a/src/utils/utils_api.js +++ b/src/utils/utils_api.js @@ -778,12 +778,7 @@ NativeManager.prototype.call = function(cmd, args, callback) { args[this.CALLBACK_ID_KEY] = replyId; this.callbacks_[replyId] = callback; - var request = JSON.stringify({ - cmd: cmd, - args: args - }); - - this.extension.postMessage(request); + return this.callSync(cmd, args); }; NativeManager.prototype.callSync = function(cmd, args) {