Skip to content
Permalink
Browse files
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  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.

Canonical link: https://commits.webkit.org/74381@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@84646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed Apr 22, 2011
1 parent 2f716ea commit 35886fbd03bc627dcec7920d7e49ba029f58526b
Showing 10 changed files with 84 additions and 1 deletion.
@@ -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.
@@ -1867,3 +1867,7 @@ __ZN7WebCore12EventHandler18handleGestureEventERKNS_20PlatformGestureEventE
__ZN7WebCore14ResourceHandle46setPrivateBrowsingStorageSessionIdentifierBaseERKN3WTF6StringE
__ZN7WebCore14ResourceHandle29privateBrowsingStorageSessionEv
#endif

#if USE(AVFOUNDATION)
__ZN7WebCore8Settings20gAVFoundationEnabledE
#endif
@@ -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
@@ -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
@@ -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))
@@ -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.
@@ -107,6 +107,7 @@
#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.
@@ -391,6 +391,7 @@ + (void)initialize
[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 @@ - (BOOL)loadsSiteIconsIgnoringImageLoadingPreference
return [self _boolValueForKey: WebKitLoadSiteIconsKey];
}

- (void)setAVFoundationEnabled:(BOOL)flag
{
[self _setBoolValue:flag forKey:WebKitAVFoundationEnabledKey];
}

- (BOOL)isAVFoundationEnabled
{
return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
}
@end

@implementation WebPreferences (WebInternal)
@@ -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
@@ -1557,6 +1557,13 @@ - (void)_preferencesChanged:(WebPreferences *)preferences
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]];

0 comments on commit 35886fb

Please sign in to comment.