Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78787D58F for ; Fri, 26 Oct 2012 20:10:50 +0000 (UTC) Received: (qmail 98826 invoked by uid 500); 26 Oct 2012 20:10:50 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 98699 invoked by uid 500); 26 Oct 2012 20:10:50 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@cordova.apache.org Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 98685 invoked by uid 500); 26 Oct 2012 20:10:50 -0000 Delivered-To: apmail-incubator-callback-commits@incubator.apache.org Received: (qmail 98679 invoked by uid 99); 26 Oct 2012 20:10:50 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Oct 2012 20:10:50 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0B5434FFEA; Fri, 26 Oct 2012 20:10:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: agrieve@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [1/2] android commit: Update JS to new tag (again). Includes latest fix to CB-1745. Message-Id: <20121026201050.0B5434FFEA@tyr.zones.apache.org> Date: Fri, 26 Oct 2012 20:10:50 +0000 (UTC) Updated Branches: refs/heads/master e4f8f44fb -> 3c5815ac0 Updated Tags: refs/tags/2.2.0rc2 e4f8f44fb -> 3c5815ac0 Update JS to new tag (again). Includes latest fix to CB-1745. Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/3c5815ac Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/3c5815ac Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/3c5815ac Branch: refs/heads/master Commit: 3c5815ac0fc1f28a2cba54e648b9d0a7f175ff4e Parents: 678ae2d Author: Andrew Grieve Authored: Fri Oct 26 16:09:54 2012 -0400 Committer: Andrew Grieve Committed: Fri Oct 26 16:09:54 2012 -0400 ---------------------------------------------------------------------- framework/assets/js/cordova.android.js | 39 ++++++++++++++++---------- 1 files changed, 24 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/3c5815ac/framework/assets/js/cordova.android.js ---------------------------------------------------------------------- diff --git a/framework/assets/js/cordova.android.js b/framework/assets/js/cordova.android.js index 131d654..8dd0ed6 100644 --- a/framework/assets/js/cordova.android.js +++ b/framework/assets/js/cordova.android.js @@ -1,6 +1,6 @@ -// commit 97a05cb0f672ee1bfb7e9e14a0dfd452d7763ba9 +// commit d819e1e60599c12ac831379b06bba9110e9f1790 -// File generated at :: Fri Oct 26 2012 10:37:55 GMT-0400 (EDT) +// File generated at :: Fri Oct 26 2012 16:03:51 GMT-0400 (EDT) /* Licensed to the Apache Software Foundation (ASF) under one @@ -1001,8 +1001,8 @@ function pollOnce() { function pollingTimerFunc() { if (pollEnabled) { - pollOnce(); - setTimeout(pollingTimerFunc, 50); + pollOnce(); + setTimeout(pollingTimerFunc, 50); } } @@ -1095,25 +1095,34 @@ function processMessage(message) { // This is called from the NativeToJsMessageQueue.java. androidExec.processMessages = function(messages) { - messagesFromNative.push(messages); - // Check for the reentrant case, and enqueue the message if that's the case. - if (messagesFromNative.length > 1) { - return; - } - while (messagesFromNative.length) { - messages = messagesFromNative[0]; - while (messages) { + if (messages) { + messagesFromNative.push(messages); + while (messagesFromNative.length) { + messages = messagesFromNative.shift(); + // The Java side can send a * message to indicate that it + // still has messages waiting to be retrieved. + // TODO(agrieve): This is currently disabled on the Java side + // since it breaks returning the result in exec of synchronous + // plugins. Once we remove this ability, we can remove this comment. if (messages == '*') { window.setTimeout(pollOnce, 0); - break; + continue; } + var spaceIdx = messages.indexOf(' '); var msgLen = +messages.slice(0, spaceIdx); var message = messages.substr(spaceIdx + 1, msgLen); messages = messages.slice(spaceIdx + msgLen + 1); - processMessage(message); + // Put the remaining messages back into queue in case an exec() + // is made by the callback. + if (messages) { + messagesFromNative.unshift(messages); + } + + if (message) { + processMessage(message); + } } - messagesFromNative.shift(); } };