[Cocoa] Add a HAVE(AVKIT) and use it
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Apr 2015 08:33:41 +0000 (08:33 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Apr 2015 08:33:41 +0000 (08:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143593

Reviewed by David Kilzer.

Source/WebCore:

* page/Settings.h: Only defined setAVKitEnabled() if HAVE(AVKIT).
* platform/ios/WebVideoFullscreenControllerAVKit.mm: Only compiled if HAVE(AVKIT).
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.

Source/WebKit/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Only set WebKitAVKitEnabled to YES if HAVE(AVKIT).
(-[WebPreferences setAVKitEnabled:]): Only set value for WebKitAVKitEnabled if HAVE(AVKIT).
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]): Only called Settings::setAVKitEnabled() if HAVE(AVKIT).

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT).
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2.
(WebKit::WebPageProxy::reattachToWebProcess): Ditto.
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if
the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT).
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT).

Source/WTF:

* wtf/Platform.h: Defined HAVE(AVKIT) to be true on all Cocoa platforms except Watch OS.

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

14 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/page/Settings.h
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/ios/WebVideoFullscreenManagerProxy.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index ec7969149e9cb0bb42be439d639bcc14a31a9597..67e0beaf0b5fcf20cf4e285c0495b9b5a0f3c6b0 100644 (file)
@@ -1,3 +1,12 @@
+2015-04-09  Andy Estes  <aestes@apple.com>
+
+        [Cocoa] Add a HAVE(AVKIT) and use it
+        https://bugs.webkit.org/show_bug.cgi?id=143593
+
+        Reviewed by David Kilzer.
+
+        * wtf/Platform.h: Defined HAVE(AVKIT) to be true on all Cocoa platforms except Watch OS.
+
 2015-04-09  Andy Estes  <aestes@apple.com>
 
         [Content Filtering] Add a HAVE(PARENTAL_CONTROLS) and use it
index 1c315e26f1c71f87902c91bfeffbb6799de21eaa..ab9a665ed6302963da7fc44aba6a45bb2f9dbc5a 100644 (file)
 #define HAVE_DTRACE 1
 
 #if !PLATFORM(WATCHOS)
+#define HAVE_AVKIT 1
 #define HAVE_PARENTAL_CONTROLS 1
 #endif
 
index bcef2db1b3996a727960cd2cafe60ca5d9cbb1ac..300bb37436d1f8e7a40a80f47c7667ae3d7813fd 100644 (file)
@@ -1,3 +1,14 @@
+2015-04-09  Andy Estes  <aestes@apple.com>
+
+        [Cocoa] Add a HAVE(AVKIT) and use it
+        https://bugs.webkit.org/show_bug.cgi?id=143593
+
+        Reviewed by David Kilzer.
+
+        * page/Settings.h: Only defined setAVKitEnabled() if HAVE(AVKIT).
+        * platform/ios/WebVideoFullscreenControllerAVKit.mm: Only compiled if HAVE(AVKIT).
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
+
 2015-04-09  Simon Fraser  <simon.fraser@apple.com>
 
         Some CSS3 filters tests crash under iOS testing
index 424220510018280d6ab8a510c4c011e0a4fd69eb..4419ec2e806b1f7000d6e78e6ced7cd29a261d02 100644 (file)
@@ -251,7 +251,9 @@ public:
     WEBCORE_EXPORT static void setNetworkInterfaceName(const String&);
     static const String& networkInterfaceName();
 
+#if HAVE(AVKIT)
     static void setAVKitEnabled(bool flag) { gAVKitEnabled = flag; }
+#endif
     static bool avKitEnabled() { return gAVKitEnabled; }
 
     static void setShouldOptOutOfNetworkStateObservation(bool flag) { gShouldOptOutOfNetworkStateObservation = flag; }
index a8653804a6852fd01afad8fdad94dd6351aaddb5..3f855d0f12b40649a96fb6afe98966e11a3a58b3 100644 (file)
@@ -37,7 +37,7 @@
 
 using namespace WebCore;
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED <= 80200
+#if __IPHONE_OS_VERSION_MIN_REQUIRED <= 80200 || !HAVE(AVKIT)
 
 @implementation WebVideoFullscreenController
 - (void)setVideoElement:(WebCore::HTMLVideoElement*)videoElement
index 3ed6ccb7bb9205aeb10288528614338a03218456..199688086b176a9610debd8e4201c28e737fda59 100644 (file)
@@ -26,7 +26,7 @@
 
 #import "config.h"
 
-#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED > 80200
+#if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED > 80200 && HAVE(AVKIT)
 
 #import "WebVideoFullscreenInterfaceAVKit.h"
 
index d550198d1b77477f5b0168c864e9d46252c35639..5ec950d5f994a8465f5fa0c648482bad8e520148 100644 (file)
@@ -1,3 +1,16 @@
+2015-04-09  Andy Estes  <aestes@apple.com>
+
+        [Cocoa] Add a HAVE(AVKIT) and use it
+        https://bugs.webkit.org/show_bug.cgi?id=143593
+
+        Reviewed by David Kilzer.
+
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]): Only set WebKitAVKitEnabled to YES if HAVE(AVKIT).
+        (-[WebPreferences setAVKitEnabled:]): Only set value for WebKitAVKitEnabled if HAVE(AVKIT).
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]): Only called Settings::setAVKitEnabled() if HAVE(AVKIT).
+
 2015-04-09  Chris Dumez  <cdumez@apple.com>
 
         [WK2][iOS] editorState() should not cause a synchronous layout
index 688e26bab09ab2887c609a3510c79ae5e6ca3f20..bf72410e54687f10d425f0419eaaa225b548ce37 100644 (file)
@@ -527,7 +527,9 @@ public:
         [NSNumber numberWithBool:NO],   WebKitMediaPlaybackAllowsInlinePreferenceKey,
         [NSNumber numberWithBool:YES],  WebKitMediaPlaybackAllowsAirPlayPreferenceKey,
         [NSNumber numberWithUnsignedInt:AudioSession::None],  WebKitAudioSessionCategoryOverride,
+#if HAVE(AVKIT)
         [NSNumber numberWithBool:YES],  WebKitAVKitEnabled,
+#endif
         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
 
         // Per-Origin Quota on iOS is 25MB. When the quota is reached for a particular origin
@@ -2126,7 +2128,9 @@ static NSString *classIBCreatorID = nil;
 
 - (void)setAVKitEnabled:(bool)flag
 {
+#if HAVE(AVKIT)
     [self _setBoolValue:flag forKey:WebKitAVKitEnabled];
+#endif
 }
 
 - (BOOL)networkDataUsageTrackingEnabled
index deb8e60082b3e6a25ee7a586bade5438df5f037b..82416be246cd4a391add4ced1702e23ac7454fc0 100644 (file)
@@ -2340,7 +2340,9 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setAudioSessionCategoryOverride([preferences audioSessionCategoryOverride]);
     settings.setNetworkDataUsageTrackingEnabled([preferences networkDataUsageTrackingEnabled]);
     settings.setNetworkInterfaceName([preferences networkInterfaceName]);
+#if HAVE(AVKIT)
     settings.setAVKitEnabled([preferences avKitEnabled]);
+#endif
     settings.setShouldTransformsAffectOverflow(shouldTransformsAffectOverflow());
     settings.setShouldDispatchJavaScriptWindowOnErrorEvents(shouldDispatchJavaScriptWindowOnErrorEvents());
 
index 1e9fee8cb4c7c68973709c8a525819607a56387f..06c4c242a7cb176e4ba7640652d1b1dbc5c2cd67 100644 (file)
@@ -1,3 +1,21 @@
+2015-04-09  Andy Estes  <aestes@apple.com>
+
+        [Cocoa] Add a HAVE(AVKIT) and use it
+        https://bugs.webkit.org/show_bug.cgi?id=143593
+
+        Reviewed by David Kilzer.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT).
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2.
+        (WebKit::WebPageProxy::reattachToWebProcess): Ditto.
+        * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
+        (WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if
+        the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT).
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT).
+
 2015-04-09  Hunseop Jeong  <hs85.jeong@samsung.com>
 
         Use modern loops in WebProcess 
index c0264ea10d7ddf261297d3fd66507f1913cb0738..06a2f73e45eaf2c0e9785c33f810dfc53f12b471 100644 (file)
@@ -247,7 +247,7 @@ static int32_t deviceOrientation()
 
 - (BOOL)_mayAutomaticallyShowVideoOptimized
 {
-#if (__IPHONE_OS_VERSION_MIN_REQUIRED <= 80200)
+#if (__IPHONE_OS_VERSION_MIN_REQUIRED <= 80200) || !HAVE(AVKIT)
     return false;
 #else
     if (!_page || !_page->videoFullscreenManager())
index fb880c4822236e9bc4956986d1e4eea31c69dfb6..6be753977fb924ae9af1025c2fdaac3b72f3ce30 100644 (file)
@@ -438,7 +438,7 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, uin
 #if ENABLE(FULLSCREEN_API)
     m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
 #endif
-#if PLATFORM(IOS) && (__IPHONE_OS_VERSION_MIN_REQUIRED > 80200)
+#if PLATFORM(IOS)
     m_videoFullscreenManager = WebVideoFullscreenManagerProxy::create(*this);
 #endif
 #if ENABLE(VIBRATION)
@@ -664,7 +664,7 @@ void WebPageProxy::reattachToWebProcess()
 #if ENABLE(FULLSCREEN_API)
     m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
 #endif
-#if PLATFORM(IOS) && (__IPHONE_OS_VERSION_MIN_REQUIRED > 80200)
+#if PLATFORM(IOS)
     m_videoFullscreenManager = WebVideoFullscreenManagerProxy::create(*this);
 #endif
 
index 32538c2bad7a52a4cb4c7ac0719798750244db9a..0fee7430f9f11d2b7db103012fd09fbae4ab0005 100644 (file)
@@ -46,7 +46,14 @@ using namespace WebCore;
 
 namespace WebKit {
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED > 80200
+#if __IPHONE_OS_VERSION_MIN_REQUIRED <= 80200 || !HAVE(AVKIT)
+
+PassRefPtr<WebVideoFullscreenManagerProxy> WebVideoFullscreenManagerProxy::create(WebPageProxy&)
+{
+    return nullptr;
+}
+
+#else
 
 PassRefPtr<WebVideoFullscreenManagerProxy> WebVideoFullscreenManagerProxy::create(WebPageProxy& page)
 {
index 46d38e5069fceb2d52ad230de4334014eb1ce605..13687e0a2033f52478e97d579b908579a1744bea 100644 (file)
@@ -2740,7 +2740,7 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings.setQTKitEnabled(store.getBoolValueForKey(WebPreferencesKey::isQTKitEnabledKey()));
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) && HAVE(AVKIT)
     settings.setAVKitEnabled(true);
 #endif