2011-04-22 Jer Noble <jer.noble@apple.com>
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 17:51:00 +0000 (17:51 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Apr 2011 17:51:00 +0000 (17:51 +0000)
        Reviewed by Maciej Stachowiak.

        Disable MediaPlayerPrivateAVFoundation when using old full screen mode.
        https://bugs.webkit.org/show_bug.cgi?id=59147

        Add a new isAVFoundationEnabled setting and check it before adding
        MediaPlayerPrivateAVFoundationObjC to the media engine registry.

        * WebCore.exp.in:
        * page/Settings.cpp:
        * page/Settings.h:
        (WebCore::Settings::setAVFoundationEnabled): Added.
        (WebCore::Settings::isAVFoundationEnabled): Added.
        * platform/graphics/MediaPlayer.cpp:
        (WebCore::installedMediaEngines): Check the settings added above.
2011-04-22  Jer Noble  <jer.noble@apple.com>

        Reviewed by Maciej Stachowiak.

        Disable MediaPlayerPrivateAVFoundation when using old full screen mode.
        https://bugs.webkit.org/show_bug.cgi?id=59147

        Add a new user default preference, and plumb that preference down to WebCore
        Settings. Allow the fullScreenEnabled preference to override the new
        isAVFoundationEnabled preference, so that clients of the legacy full screen
        mode will continue to use that mode normally.

        * WebView/WebPreferenceKeysPrivate.h: Add new preference key.
        * WebView/WebPreferences.mm:
        (+[WebPreferences initialize]): Set the default value of new
            preference.
        (-[WebPreferences setAVFoundationEnabled:]): Added.
        (-[WebPreferences isAVFoundationEnabled]): Added.
        * WebView/WebPreferencesPrivate.h:
        * WebView/WebView.mm:
        (-[WebView _preferencesChanged:]): Update the WebCore settings with the
            new values from WebPreferences.

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm

index a72d992..a06c1f3 100644 (file)
@@ -1,3 +1,21 @@
+2011-04-22  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Disable MediaPlayerPrivateAVFoundation when using old full screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=59147
+
+        Add a new isAVFoundationEnabled setting and check it before adding 
+        MediaPlayerPrivateAVFoundationObjC to the media engine registry.
+
+        * WebCore.exp.in:
+        * page/Settings.cpp:
+        * page/Settings.h:
+        (WebCore::Settings::setAVFoundationEnabled): Added.
+        (WebCore::Settings::isAVFoundationEnabled): Added.
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::installedMediaEngines): Check the settings added above.
+
 2011-04-22  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Gavin Barraclough.
index 4adc82e..12a9a94 100644 (file)
@@ -1867,3 +1867,7 @@ __ZN7WebCore12EventHandler18handleGestureEventERKNS_20PlatformGestureEventE
 __ZN7WebCore14ResourceHandle46setPrivateBrowsingStorageSessionIdentifierBaseERKN3WTF6StringE
 __ZN7WebCore14ResourceHandle29privateBrowsingStorageSessionEv
 #endif
+
+#if USE(AVFOUNDATION)
+__ZN7WebCore8Settings20gAVFoundationEnabledE
+#endif
index dd7ed89..0ca36f9 100644 (file)
@@ -55,6 +55,10 @@ static void setLoadsImagesAutomaticallyInAllFrames(Page* page)
 bool Settings::gShouldPaintNativeControls = true;
 #endif
 
+#if USE(AVFOUNDATION)
+bool Settings::gAVFoundationEnabled(false);
+#endif
+
 #if PLATFORM(WIN) || (OS(WINDOWS) && PLATFORM(WX))
 bool Settings::gShouldUseHighResolutionTimers = true;
 #endif
index 5d69452..60d01b6 100644 (file)
@@ -355,6 +355,11 @@ namespace WebCore {
         bool fullScreenEnabled() const  { return m_fullScreenAPIEnabled; }
 #endif
 
+#if USE(AVFOUNDATION)
+        static void setAVFoundationEnabled(bool flag) { gAVFoundationEnabled = flag; }
+        static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
+#endif
+
         void setAsynchronousSpellCheckingEnabled(bool flag) { m_asynchronousSpellCheckingEnabled = flag; }
         bool asynchronousSpellCheckingEnabled() const  { return m_asynchronousSpellCheckingEnabled; }
 
@@ -498,6 +503,10 @@ namespace WebCore {
         bool m_forceCompositingMode : 1;
         bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1;
 
+#if USE(AVFOUNDATION)
+        static bool gAVFoundationEnabled;
+#endif
+
 #if USE(SAFARI_THEME)
         static bool gShouldPaintNativeControls;
 #endif
index 05c0e06..687dbdd 100644 (file)
@@ -35,6 +35,7 @@
 #include "IntRect.h"
 #include "MIMETypeRegistry.h"
 #include "MediaPlayerPrivate.h"
+#include "Settings.h"
 #include "TimeRanges.h"
 
 #if PLATFORM(QT)
@@ -190,7 +191,8 @@ static Vector<MediaPlayerFactory*>& installedMediaEngines()
 #endif
 
 #if USE(AVFOUNDATION) && PLATFORM(MAC)
-        MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
+        if (Settings::isAVFoundationEnabled())
+            MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
 #endif
 
 #if !PLATFORM(GTK) && !PLATFORM(EFL) && !(PLATFORM(QT) && USE(GSTREAMER))
index 4518441..98eec5d 100644 (file)
@@ -1,3 +1,26 @@
+2011-04-22  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Maciej Stachowiak.
+
+        Disable MediaPlayerPrivateAVFoundation when using old full screen mode.
+        https://bugs.webkit.org/show_bug.cgi?id=59147
+
+        Add a new user default preference, and plumb that preference down to WebCore
+        Settings. Allow the fullScreenEnabled preference to override the new 
+        isAVFoundationEnabled preference, so that clients of the legacy full screen
+        mode will continue to use that mode normally.
+
+        * WebView/WebPreferenceKeysPrivate.h: Add new preference key.
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]): Set the default value of new
+            preference.
+        (-[WebPreferences setAVFoundationEnabled:]): Added.
+        (-[WebPreferences isAVFoundationEnabled]): Added.
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Update the WebCore settings with the
+            new values from WebPreferences.
+
 2011-04-22  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Gavin Barraclough.
index c5c101b..a4821ba 100644 (file)
 #define WebKitMemoryInfoEnabledPreferenceKey @"WebKitMemoryInfoEnabled"
 #define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
 #define WebKitUseQuickLookResourceCachingQuirksPreferenceKey @"WebKitUseQuickLookResourceCachingQuirks"
+#define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
 
 // These are private both because callers should be using the cover methods and because the
 // cover methods themselves are private.
index 39adc46..8adae4e 100644 (file)
@@ -391,6 +391,7 @@ static bool useQuickLookQuirks(void)
         [NSNumber numberWithBool:NO],   WebKitMemoryInfoEnabledPreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitHyperlinkAuditingEnabledPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitUsePreHTML5ParserQuirksKey,
+        [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
         [NSNumber numberWithBool:useQuickLookQuirks()], WebKitUseQuickLookResourceCachingQuirksPreferenceKey,
         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
@@ -1484,6 +1485,15 @@ static NSString *classIBCreatorID = nil;
     return [self _boolValueForKey: WebKitLoadSiteIconsKey];
 }
 
+- (void)setAVFoundationEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitAVFoundationEnabledKey];
+}
+
+- (BOOL)isAVFoundationEnabled
+{
+    return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
+}
 @end
 
 @implementation WebPreferences (WebInternal)
index e66604a..c4b1b2d 100644 (file)
@@ -243,4 +243,9 @@ extern NSString *WebPreferencesChangedInternalNotification;
 - (void)setLoadsSiteIconsIgnoringImageLoadingPreference: (BOOL)flag;
 - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
 
+// AVFoundation support is dependent on WebCore/WebKit being
+// compiled with USE_AVFOUNDATION.
+- (void)setAVFoundationEnabled:(BOOL)flag;
+- (BOOL)isAVFoundationEnabled;
+
 @end
index c36acb9..6acf76b 100644 (file)
@@ -1557,6 +1557,13 @@ static bool fastDocumentTeardownEnabled()
     settings->setCrossOriginCheckInGetMatchedCSSRulesDisabled([self _needsUnrestrictedGetMatchedCSSRules]);
     settings->setInteractiveFormValidationEnabled([self interactiveFormValidationEnabled]);
     settings->setValidationMessageTimerMagnification([self validationMessageTimerMagnification]);
+#if USE(AVFOUNDATION)
+#if ENABLE(FULLSCREEN_API)
+    settings->setAVFoundationEnabled([preferences isAVFoundationEnabled] && [preferences fullScreenEnabled]);
+#else
+    settings->setAVFoundationEnabled(false);
+#endif
+#endif
 
     // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
     [WebApplicationCache setDefaultOriginQuota:[preferences applicationCacheDefaultOriginQuota]];