Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 19FB617A44 for ; Tue, 21 Apr 2015 01:00:00 +0000 (UTC) Received: (qmail 97279 invoked by uid 500); 21 Apr 2015 01:00:00 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 97256 invoked by uid 500); 21 Apr 2015 01:00:00 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 97235 invoked by uid 99); 21 Apr 2015 00:59:59 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Apr 2015 00:59:59 +0000 Date: Tue, 21 Apr 2015 00:59:59 +0000 (UTC) From: "Shazron Abdullah (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (CB-8207) [WKWebView][iOS 8] Unnecessary JSON conversion and possible leak MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-8207?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Shazron Abdullah resolved CB-8207. ---------------------------------- Resolution: Fixed Fixed by CB-8838 > [WKWebView][iOS 8] Unnecessary JSON conversion and possible leak > ---------------------------------------------------------------- > > Key: CB-8207 > URL: https://issues.apache.org/jira/browse/CB-8207 > Project: Apache Cordova > Issue Type: Sub-task > Components: CordovaJS, iOS > Affects Versions: 3.5.0 > Reporter: Incarnadine > Assignee: Shazron Abdullah > Fix For: 4.0.0 > > > The WKWebView bridge is calling JSON.stringify and adding the result to the command queue which appears to be unnecessary. > The JSON conversion negates part of the performance gain of letting WKScriptMessage marshal the array. > Additionally, since commands with WKWebView are processed immediately, it's unclear what will happen to the queued commands. Something will either process them resulting in duplicate command execution, or the queue will continue to grow and allocate memory. > See ios/exec.js: > {code} > // FIXME: This call may be unnecessary depending on how > // WKScriptMesssage marshals ArrayBuffer > actionArgs = massageArgsJsToNative(actionArgs); > var command = [callbackId, service, action, actionArgs]; > // FIXME: This is unnecessary with WKWebView binding > // and should move into the else below > commandQueue.push(JSON.stringify(command)); > > if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) { > window.webkit.messageHandlers.cordova.postMessage(command); > } else { > if (!isInContextOfEvalJs && commandQueue.length == 1) { > pokeNative(); > } > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org