Changeset 84646 in webkit


Ignore:
Timestamp:
Apr 22, 2011 10:51:00 AM (13 years ago)
Author:
jer.noble@apple.com
Message:

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.

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84641 r84646  
     12011-04-22  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Disable MediaPlayerPrivateAVFoundation when using old full screen mode.
     6        https://bugs.webkit.org/show_bug.cgi?id=59147
     7
     8        Add a new isAVFoundationEnabled setting and check it before adding
     9        MediaPlayerPrivateAVFoundationObjC to the media engine registry.
     10
     11        * WebCore.exp.in:
     12        * page/Settings.cpp:
     13        * page/Settings.h:
     14        (WebCore::Settings::setAVFoundationEnabled): Added.
     15        (WebCore::Settings::isAVFoundationEnabled): Added.
     16        * platform/graphics/MediaPlayer.cpp:
     17        (WebCore::installedMediaEngines): Check the settings added above.
     18
    1192011-04-22  Sam Weinig  <sam@webkit.org>
    220
  • trunk/Source/WebCore/WebCore.exp.in

    r84553 r84646  
    18681868__ZN7WebCore14ResourceHandle29privateBrowsingStorageSessionEv
    18691869#endif
     1870
     1871#if USE(AVFOUNDATION)
     1872__ZN7WebCore8Settings20gAVFoundationEnabledE
     1873#endif
  • trunk/Source/WebCore/page/Settings.cpp

    r83628 r84646  
    5454#if USE(SAFARI_THEME)
    5555bool Settings::gShouldPaintNativeControls = true;
     56#endif
     57
     58#if USE(AVFOUNDATION)
     59bool Settings::gAVFoundationEnabled(false);
    5660#endif
    5761
  • trunk/Source/WebCore/page/Settings.h

    r83628 r84646  
    354354        void setFullScreenEnabled(bool flag) { m_fullScreenAPIEnabled = flag; }
    355355        bool fullScreenEnabled() const  { return m_fullScreenAPIEnabled; }
     356#endif
     357
     358#if USE(AVFOUNDATION)
     359        static void setAVFoundationEnabled(bool flag) { gAVFoundationEnabled = flag; }
     360        static bool isAVFoundationEnabled() { return gAVFoundationEnabled; }
    356361#endif
    357362
     
    499504        bool m_shouldInjectUserScriptsInInitialEmptyDocument : 1;
    500505
     506#if USE(AVFOUNDATION)
     507        static bool gAVFoundationEnabled;
     508#endif
     509
    501510#if USE(SAFARI_THEME)
    502511        static bool gShouldPaintNativeControls;
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r84452 r84646  
    3636#include "MIMETypeRegistry.h"
    3737#include "MediaPlayerPrivate.h"
     38#include "Settings.h"
    3839#include "TimeRanges.h"
    3940
     
    191192
    192193#if USE(AVFOUNDATION) && PLATFORM(MAC)
    193         MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
     194        if (Settings::isAVFoundationEnabled())
     195            MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(addMediaEngine);
    194196#endif
    195197
  • trunk/Source/WebKit/mac/ChangeLog

    r84641 r84646  
     12011-04-22  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Disable MediaPlayerPrivateAVFoundation when using old full screen mode.
     6        https://bugs.webkit.org/show_bug.cgi?id=59147
     7
     8        Add a new user default preference, and plumb that preference down to WebCore
     9        Settings. Allow the fullScreenEnabled preference to override the new
     10        isAVFoundationEnabled preference, so that clients of the legacy full screen
     11        mode will continue to use that mode normally.
     12
     13        * WebView/WebPreferenceKeysPrivate.h: Add new preference key.
     14        * WebView/WebPreferences.mm:
     15        (+[WebPreferences initialize]): Set the default value of new
     16            preference.
     17        (-[WebPreferences setAVFoundationEnabled:]): Added.
     18        (-[WebPreferences isAVFoundationEnabled]): Added.
     19        * WebView/WebPreferencesPrivate.h:
     20        * WebView/WebView.mm:
     21        (-[WebView _preferencesChanged:]): Update the WebCore settings with the
     22            new values from WebPreferences.
     23
    1242011-04-22  Sam Weinig  <sam@webkit.org>
    225
  • trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h

    r83628 r84646  
    108108#define WebKitHyperlinkAuditingEnabledPreferenceKey @"WebKitHyperlinkAuditingEnabled"
    109109#define WebKitUseQuickLookResourceCachingQuirksPreferenceKey @"WebKitUseQuickLookResourceCachingQuirks"
     110#define WebKitAVFoundationEnabledKey @"WebKitAVFoundationEnabled"
    110111
    111112// These are private both because callers should be using the cover methods and because the
  • trunk/Source/WebKit/mac/WebView/WebPreferences.mm

    r84561 r84646  
    392392        [NSNumber numberWithBool:YES],  WebKitHyperlinkAuditingEnabledPreferenceKey,
    393393        [NSNumber numberWithBool:NO],   WebKitUsePreHTML5ParserQuirksKey,
     394        [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
    394395        [NSNumber numberWithBool:useQuickLookQuirks()], WebKitUseQuickLookResourceCachingQuirksPreferenceKey,
    395396        [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
     
    14851486}
    14861487
     1488- (void)setAVFoundationEnabled:(BOOL)flag
     1489{
     1490    [self _setBoolValue:flag forKey:WebKitAVFoundationEnabledKey];
     1491}
     1492
     1493- (BOOL)isAVFoundationEnabled
     1494{
     1495    return [self _boolValueForKey:WebKitAVFoundationEnabledKey];
     1496}
    14871497@end
    14881498
  • trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h

    r83628 r84646  
    244244- (BOOL)loadsSiteIconsIgnoringImageLoadingPreference;
    245245
     246// AVFoundation support is dependent on WebCore/WebKit being
     247// compiled with USE_AVFOUNDATION.
     248- (void)setAVFoundationEnabled:(BOOL)flag;
     249- (BOOL)isAVFoundationEnabled;
     250
    246251@end
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r84220 r84646  
    15581558    settings->setInteractiveFormValidationEnabled([self interactiveFormValidationEnabled]);
    15591559    settings->setValidationMessageTimerMagnification([self validationMessageTimerMagnification]);
     1560#if USE(AVFOUNDATION)
     1561#if ENABLE(FULLSCREEN_API)
     1562    settings->setAVFoundationEnabled([preferences isAVFoundationEnabled] && [preferences fullScreenEnabled]);
     1563#else
     1564    settings->setAVFoundationEnabled(false);
     1565#endif
     1566#endif
    15601567
    15611568    // Application Cache Preferences are stored on the global cache storage manager, not in Settings.
Note: See TracChangeset for help on using the changeset viewer.