Make QTKit an optional framework
https://bugs.webkit.org/show_bug.cgi?id=197075

Reviewed by Eric Carlson.

* WebView/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindowController windowDidLoad]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@245263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog
index 7b82cc8..d5b68e7 100644
--- a/Source/WebKitLegacy/mac/ChangeLog
+++ b/Source/WebKitLegacy/mac/ChangeLog
@@ -1,3 +1,13 @@
+2019-05-13  Jer Noble  <jer.noble@apple.com>
+
+        Make QTKit an optional framework
+        https://bugs.webkit.org/show_bug.cgi?id=197075
+
+        Reviewed by Eric Carlson.
+
+        * WebView/WebVideoFullscreenHUDWindowController.mm:
+        (-[WebVideoFullscreenHUDWindowController windowDidLoad]):
+
 2019-05-08  Alex Christensen  <achristensen@webkit.org>
 
         Don't crash when DOMNode.addEventListener:listener:useCapture: is called with a nil listener
diff --git a/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenHUDWindowController.mm b/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenHUDWindowController.mm
index 7c3f506..ae7e4a2 100644
--- a/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenHUDWindowController.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebVideoFullscreenHUDWindowController.mm
@@ -32,12 +32,12 @@
 #import <pal/spi/mac/QTKitSPI.h>
 #import <wtf/SoftLinking.h>
 
-SOFT_LINK_FRAMEWORK(QTKit)
+SOFT_LINK_FRAMEWORK_OPTIONAL(QTKit)
 
-SOFT_LINK_CLASS(QTKit, QTHUDBackgroundView)
-SOFT_LINK_CLASS(QTKit, QTHUDButton)
-SOFT_LINK_CLASS(QTKit, QTHUDSlider)
-SOFT_LINK_CLASS(QTKit, QTHUDTimeline)
+SOFT_LINK_CLASS_OPTIONAL(QTKit, QTHUDBackgroundView)
+SOFT_LINK_CLASS_OPTIONAL(QTKit, QTHUDButton)
+SOFT_LINK_CLASS_OPTIONAL(QTKit, QTHUDSlider)
+SOFT_LINK_CLASS_OPTIONAL(QTKit, QTHUDTimeline)
 
 #define QTHUDBackgroundView getQTHUDBackgroundViewClass()
 #define QTHUDButton getQTHUDButtonClass()
@@ -402,6 +402,13 @@
     static const CGFloat timeTextFieldHeight = 13;
     static const CGFloat timeTextFieldHorizontalMargin = 7;
 
+    if (!QTKitLibrary()
+        || !getQTHUDBackgroundViewClass()
+        || !getQTHUDButtonClass()
+        || !getQTHUDSliderClass()
+        || !getQTHUDTimelineClass())
+        return;
+
     NSWindow *window = [self window];
     ASSERT(window);