You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2012/08/03 17:18:02 UTC

[5/9] ios commit: Update CDVLocalStorage to new exec format.

Update CDVLocalStorage to new exec format.


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/0b9c472b
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/0b9c472b
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/0b9c472b

Branch: refs/heads/master
Commit: 0b9c472b53f85d0bf845db17b48314221fb4cd70
Parents: 46ecf98
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Aug 3 11:08:07 2012 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Aug 3 11:16:59 2012 -0400

----------------------------------------------------------------------
 CordovaLib/Classes/CDVLocalStorage.h |    6 +++---
 CordovaLib/Classes/CDVLocalStorage.m |   18 +++++++++---------
 2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/0b9c472b/CordovaLib/Classes/CDVLocalStorage.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVLocalStorage.h b/CordovaLib/Classes/CDVLocalStorage.h
index 1c10098..9abb9a2 100644
--- a/CordovaLib/Classes/CDVLocalStorage.h
+++ b/CordovaLib/Classes/CDVLocalStorage.h
@@ -28,9 +28,9 @@
 
 - (BOOL) shouldBackup;
 - (BOOL) shouldRestore;
-- (void) backup:(NSArray*)arguments withDict:(NSMutableDictionary*)options;
-- (void) restore:(NSArray*)arguments withDict:(NSMutableDictionary*)options;
-- (void) verifyAndFixDatabaseLocations:(NSArray*)arguments withDict:(NSMutableDictionary*)options;
+- (void) backup:(CDVInvokedUrlCommand*)command;
+- (void) restore:(CDVInvokedUrlCommand*)command;
+- (void) verifyAndFixDatabaseLocations:(CDVInvokedUrlCommand*)command;
 
 + (void) __verifyAndFixDatabaseLocations;
 // Visible for testing.

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/0b9c472b/CordovaLib/Classes/CDVLocalStorage.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVLocalStorage.m b/CordovaLib/Classes/CDVLocalStorage.m
index f59cd08..37352ca 100644
--- a/CordovaLib/Classes/CDVLocalStorage.m
+++ b/CordovaLib/Classes/CDVLocalStorage.m
@@ -104,7 +104,7 @@
         theWebView.delegate = self;
         
         // verify the and fix the iOS 5.1 database locations once
-        [self verifyAndFixDatabaseLocations:nil withDict:nil];
+        [self verifyAndFixDatabaseLocations:nil];
     }
     
     return self;
@@ -188,9 +188,9 @@
 }
                 
 /* copy from webkitDbLocation to persistentDbLocation */
-- (void) backup:(NSArray*)arguments withDict:(NSMutableDictionary*)options;
+- (void) backup:(CDVInvokedUrlCommand*)command
 {
-    NSString* callbackId = [arguments objectAtIndex:0];
+    NSString* callbackId = command.callbackId;
 
     NSError* __autoreleasing error = nil;
     CDVPluginResult* result = nil;
@@ -223,9 +223,9 @@
 }
 
 /* copy from persistentDbLocation to webkitDbLocation */
-- (void) restore:(NSArray*)arguments withDict:(NSMutableDictionary*)options;
+- (void) restore:(CDVInvokedUrlCommand*)command
 {
-    NSString* callbackId = [arguments objectAtIndex:0];
+    NSString* callbackId = command.callbackId;
     
     NSError* __autoreleasing error = nil;
     CDVPluginResult* result = nil;
@@ -255,7 +255,7 @@
     }
 }
 
-- (void) verifyAndFixDatabaseLocations:(NSArray*)arguments withDict:(NSMutableDictionary*)options
+- (void) verifyAndFixDatabaseLocations:(CDVInvokedUrlCommand*)command
 {
     [[self class] __verifyAndFixDatabaseLocations];
 }
@@ -327,7 +327,7 @@
     
     if (exitsOnSuspend)
     {
-        [self backup:nil withDict:nil];
+        [self backup:nil];
     } 
     else if (isMultitaskingSupported) 
     {
@@ -341,7 +341,7 @@
         CDVLocalStorage __unsafe_unretained *weakSelf = self;
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
-            [weakSelf backup:nil withDict:nil];
+            [weakSelf backup:nil];
             
             [[UIApplication sharedApplication] endBackgroundTask: backgroundTaskID];
             backgroundTaskID = UIBackgroundTaskInvalid;
@@ -359,7 +359,7 @@
 
 - (void) webViewDidStartLoad:(UIWebView*)theWebView
 {
-    [self restore:nil withDict:nil];
+    [self restore:nil];
     
     return [self.webviewDelegate webViewDidStartLoad:theWebView];
 }