incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [6/11] ios commit: Delete cordova.commandQueueFlushing flag.
Date Thu, 04 Oct 2012 19:55:58 GMT
Delete cordova.commandQueueFlushing flag.

The previous optimization of checking for messages when sending callback
results make this flag unnecessary.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/de046f7a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/de046f7a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/de046f7a

Branch: refs/heads/master
Commit: de046f7ae64421d69fd52befd2b5fd3c351ac28a
Parents: 4e52b1e
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Oct 4 12:55:28 2012 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Oct 4 15:00:57 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCommandQueue.m |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/de046f7a/CordovaLib/Classes/CDVCommandQueue.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCommandQueue.m b/CordovaLib/Classes/CDVCommandQueue.m
index a7d2126..8c52e39 100644
--- a/CordovaLib/Classes/CDVCommandQueue.m
+++ b/CordovaLib/Classes/CDVCommandQueue.m
@@ -60,30 +60,13 @@
     }
 }
 
-/**
- * Repeatedly fetches and executes the command queue until it is empty.
- */
 - (void)fetchCommandsFromJs
 {
-    [_viewController.webView stringByEvaluatingJavaScriptFromString:
-        @"cordova.commandQueueFlushing = true"];
-
-    // Keep executing the command queue until no commands get executed.
-    // This ensures that commands that are queued while executing other
-    // commands are executed as well.
-    for (;; ) {
-        // Grab all the queued commands from the JS side.
-        NSString* queuedCommandsJSON = [_viewController.webView stringByEvaluatingJavaScriptFromString:
-            @"cordova.require('cordova/exec').nativeFetchMessages()"];
-
-        if ([queuedCommandsJSON length] == 0) {
-            break;
-        }
-        [self enqueCommandBatch:queuedCommandsJSON];
-    }
+    // Grab all the queued commands from the JS side.
+    NSString* queuedCommandsJSON = [_viewController.webView stringByEvaluatingJavaScriptFromString:
+        @"cordova.require('cordova/exec').nativeFetchMessages()"];
 
-    [_viewController.webView stringByEvaluatingJavaScriptFromString:
-        @"cordova.commandQueueFlushing = false"];
+    [self enqueCommandBatch:queuedCommandsJSON];
 }
 
 - (void)executePending


Mime
View raw message