Title: [89855] branches/safari-534-branch/Source/WebCore

Diff

Modified: branches/safari-534-branch/Source/WebCore/ChangeLog (89854 => 89855)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-06-27 21:20:01 UTC (rev 89854)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-06-27 21:20:49 UTC (rev 89855)
@@ -1,3 +1,26 @@
+2011-06-27  Lucas Forschler  <[email protected]>
+
+    Merged 89718.
+
+    2011-06-24  Jer Noble  <[email protected]>
+
+        Reviewed by Eric Carlson.
+
+        Safari will quit unexpectedly when launching Safari in the first time (crash in initQTSecurityPolicyNoLocalToRemoteSiteAttribute)
+        https://bugs.webkit.org/show_bug.cgi?id=63332
+        <rdar://problem/9661650>
+
+        No new tests; Only affects machines with QTKit < 7.6.3 installed.
+
+        Check to see if QTSecurityPolicyNoRemoteToLocalSiteAttribute is non-NULL before passing it into -[QTMovie initWithAttributes:],
+        as it is only defined in QTKit >= 7.6.3.  If it is NULL, pass QTSecurityPolicyNoCrossSiteAttribute=YES instead, which has
+        the same effect in earlier versions of QTKit as the NoLocalToRemote and NoRemoteToLocal keys.  To avoid ASSERTs when running
+        debug builds with earlier versions of QTKit, add a SOFT_LINK_POINTER_OPTIONAL macro to SoftLinking.h and make these keys optional.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivateQTKit::commonMovieAttributes):
+        * platform/mac/SoftLinking.h: Add SOFT_LINK_POINTER_OPTIONAL macro.
+
 2011-06-24  Lucas Forschler  <[email protected]>
 
     Merged 89714.

Modified: branches/safari-534-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (89854 => 89855)


--- branches/safari-534-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2011-06-27 21:20:01 UTC (rev 89854)
+++ branches/safari-534-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm	2011-06-27 21:20:49 UTC (rev 89855)
@@ -97,12 +97,13 @@
 SOFT_LINK_POINTER(QTKit, QTMovieURLAttribute, NSString *)
 SOFT_LINK_POINTER(QTKit, QTMovieVolumeDidChangeNotification, NSString *)
 SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoCrossSiteAttribute, NSString *)
-SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoLocalToRemoteSiteAttribute, NSString *)
-SOFT_LINK_POINTER(QTKit, QTSecurityPolicyNoRemoteToLocalSiteAttribute, NSString *)
 SOFT_LINK_POINTER(QTKit, QTVideoRendererWebKitOnlyNewImageAvailableNotification, NSString *)
 SOFT_LINK_POINTER(QTKit, QTMovieApertureModeClean, NSString *)
 SOFT_LINK_POINTER(QTKit, QTMovieApertureModeAttribute, NSString *)
 
+SOFT_LINK_POINTER_OPTIONAL(QTKit, QTSecurityPolicyNoLocalToRemoteSiteAttribute, NSString *)
+SOFT_LINK_POINTER_OPTIONAL(QTKit, QTSecurityPolicyNoRemoteToLocalSiteAttribute, NSString *)
+
 #define QTMovie getQTMovieClass()
 #define QTMovieView getQTMovieViewClass()
 #define QTMovieLayer getQTMovieLayerClass()
@@ -239,15 +240,22 @@
     NSMutableDictionary *movieAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
             [NSNumber numberWithBool:m_player->preservesPitch()], QTMovieRateChangesPreservePitchAttribute,
             [NSNumber numberWithBool:YES], QTMoviePreventExternalURLLinksAttribute,
-            [NSNumber numberWithBool:NO], QTSecurityPolicyNoCrossSiteAttribute,
-            [NSNumber numberWithBool:YES], QTSecurityPolicyNoRemoteToLocalSiteAttribute,
-            [NSNumber numberWithBool:YES], QTSecurityPolicyNoLocalToRemoteSiteAttribute,
             [NSNumber numberWithBool:NO], QTMovieAskUnresolvedDataRefsAttribute,
             [NSNumber numberWithBool:NO], QTMovieLoopsAttribute,
             [NSNumber numberWithBool:!m_privateBrowsing], @"QTMovieAllowPersistentCacheAttribute",
             QTMovieApertureModeClean, QTMovieApertureModeAttribute,
             nil];
 
+    // Check to see if QTSecurityPolicyNoRemoteToLocalSiteAttribute is defined, which was added in QTKit 7.6.3.
+    // If not, just set NoCrossSite = YES, which does the same thing as NoRemoteToLocal = YES and 
+    // NoLocalToRemote = YES in QTKit < 7.6.3.
+    if (QTSecurityPolicyNoRemoteToLocalSiteAttribute) {
+        [movieAttributes setValue:[NSNumber numberWithBool:NO] forKey:QTSecurityPolicyNoCrossSiteAttribute];
+        [movieAttributes setValue:[NSNumber numberWithBool:YES] forKey:QTSecurityPolicyNoRemoteToLocalSiteAttribute];
+        [movieAttributes setValue:[NSNumber numberWithBool:YES] forKey:QTSecurityPolicyNoLocalToRemoteSiteAttribute];
+    } else
+        [movieAttributes setValue:[NSNumber numberWithBool:YES] forKey:QTSecurityPolicyNoCrossSiteAttribute];
+
     if (m_preload < MediaPlayer::Auto)
         [movieAttributes setValue:[NSNumber numberWithBool:YES] forKey:@"QTMovieLimitReadAheadAttribute"];
 

Modified: branches/safari-534-branch/Source/WebCore/platform/mac/SoftLinking.h (89854 => 89855)


--- branches/safari-534-branch/Source/WebCore/platform/mac/SoftLinking.h	2011-06-27 21:20:01 UTC (rev 89854)
+++ branches/safari-534-branch/Source/WebCore/platform/mac/SoftLinking.h	2011-06-27 21:20:49 UTC (rev 89855)
@@ -124,6 +124,24 @@
         return pointer##name; \
     }
 
+#define SOFT_LINK_POINTER_OPTIONAL(framework, name, type) \
+    static type init##name(); \
+    static type (*get##name)() = init##name; \
+    static type pointer##name; \
+    \
+    static type name##Function() \
+    { \
+        return pointer##name; \
+    }\
+    \
+    static type init##name() \
+    { \
+        void** pointer = static_cast<void**>(dlsym(framework##Library(), #name)); \
+        pointer##name = static_cast<type>(*pointer); \
+        get##name = name##Function; \
+        return pointer##name; \
+    }
+
 #define SOFT_LINK_CONSTANT(framework, name, type) \
     static type init##name(); \
     static type (*get##name)() = init##name; \
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to