Rename MediaPlaybackAllowsAirPlay
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 May 2015 01:55:41 +0000 (01:55 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 May 2015 01:55:41 +0000 (01:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145316

Reviewed by Eric Carlson.

In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
to allowsAirPlayForMediaPlayback.

Source/WebCore:

* page/Settings.in: Update the setting name.

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Update the call to settings.
* testing/InternalSettings.h: Update the name of the member variable.
* testing/InternalSettings.cpp: Update the names and calls to settings.
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::InternalSettings):
(WebCore::InternalSettings::resetToConsistentState):
(WebCore::InternalSettings::setWirelessPlaybackDisabled):

Source/WebKit/mac:

* WebView/WebPreferenceKeysPrivate.h: Update the name but keep its value, for backwards
compatibility.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Update to reference the new key name.
(-[WebPreferences mediaPlaybackAllowsAirPlay]): Ditto. This API will not change in a future
patch.
(-[WebPreferences setMediaPlaybackAllowsAirPlay:]): Ditto.
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Update the call to settings.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h: Update the name.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Update the call to settings.

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaSession.cpp
Source/WebCore/page/Settings.in
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 1ee9b51..2ef913b 100644 (file)
@@ -1,5 +1,26 @@
 2015-05-22  Jon Lee  <jonlee@apple.com>
 
+        Rename MediaPlaybackAllowsAirPlay
+        https://bugs.webkit.org/show_bug.cgi?id=145316
+
+        Reviewed by Eric Carlson.
+
+        In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
+        to allowsAirPlayForMediaPlayback.
+
+        * page/Settings.in: Update the setting name.
+
+        * html/HTMLMediaSession.cpp:
+        (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Update the call to settings.
+        * testing/InternalSettings.h: Update the name of the member variable.
+        * testing/InternalSettings.cpp: Update the names and calls to settings.
+        (WebCore::InternalSettings::Backup::Backup):
+        (WebCore::InternalSettings::InternalSettings):
+        (WebCore::InternalSettings::resetToConsistentState):
+        (WebCore::InternalSettings::setWirelessPlaybackDisabled):
+
+2015-05-22  Jon Lee  <jonlee@apple.com>
+
         Rename MediaPlaybackRequiresUserGesture
         https://bugs.webkit.org/show_bug.cgi?id=145314
 
index 3c8d6ce..9b41291 100644 (file)
@@ -228,7 +228,7 @@ bool HTMLMediaSession::hasWirelessPlaybackTargets(const HTMLMediaElement&) const
 bool HTMLMediaSession::wirelessVideoPlaybackDisabled(const HTMLMediaElement& element) const
 {
     Settings* settings = element.document().settings();
-    if (!settings || !settings->mediaPlaybackAllowsAirPlay()) {
+    if (!settings || !settings->allowsAirPlayForMediaPlayback()) {
         LOG(Media, "HTMLMediaSession::wirelessVideoPlaybackDisabled - returning TRUE because of settings");
         return true;
     }
index 3429782..2779b06 100644 (file)
@@ -205,7 +205,7 @@ mediaSourceEnabled initial=true, conditional=MEDIA_SOURCE
 # FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
 allowMultiElementImplicitSubmission initial=false
 
-mediaPlaybackAllowsAirPlay initial=true, conditional=WIRELESS_PLAYBACK_TARGET
+allowsAirPlayForMediaPlayback initial=true, conditional=WIRELESS_PLAYBACK_TARGET
 
 shouldConvertPositionStyleOnCopy initial=false
 
index e308727..c5984e3 100644 (file)
@@ -98,7 +98,7 @@ InternalSettings::Backup::Backup(Settings& settings)
     , m_touchEventEmulationEnabled(settings.isTouchEventEmulationEnabled())
 #endif
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    , m_mediaPlaybackAllowsAirPlay(settings.mediaPlaybackAllowsAirPlay())
+    , m_allowsAirPlayForMediaPlayback(settings.allowsAirPlayForMediaPlayback())
 #endif
 {
 }
@@ -202,7 +202,7 @@ InternalSettings::InternalSettings(Page* page)
     , m_backup(page->settings())
 {
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    page->settings().setMediaPlaybackAllowsAirPlay(false);
+    page->settings().setAllowsAirPlayForMediaPlayback(false);
 #endif
 }
 
@@ -211,7 +211,7 @@ void InternalSettings::resetToConsistentState()
     page()->setPageScaleFactor(1, IntPoint(0, 0));
     page()->setCanStartMedia(true);
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    m_page->settings().setMediaPlaybackAllowsAirPlay(false);
+    m_page->settings().setAllowsAirPlayForMediaPlayback(false);
 #endif
 
     m_backup.restoreTo(*settings());
@@ -363,7 +363,7 @@ void InternalSettings::setCanStartMedia(bool enabled, ExceptionCode& ec)
 void InternalSettings::setWirelessPlaybackDisabled(bool available)
 {
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    m_page->settings().setMediaPlaybackAllowsAirPlay(available);
+    m_page->settings().setAllowsAirPlayForMediaPlayback(available);
 #else
     UNUSED_PARAM(available);
 #endif
index e351fff..68e2c94 100644 (file)
@@ -96,7 +96,7 @@ public:
         bool m_touchEventEmulationEnabled;
 #endif
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-        bool m_mediaPlaybackAllowsAirPlay;
+        bool m_allowsAirPlayForMediaPlayback;
 #endif
     };
 
index 7b32b1f..f837520 100644 (file)
@@ -1,5 +1,25 @@
 2015-05-22  Jon Lee  <jonlee@apple.com>
 
+        Rename MediaPlaybackAllowsAirPlay
+        https://bugs.webkit.org/show_bug.cgi?id=145316
+
+        Reviewed by Eric Carlson.
+
+        In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
+        to allowsAirPlayForMediaPlayback.
+
+        * WebView/WebPreferenceKeysPrivate.h: Update the name but keep its value, for backwards
+        compatibility.
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]): Update to reference the new key name.
+        (-[WebPreferences mediaPlaybackAllowsAirPlay]): Ditto. This API will not change in a future
+        patch.
+        (-[WebPreferences setMediaPlaybackAllowsAirPlay:]): Ditto.
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Update the call to settings.
+
+2015-05-22  Jon Lee  <jonlee@apple.com>
+
         Rename MediaPlaybackRequiresUserGesture
         https://bugs.webkit.org/show_bug.cgi?id=145314
 
index 4f51e05..7e4bc69 100644 (file)
 #define WebKitSuppressesIncrementalRenderingKey @"WebKitSuppressesIncrementalRendering"
 #define WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey @"WebKitSubpixelCSSOMElementMetricsEnabled"
 #if TARGET_OS_IPHONE
-#define WebKitMediaPlaybackAllowsAirPlayPreferenceKey @"WebKitMediaPlaybackAllowsAirPlay"
+#define WebKitAllowsAirPlayForMediaPlaybackPreferenceKey @"WebKitMediaPlaybackAllowsAirPlay"
 #define WebKitAudioSessionCategoryOverride @"WebKitAudioSessionCategoryOverride"
 #define WebKitAVKitEnabled @"WebKitAVKitEnabled"
 #endif
index 1ba012f..d164def 100644 (file)
@@ -529,7 +529,7 @@ public:
 #else
         [NSNumber numberWithBool:YES],  WebKitRequiresUserGestureForMediaPlaybackPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitMediaPlaybackAllowsInlinePreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitMediaPlaybackAllowsAirPlayPreferenceKey,
+        [NSNumber numberWithBool:YES],  WebKitAllowsAirPlayForMediaPlaybackPreferenceKey,
         [NSNumber numberWithUnsignedInt:AudioSession::None],  WebKitAudioSessionCategoryOverride,
 #if HAVE(AVKIT)
         [NSNumber numberWithBool:YES],  WebKitAVKitEnabled,
@@ -2079,12 +2079,12 @@ static NSString *classIBCreatorID = nil;
 #if PLATFORM(IOS)
 - (BOOL)mediaPlaybackAllowsAirPlay
 {
-    return [self _boolValueForKey:WebKitMediaPlaybackAllowsAirPlayPreferenceKey];
+    return [self _boolValueForKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
 }
 
 - (void)setMediaPlaybackAllowsAirPlay:(BOOL)flag
 {
-    [self _setBoolValue:flag forKey:WebKitMediaPlaybackAllowsAirPlayPreferenceKey];
+    [self _setBoolValue:flag forKey:WebKitAllowsAirPlayForMediaPlaybackPreferenceKey];
 }
 
 - (unsigned)audioSessionCategoryOverride
index 280d075..42e2352 100644 (file)
@@ -2350,7 +2350,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setLayoutInterval(std::chrono::milliseconds([preferences _layoutInterval]));
     settings.setMaxParseDuration([preferences _maxParseDuration]);
     settings.setAlwaysUseAcceleratedOverflowScroll([preferences _alwaysUseAcceleratedOverflowScroll]);
-    settings.setMediaPlaybackAllowsAirPlay([preferences mediaPlaybackAllowsAirPlay]);
+    settings.setAllowsAirPlayForMediaPlayback([preferences mediaPlaybackAllowsAirPlay]);
     settings.setAudioSessionCategoryOverride([preferences audioSessionCategoryOverride]);
     settings.setNetworkDataUsageTrackingEnabled([preferences networkDataUsageTrackingEnabled]);
     settings.setNetworkInterfaceName([preferences networkInterfaceName]);
index f3b420e..9de24f6 100644 (file)
@@ -1,5 +1,21 @@
 2015-05-22  Jon Lee  <jonlee@apple.com>
 
+        Rename MediaPlaybackAllowsAirPlay
+        https://bugs.webkit.org/show_bug.cgi?id=145316
+
+        Reviewed by Eric Carlson.
+
+        In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
+        to allowsAirPlayForMediaPlayback.
+
+        * Shared/WebPreferencesDefinitions.h: Update the name.
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView initWithFrame:configuration:]): Ditto.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences): Update the call to settings.
+
+2015-05-22  Jon Lee  <jonlee@apple.com>
+
         Unreviewed GTK fix after r184802.
 
         * UIProcess/API/gtk/WebKitSettings.cpp:
index 4126126..4af3652 100644 (file)
     macro(RequiresUserGestureForMediaPlayback, requiresUserGestureForMediaPlayback, Bool, bool, DEFAULT_REQUIRES_USER_GESTURE_FOR_MEDIA_PLAYBACK) \
     macro(MediaPlaybackAllowsInline, mediaPlaybackAllowsInline, Bool, bool, DEFAULT_MEDIA_PLAYBACK_ALLOWS_INLINE) \
     macro(AllowsAlternateFullscreen, allowsAlternateFullscreen, Bool, bool, true) \
-    macro(MediaPlaybackAllowsAirPlay, mediaPlaybackAllowsAirPlay, Bool, bool, true) \
+    macro(AllowsAirPlayForMediaPlayback, allowsAirPlayForMediaPlayback, Bool, bool, true) \
     macro(InspectorStartsAttached, inspectorStartsAttached, Bool, bool, true) \
     macro(ShowsToolTipOverTruncatedText, showsToolTipOverTruncatedText, Bool, bool, false) \
     macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \
index ff85770..9fe3502 100644 (file)
@@ -321,7 +321,7 @@ static bool shouldAllowAlternateFullscreen()
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackAllowsInlineKey(), WebKit::WebPreferencesStore::Value(!![_configuration allowsInlineMediaPlayback]));
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::allowsAlternateFullscreenKey(), WebKit::WebPreferencesStore::Value(!![_configuration _allowsAlternateFullscreen] && shouldAllowAlternateFullscreen()));
     webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::requiresUserGestureForMediaPlaybackKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackRequiresUserAction]));
-    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::mediaPlaybackAllowsAirPlayKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackAllowsAirPlay]));
+    webPageConfiguration.preferenceValues.set(WebKit::WebPreferencesKey::allowsAirPlayForMediaPlaybackKey(), WebKit::WebPreferencesStore::Value(!![_configuration mediaPlaybackAllowsAirPlay]));
 #endif
 
 #if PLATFORM(IOS)
index 37bae52..02584fe 100644 (file)
@@ -2819,7 +2819,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
 #endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
-    settings.setMediaPlaybackAllowsAirPlay(store.getBoolValueForKey(WebPreferencesKey::mediaPlaybackAllowsAirPlayKey()));
+    settings.setAllowsAirPlayForMediaPlayback(store.getBoolValueForKey(WebPreferencesKey::allowsAirPlayForMediaPlaybackKey()));
 #endif
 
     settings.setSuppressesIncrementalRendering(store.getBoolValueForKey(WebPreferencesKey::suppressesIncrementalRenderingKey()));