You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2012/03/24 00:27:29 UTC

ios commit: Fixed CB-349 - Remove sessionKey usage (unused) in CDVViewController

Updated Branches:
  refs/heads/master 11b8f659f -> dbc98e8a6


Fixed CB-349 - Remove sessionKey usage (unused) in CDVViewController


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

Branch: refs/heads/master
Commit: dbc98e8a6636a6fcb1644fbc2ac6430345dd8d7c
Parents: 11b8f65
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Mar 23 16:27:20 2012 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Mar 23 16:27:20 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.h |    1 -
 CordovaLib/Classes/CDVViewController.m |   12 +-----------
 2 files changed, 1 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dbc98e8a/CordovaLib/Classes/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.h b/CordovaLib/Classes/CDVViewController.h
index 11a15e1..83f20bc 100644
--- a/CordovaLib/Classes/CDVViewController.h
+++ b/CordovaLib/Classes/CDVViewController.h
@@ -36,7 +36,6 @@
 @property (nonatomic, readonly, retain) NSDictionary* settings;
 @property (nonatomic, readonly, retain) CDVWhitelist* whitelist; // readonly for public
 @property (nonatomic, readonly, retain) NSArray* supportedOrientations;
-@property (nonatomic, readonly, copy)   NSString* sessionKey;
 @property (nonatomic, readonly, assign) BOOL loadFromString;
 
 @property (nonatomic, readwrite, assign) BOOL useSplashScreen;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/dbc98e8a/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index f86b28e..2eafc23 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -30,7 +30,6 @@
 @property (nonatomic, readwrite, retain) NSMutableDictionary* pluginObjects;
 @property (nonatomic, readwrite, retain) NSDictionary* pluginsMap;
 @property (nonatomic, readwrite, retain) NSArray* supportedOrientations;
-@property (nonatomic, readwrite, copy)   NSString* sessionKey;
 @property (nonatomic, readwrite, assign) BOOL loadFromString;
 
 @property (nonatomic, readwrite, retain) IBOutlet UIActivityIndicatorView* activityView;
@@ -43,7 +42,7 @@
 
 @synthesize webView, supportedOrientations;
 @synthesize pluginObjects, pluginsMap, whitelist;
-@synthesize settings, sessionKey, loadFromString;
+@synthesize settings, loadFromString;
 @synthesize imageView, activityView, useSplashScreen, commandDelegate;
 @synthesize wwwFolderName, startPage;
 
@@ -95,10 +94,6 @@
 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
 - (void) viewDidLoad 
 {
-    if (self.sessionKey == nil) {
-        self.sessionKey = [NSString stringWithFormat:@"%d", arc4random()];
-    }
-    
     [super viewDidLoad];
 	
     self.pluginObjects = [[[NSMutableDictionary alloc] initWithCapacity:4] autorelease];
@@ -359,11 +354,6 @@
  */
 - (void) webViewDidFinishLoad:(UIWebView*)theWebView 
 {
-    // Share session key with the WebView by setting Cordova.sessionKey
-    // TODO: wtf is the sessionKey ?
-    NSString *sessionKeyScript = [NSString stringWithFormat:@"sessionKey = \"%@\";", self.sessionKey];
-    [theWebView stringByEvaluatingJavaScriptFromString:sessionKeyScript];
-	
     NSDictionary *deviceProperties = [ self deviceProperties];
     NSMutableString *result = [[NSMutableString alloc] initWithFormat:@"try{cordova.require('cordova/plugin/ios/device').setInfo(%@);}catch(e){alert('errorz1!!!');alert(JSON.stringify(e))}", [deviceProperties JSONString]];