Changeset 44680 in webkit


Ignore:
Timestamp:
Jun 15, 2009 12:37:38 AM (15 years ago)
Author:
mrowe@apple.com
Message:

Fix <https://bugs.webkit.org/show_bug.cgi?id=26312>.
Bug 26312: Multiple copies of Safari opened with WebKit nightly and Safari 3.2.3

Reviewed by Cameron Zwarich.

Skip the trampoline detection for versions of Safari < 4.0 as they don't play these
tricks, and having WebKitNightlyEnabler assume that we were in the trampoline was
preventing our LaunchServices trickery from being run. This led to fresh copies of
WebKit.app being launched when a URL or file was opened from an external application
rather than the existing instance being reused.

  • WebKitLauncher/WebKitNightlyEnabler.m:

(insideSafari4OnTigerTrampoline):
(enableWebKitNightlyBehaviour):

Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r44660 r44680  
     12009-06-15  Mark Rowe  <mrowe@apple.com>
     2
     3        Reviewed by Cameron Zwarich.
     4
     5        Fix <https://bugs.webkit.org/show_bug.cgi?id=26312>.
     6        Bug 26312: Multiple copies of Safari opened with WebKit nightly and Safari 3.2.3
     7
     8        Skip the trampoline detection for versions of Safari < 4.0 as they don't play these
     9        tricks, and having WebKitNightlyEnabler assume that we were in the trampoline was
     10        preventing our LaunchServices trickery from being run.  This led to fresh copies of
     11        WebKit.app being launched when a URL or file was opened from an external application
     12        rather than the existing instance being reused.
     13
     14        * WebKitLauncher/WebKitNightlyEnabler.m:
     15        (insideSafari4OnTigerTrampoline):
     16        (enableWebKitNightlyBehaviour):
     17
    1182009-06-13  Sam Weinig  <sam@webkit.org>
    219
  • trunk/WebKitTools/WebKitLauncher/WebKitNightlyEnabler.m

    r44524 r44680  
    129129}
    130130
    131 static BOOL insideSafariOnTigerTrampoline()
    132 {
    133     SInt32 version;
    134     if (Gestalt(gestaltSystemVersion, &version) != noErr)
     131static BOOL insideSafari4OnTigerTrampoline()
     132{
     133    SInt32 systemVersion;
     134    if (Gestalt(gestaltSystemVersion, &systemVersion) != noErr)
    135135        return NO;
    136136
    137137    // If we're not on Tiger then we can't be in the trampoline state.
    138     if ((version & 0xFFF0) != 0x1040)
     138    if ((systemVersion & 0xFFF0) != 0x1040)
     139        return NO;
     140
     141    // If we're running Safari < 4.0 then we can't be in the trampoline state.
     142    CFBundleRef safariBundle = CFBundleGetMainBundle();
     143    CFStringRef safariVersion = CFBundleGetValueForInfoDictionaryKey(safariBundle, CFSTR("CFBundleShortVersionString"));
     144    if ([(NSString *)safariVersion intValue] < 4)
    139145        return NO;
    140146
     
    153159    // If we're inside Safari in its trampoline state, it will very shortly relaunch itself.
    154160    // We bail out here so that we'll be called again in the freshly-launched Safari process.
    155     if (insideSafariOnTigerTrampoline())
     161    if (insideSafari4OnTigerTrampoline())
    156162        return;
    157163
Note: See TracChangeset for help on using the changeset viewer.