cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Incarnadine (JIRA)" <>
Subject [jira] [Created] (CB-8207) [WKWebView][iOS 8] Unnecessary JSON conversion and possible leak
Date Tue, 23 Dec 2014 00:33:13 GMT
Incarnadine created CB-8207:

             Summary: [WKWebView][iOS 8] Unnecessary JSON conversion and possible leak
                 Key: CB-8207
             Project: Apache Cordova
          Issue Type: Bug
          Components: iOS
    Affects Versions: 3.5.0
            Reporter: Incarnadine

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:

    // 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
    if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
    } else {
        if (!isInContextOfEvalJs && commandQueue.length == 1) {

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message