[FTW] Enable CoreFoundation use if building for Apple target
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2019 01:50:05 +0000 (01:50 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Aug 2019 01:50:05 +0000 (01:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200799

Reviewed by Alex Christensen.

Source/JavaScriptCore:

* PlatformFTW.cmake: Add missing files.

Source/WebKit:

Fix the build and remove an unused method.

* PlatformFTW.cmake:
* Shared/ShareableBitmap.h:
* Shared/win/ShareableBitmapDirect2D.cpp:
(WebKit::ShareableBitmap::createDirect2DSurface):
(WebKit::ShareableBitmap::releaseSurfaceData): Deleted.

Source/WebKitLegacy:

* PlatformFTW.cmake:

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::FullscreenVideoController):
(FullscreenVideoController::enterFullscreen):
(FullscreenVideoController::exitFullscreen):
(FullscreenVideoController::createHUDWindow):
* FullscreenVideoController.h:
* WebView.cpp:
(WebView::exitFullscreenIfNeeded):

Source/WTF:

* wtf/PlatformFTW.cmake: Add missing files.

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

15 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/PlatformFTW.cmake
Source/WTF/ChangeLog
Source/WTF/wtf/PlatformFTW.cmake
Source/WebKit/ChangeLog
Source/WebKit/PlatformFTW.cmake
Source/WebKit/Shared/ShareableBitmap.h
Source/WebKit/Shared/win/ShareableBitmapDirect2D.cpp
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/PlatformFTW.cmake
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/FullscreenVideoController.cpp
Source/WebKitLegacy/win/FullscreenVideoController.h
Source/WebKitLegacy/win/WebView.cpp
Source/cmake/OptionsFTW.cmake

index 6c51bed..93d1ffd 100644 (file)
@@ -1,3 +1,12 @@
+2019-08-15  Brent Fulgham  <bfulgham@apple.com>
+
+        [FTW] Enable CoreFoundation use if building for Apple target
+        https://bugs.webkit.org/show_bug.cgi?id=200799
+
+        Reviewed by Alex Christensen.
+
+        * PlatformFTW.cmake: Add missing files.
+
 2019-08-15  Alexey Shvayka  <shvaikalesh@gmail.com>
 
         DateConversion::formatDateTime incorrectly formats negative years
index d2c7eb0..a374de8 100644 (file)
@@ -7,6 +7,26 @@ list(APPEND JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
     API/JavaScriptCore.h
 )
 
+if (USE_CF)
+    list(APPEND JavaScriptCore_SOURCES
+        API/JSStringRefCF.cpp
+    )
+
+    list(APPEND JavaScriptCore_PUBLIC_FRAMEWORK_HEADERS
+        API/JSStringRefCF.h
+    )
+
+    list(APPEND JavaScriptCore_LIBRARIES
+        ${COREFOUNDATION_LIBRARY}
+    )
+endif ()
+
+if (NOT WTF_PLATFORM_WIN_CAIRO)
+    list(APPEND JavaScriptCore_LIBRARIES
+        winmm
+    )
+endif ()
+
 if (ENABLE_REMOTE_INSPECTOR)
     list(APPEND JavaScriptCore_PRIVATE_INCLUDE_DIRECTORIES
         "${JAVASCRIPTCORE_DIR}/inspector/remote/socket"
index a383ddb..e6a8112 100644 (file)
@@ -1,3 +1,12 @@
+2019-08-15  Brent Fulgham  <bfulgham@apple.com>
+
+        [FTW] Enable CoreFoundation use if building for Apple target
+        https://bugs.webkit.org/show_bug.cgi?id=200799
+
+        Reviewed by Alex Christensen.
+
+        * wtf/PlatformFTW.cmake: Add missing files.
+
 2019-08-15  Commit Queue  <commit-queue@webkit.org>
 
         Unreviewed, rolling out r248440.
index 84d5ed1..ab7e921 100644 (file)
@@ -33,4 +33,25 @@ list(APPEND WTF_SOURCES
     win/WorkQueueWin.cpp
 )
 
+if (USE_CF)
+    list(APPEND WTF_PUBLIC_HEADERS
+        cf/CFURLExtras.h
+        cf/TypeCastsCF.h
+
+        text/cf/TextBreakIteratorCF.h
+    )
+    list(APPEND WTF_SOURCES
+        cf/CFURLExtras.cpp
+        cf/FileSystemCF.cpp
+        cf/URLCF.cpp
+
+        text/cf/AtomStringImplCF.cpp
+        text/cf/StringCF.cpp
+        text/cf/StringImplCF.cpp
+        text/cf/StringViewCF.cpp
+    )
+
+    list(APPEND WTF_LIBRARIES ${COREFOUNDATION_LIBRARY})
+endif ()
+
 set(WTF_OUTPUT_NAME WTF${DEBUG_SUFFIX})
index fd5ee7a..4ba55b7 100644 (file)
@@ -1,3 +1,18 @@
+2019-08-15  Brent Fulgham  <bfulgham@apple.com>
+
+        [FTW] Enable CoreFoundation use if building for Apple target
+        https://bugs.webkit.org/show_bug.cgi?id=200799
+
+        Reviewed by Alex Christensen.
+
+        Fix the build and remove an unused method.
+
+        * PlatformFTW.cmake:
+        * Shared/ShareableBitmap.h:
+        * Shared/win/ShareableBitmapDirect2D.cpp:
+        (WebKit::ShareableBitmap::createDirect2DSurface):
+        (WebKit::ShareableBitmap::releaseSurfaceData): Deleted.
+
 2019-08-15  Sihui Liu  <sihui_liu@apple.com>
 
         Some improvements on web storage
index 59984c4..7af054d 100644 (file)
@@ -291,6 +291,7 @@ set(WebKit_PUBLIC_FRAMEWORK_HEADERS
     UIProcess/API/C/WKPageNavigationClient.h
     UIProcess/API/C/WKPagePolicyClient.h
     UIProcess/API/C/WKPagePrivate.h
+    UIProcess/API/C/WKPageStateClient.h
     UIProcess/API/C/WKPageRenderingProgressEvents.h
     UIProcess/API/C/WKPageUIClient.h
     UIProcess/API/C/WKPluginLoadPolicy.h
index 56d362b..5820282 100644 (file)
@@ -149,7 +149,7 @@ private:
     static void releaseDataProviderData(void* typelessBitmap, const void* typelessData, size_t);
 #endif
 
-#if USE(CAIRO) || USE(DIRECT2D)
+#if USE(CAIRO)
     static void releaseSurfaceData(void* typelessBitmap);
 #endif
 
index 60f8f3c..d6a0458 100644 (file)
@@ -96,15 +96,9 @@ void ShareableBitmap::paint(GraphicsContext& context, float scaleFactor, const I
 COMPtr<IWICBitmap> ShareableBitmap::createDirect2DSurface()
 {
     m_bitmap = createSurfaceFromData(data(), m_size);
-    ref(); // Balanced by deref in releaseSurfaceData.
     return m_bitmap;
 }
 
-void ShareableBitmap::releaseSurfaceData(void* typelessBitmap)
-{
-    static_cast<ShareableBitmap*>(typelessBitmap)->deref(); // Balanced by ref in createDirect2DSurface.
-}
-
 RefPtr<Image> ShareableBitmap::createImage()
 {
     auto surface = createDirect2DSurface();
index 66e5fa3..93e7e83 100644 (file)
@@ -1,3 +1,12 @@
+2019-08-15  Brent Fulgham  <bfulgham@apple.com>
+
+        [FTW] Enable CoreFoundation use if building for Apple target
+        https://bugs.webkit.org/show_bug.cgi?id=200799
+
+        Reviewed by Alex Christensen.
+
+        * PlatformFTW.cmake:
+
 2019-08-15  Sihui Liu  <sihui_liu@apple.com>
 
         Some improvements on web storage
index 292163e..ee67382 100644 (file)
@@ -220,6 +220,16 @@ list(APPEND WebKitLegacy_SOURCES_WebCoreSupport
     win/WebCoreSupport/WebVisitedLinkStore.h
 )
 
+if (USE_CF)
+    list(APPEND WebKitLegacy_SOURCES_Classes
+        cf/WebCoreSupport/WebInspectorClientCF.cpp
+    )
+
+    list(APPEND WebKitLegacy_LIBRARIES
+        ${COREFOUNDATION_LIBRARY}
+    )
+endif ()
+
 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
     enable_language(ASM_MASM)
     if (MSVC)
index 1d4fea8..a43fa72 100644 (file)
@@ -1,3 +1,19 @@
+2019-08-15  Brent Fulgham  <bfulgham@apple.com>
+
+        [FTW] Enable CoreFoundation use if building for Apple target
+        https://bugs.webkit.org/show_bug.cgi?id=200799
+
+        Reviewed by Alex Christensen.
+
+        * FullscreenVideoController.cpp:
+        (FullscreenVideoController::FullscreenVideoController):
+        (FullscreenVideoController::enterFullscreen):
+        (FullscreenVideoController::exitFullscreen):
+        (FullscreenVideoController::createHUDWindow):
+        * FullscreenVideoController.h:
+        * WebView.cpp:
+        (WebView::exitFullscreenIfNeeded):
+
 2019-08-15  Youenn Fablet  <youenn@apple.com>
 
         Always create a Document with a valid SessionID
index 646e6ae..5e6298c 100644 (file)
@@ -249,7 +249,9 @@ FullscreenVideoController::FullscreenVideoController()
     , m_layerClient(std::make_unique<LayerClient>(this))
     , m_rootChild(PlatformCALayerWin::create(PlatformCALayer::LayerTypeLayer, m_layerClient.get()))
 #endif
+#if ENABLE(FULLSCREEN_API)
     , m_fullscreenWindow(std::make_unique<MediaPlayerPrivateFullscreenWindow>(static_cast<MediaPlayerPrivateFullscreenClient*>(this)))
+#endif
 {
 }
 
@@ -274,6 +276,7 @@ void FullscreenVideoController::setVideoElement(HTMLVideoElement* videoElement)
 
 void FullscreenVideoController::enterFullscreen()
 {
+#if ENABLE(FULLSCREEN_API)
     if (!m_videoElement)
         return;
 
@@ -299,13 +302,16 @@ void FullscreenVideoController::enterFullscreen()
     m_fullscreenSize.setHeight(windowRect.bottom - windowRect.top);
 
     createHUDWindow();
+#endif
 }
 
 void FullscreenVideoController::exitFullscreen()
 {
     SetWindowLongPtr(m_hudWindow, 0, 0);
 
+#if ENABLE(FULLSCREEN_API)
     m_fullscreenWindow = nullptr;
+#endif
 
     ASSERT(!IsWindow(m_hudWindow));
     m_hudWindow = 0;
@@ -432,6 +438,7 @@ void FullscreenVideoController::registerHUDWindowClass()
 
 void FullscreenVideoController::createHUDWindow()
 {
+#if ENABLE(FULLSCREEN_API)
     m_hudPosition.setX((m_fullscreenSize.width() - windowWidth) / 2);
     m_hudPosition.setY(m_fullscreenSize.height() * initialHUDPositionY - windowHeight / 2);
 
@@ -461,6 +468,7 @@ void FullscreenVideoController::createHUDWindow()
     SetWindowLongPtr(m_hudWindow, 0, reinterpret_cast<LONG_PTR>(this));
 
     draw();
+#endif
 }
 
 static String timeToString(float time)
index f1de8dd..42c4b88 100644 (file)
@@ -154,7 +154,9 @@ private:
     GDIObject<HBITMAP> m_bitmap;
     WebCore::IntSize m_fullscreenSize;
     WebCore::IntPoint m_hudPosition;
+#if ENABLE(FULLSCREEN_API)
     std::unique_ptr<WebCore::MediaPlayerPrivateFullscreenWindow> m_fullscreenWindow;
+#endif
 
 #if USE(CA)
     class LayerClient;
index 976148e..c2308ee 100644 (file)
@@ -7880,7 +7880,9 @@ HRESULT WebView::setVisibilityState(WebPageVisibilityState visibilityState)
 
 HRESULT WebView::exitFullscreenIfNeeded()
 {
+#if ENABLE(FULLSCREEN_API)
     if (fullScreenController() && fullScreenController()->isFullScreen())
         fullScreenController()->close();
+#endif
     return S_OK;
 }
index 6d27036..611a4d9 100644 (file)
@@ -25,6 +25,13 @@ add_definitions(-DUNICODE -D_UNICODE)
 add_definitions(-D_WINSOCKAPI_=)
 
 # Setup library paths
+if (DEFINED ENV{AppleApplicationSupportSDK})
+    file(TO_CMAKE_PATH "$ENV{AppleApplicationSupportSDK}/AppleInternal" WEBKIT_LIBRARIES_DIR)
+    set(WEBKIT_LIBRARIES_INCLUDE_DIR "${WEBKIT_LIBRARIES_DIR}/include")
+    include_directories(${WEBKIT_LIBRARIES_INCLUDE_DIR})
+    set(APPLE_BUILD 1)
+endif ()
+
 if (NOT WEBKIT_LIBRARIES_DIR)
     if (DEFINED ENV{WEBKIT_LIBRARIES})
         file(TO_CMAKE_PATH "$ENV{WEBKIT_LIBRARIES}" WEBKIT_LIBRARIES_DIR)
@@ -204,10 +211,24 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(USE_SYSTEM_MALLOC PRIVATE ON)
 
 WEBKIT_OPTION_END()
 
+if (APPLE_BUILD)
+    include(target/icu)
+    set(COREFOUNDATION_LIBRARY CoreFoundation${DEBUG_SUFFIX})
+    SET_AND_EXPOSE_TO_BUILD(USE_CF ON)
+    find_package(LibXml2 2.9.1 REQUIRED)
+    if (ENABLE_XSLT)
+        find_package(LibXslt 1.1.28 REQUIRED)
+    endif ()
+else ()
+    find_package(ICU REQUIRED COMPONENTS data i18n uc)
+    find_package(LibXml2 2.9.7 REQUIRED)
+    if (ENABLE_XSLT)
+        find_package(LibXslt 1.1.32 REQUIRED)
+    endif ()
+endif ()
+
 find_package(CURL 7.60.0 REQUIRED)
-find_package(ICU REQUIRED COMPONENTS data i18n uc)
 find_package(JPEG 1.5.2 REQUIRED)
-find_package(LibXml2 2.9.7 REQUIRED)
 find_package(OpenSSL 2.0.0 REQUIRED)
 find_package(PNG 1.6.34 REQUIRED)
 find_package(Sqlite 3.23.1 REQUIRED)
@@ -220,10 +241,6 @@ find_package(LibPSL 0.20.2 REQUIRED)
 #     SET_AND_EXPOSE_TO_BUILD(USE_WEBP ON)
 # endif ()
 
-if (ENABLE_XSLT)
-    find_package(LibXslt 1.1.32 REQUIRED)
-endif ()
-
 SET_AND_EXPOSE_TO_BUILD(USE_CURL ON)
 SET_AND_EXPOSE_TO_BUILD(USE_DIRECT2D ON)
 SET_AND_EXPOSE_TO_BUILD(USE_EXPORT_MACROS ON)