Shuffle some code around in preparation for a change to how poseAsWebKitApp works.
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2009 21:41:01 +0000 (21:41 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 Jul 2009 21:41:01 +0000 (21:41 +0000)
Reviewed by Simon Fraser.

* WebKitLauncher/WebKitNightlyEnabler.m:
(systemVersion):
(webKitLauncherBundle):
(insideSafari4OnTigerTrampoline):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@45450 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/WebKitLauncher/WebKitNightlyEnabler.m

index 948425b..e06ecd0 100644 (file)
@@ -1,3 +1,14 @@
+2009-07-01  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Shuffle some code around in preparation for a change to how poseAsWebKitApp works.
+
+        * WebKitLauncher/WebKitNightlyEnabler.m:
+        (systemVersion):
+        (webKitLauncherBundle):
+        (insideSafari4OnTigerTrampoline):
+
 2009-06-30  Xan Lopez  <xlopez@igalia.com>
 
         Reviewed by Jan Alonzo.
index 7d399b0..6501d2e 100644 (file)
@@ -45,6 +45,16 @@ static char *webKitAppPath;
 static bool extensionBundlesWereLoaded = NO;
 static NSSet *extensionPaths = nil;
 
+static int32_t systemVersion()
+{
+    static SInt32 version = 0;
+    if (!version)
+        Gestalt(gestaltSystemVersion, &version);
+
+    return version;
+}
+
+
 static void myBundleDidLoad(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo)
 {
     NSBundle *bundle = (NSBundle *)object;
@@ -98,6 +108,14 @@ static void myApplicationWillTerminate(CFNotificationCenterRef center, void *obs
     [userDefaults synchronize];
 }
 
+NSBundle *webKitLauncherBundle()
+{
+    NSString *executablePath = [NSString stringWithUTF8String:webKitAppPath];
+    NSRange appLocation = [executablePath rangeOfString:@".app/" options:NSBackwardsSearch];
+    NSString *appPath = [executablePath substringToIndex:appLocation.location + appLocation.length];
+    return [NSBundle bundleWithPath:appPath];
+}
+
 extern char **_CFGetProcessPath() __attribute__((weak));
 
 static void poseAsWebKitApp()
@@ -120,22 +138,10 @@ static void poseAsWebKitApp()
     unsetenv("WebKitAppPath");
 }
 
-NSBundle *webKitLauncherBundle()
-{
-    NSString *executablePath = [NSString stringWithUTF8String:webKitAppPath];
-    NSRange appLocation = [executablePath rangeOfString:@".app/" options:NSBackwardsSearch];
-    NSString *appPath = [executablePath substringToIndex:appLocation.location + appLocation.length];
-    return [NSBundle bundleWithPath:appPath];
-}
-
 static BOOL insideSafari4OnTigerTrampoline()
 {
-    SInt32 systemVersion;
-    if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr)
-        return NO;
-
     // If we're not on Tiger then we can't be in the trampoline state.
-    if ((systemVersion & 0xFFF0) != 0x1040)
+    if ((systemVersion() & 0xFFF0) != 0x1040)
         return NO;
 
     // If we're running Safari < 4.0 then we can't be in the trampoline state.