Title: [278265] trunk/Source/WebKitLegacy
Revision
278265
Author
[email protected]
Date
2021-05-30 19:57:04 -0700 (Sun, 30 May 2021)

Log Message

Remove some of the unneeded WebKitLegacy Windows-specific plug-in code
https://bugs.webkit.org/show_bug.cgi?id=226410

Reviewed by Chris Dumez.

Source/WebKitLegacy:

* PlatformFTW.cmake: Removed all the code in the win/Plugins directory,
and EmbeddedWidget.h/cpp.
* PlatformWin.cmake: Ditto.

Source/WebKitLegacy/win:

* Plugins/PaintHooks.asm: Removed.
* Plugins/PlatformModule.h: Removed.
* Plugins/PluginDatabase.cpp: Removed.
* Plugins/PluginDatabase.h: Removed.
* Plugins/PluginDatabaseWin.cpp: Removed.
* Plugins/PluginDebug.cpp: Removed.
* Plugins/PluginDebug.h: Removed.
* Plugins/PluginMainThreadScheduler.cpp: Removed.
* Plugins/PluginMainThreadScheduler.h: Removed.
* Plugins/PluginMessageThrottlerWin.cpp: Removed.
* Plugins/PluginMessageThrottlerWin.h: Removed.
* Plugins/PluginPackage.cpp: Removed.
* Plugins/PluginPackage.h: Removed.
* Plugins/PluginPackageWin.cpp: Removed.
* Plugins/PluginQuirkSet.h: Removed.
* Plugins/PluginStream.cpp: Removed.
* Plugins/PluginStream.h: Removed.
* Plugins/PluginView.cpp: Removed.
* Plugins/PluginView.h: Removed.
* Plugins/PluginViewWin.cpp: Removed.
* Plugins/npapi.cpp: Removed.
* WebCoreSupport/EmbeddedWidget.cpp: Removed.
* WebCoreSupport/EmbeddedWidget.h: Removed.

* WebCoreSupport/WebFrameLoaderClient.cpp: Removed includes of
PluginDatabase.h, PluginPackage.h, PluginView.h.
(WebFrameLoaderClient::WebFrameLoaderClient): Removed m_manualLoader and
m_hasSetnResponseToPlugin.
(WebFrameLoaderClient::setMainDocumentError): Removed all the code here,
which was only used for m_manualLoader.
(WebFrameLoaderClient::committedLoad): Removed code that runs only if
m_manualLoader is non-null.
(WebFrameLoaderClient::finishedLoading): Removed all the code here, which
was only used for m_manualLoader.
(WebFrameLoaderClient::objectContentType): Removed call to plug-in database
to figure out MIME type and select a plug-in to load.
(WebFrameLoaderClient::dispatchDidFailToStartPlugin const): Deleted.
(WebFrameLoaderClient::createPlugin): Return nullptr. No longer support
Netscape-style plug-ins, nor call the embeddedViewWithArguments function.
(WebFrameLoaderClient::redirectDataToPlugin): Removed all the code here.
* WebCoreSupport/WebFrameLoaderClient.h: Removed dispatchDidFailToStartPlugin,
m_manualLoader, and m_hasSentResponseToPlugin.
* WebCoreSupport/WebPluginInfoProvider.cpp: Removed include of PluginDatabase.h.
(WebPluginInfoProvider::refreshPlugins): Removed all the code here.
(WebPluginInfoProvider::pluginInfo): Ditto.
(WebPluginInfoProvider::webVisiblePluginInfo): Ditto.
* WebFrame.cpp: Removed includes of PluginDatabase.h and PluginView.h.
* WebView.cpp: Ditto.
(WebView::WebViewWndProc): Removed workaround specifically for the
Windows Media Player plug-in.
(WebView::addAdditionalPluginDirectory): Removed all the code here.

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebKitLegacy/ChangeLog (278264 => 278265)


--- trunk/Source/WebKitLegacy/ChangeLog	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/ChangeLog	2021-05-31 02:57:04 UTC (rev 278265)
@@ -1,3 +1,14 @@
+2021-05-30  Darin Adler  <[email protected]>
+
+        Remove some of the unneeded WebKitLegacy Windows-specific plug-in code
+        https://bugs.webkit.org/show_bug.cgi?id=226410
+
+        Reviewed by Chris Dumez.
+
+        * PlatformFTW.cmake: Removed all the code in the win/Plugins directory,
+        and EmbeddedWidget.h/cpp.
+        * PlatformWin.cmake: Ditto.
+
 2021-05-27  Darin Adler  <[email protected]>
 
         Next step toward using std::optional directly instead of through WTF::Optional typedef

Modified: trunk/Source/WebKitLegacy/PlatformFTW.cmake (278264 => 278265)


--- trunk/Source/WebKitLegacy/PlatformFTW.cmake	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/PlatformFTW.cmake	2021-05-31 02:57:04 UTC (rev 278265)
@@ -27,7 +27,6 @@
     "${CMAKE_BINARY_DIR}/../include/private/_javascript_Core"
     "${CMAKE_BINARY_DIR}/../include/private/WebCore"
     "${WEBKITLEGACY_DIR}/win"
-    "${WEBKITLEGACY_DIR}/win/plugins"
     "${WEBKITLEGACY_DIR}/win/WebCoreSupport"
     "${WebKitLegacy_DERIVED_SOURCES_DIR}/include"
     "${WebKitLegacy_DERIVED_SOURCES_DIR}/Interfaces"
@@ -171,25 +170,11 @@
     win/WebView.cpp
     win/WebWorkersPrivate.cpp
 
-    win/plugins/PluginDatabase.cpp
-    win/plugins/PluginDatabaseWin.cpp
-    win/plugins/PluginDebug.cpp
-    win/plugins/PluginMainThreadScheduler.cpp
-    win/plugins/PluginMessageThrottlerWin.cpp
-    win/plugins/PluginPackage.cpp
-    win/plugins/PluginPackageWin.cpp
-    win/plugins/PluginStream.cpp
-    win/plugins/PluginView.cpp
-    win/plugins/PluginViewWin.cpp
-    win/plugins/npapi.cpp
-
     win/storage/WebDatabaseProvider.cpp
 )
 
 list(APPEND WebKitLegacy_SOURCES_WebCoreSupport
     win/WebCoreSupport/AcceleratedCompositingContext.cpp
-    win/WebCoreSupport/EmbeddedWidget.cpp
-    win/WebCoreSupport/EmbeddedWidget.h
     win/WebCoreSupport/WebChromeClient.cpp
     win/WebCoreSupport/WebChromeClient.h
     win/WebCoreSupport/WebContextMenuClient.cpp
@@ -228,28 +213,6 @@
     )
 endif ()
 
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-    enable_language(ASM_MASM)
-    if (MSVC)
-        set(MASM_EXECUTABLE ml64)
-        set(MASM_FLAGS /c /Fo)
-        add_custom_command(
-            OUTPUT ${WebKitLegacy_DERIVED_SOURCES_DIR}/PaintHooks.obj
-            MAIN_DEPENDENCY win/plugins/PaintHooks.asm
-            COMMAND ${MASM_EXECUTABLE} ${MASM_FLAGS}
-                ${WebKitLegacy_DERIVED_SOURCES_DIR}/PaintHooks.obj
-                ${CMAKE_CURRENT_SOURCE_DIR}/win/plugins/PaintHooks.asm
-            VERBATIM)
-        list(APPEND WebKitLegacy_SOURCES
-            ${WebKitLegacy_DERIVED_SOURCES_DIR}/PaintHooks.obj
-        )
-    else ()
-        list(APPEND WebKitLegacy_SOURCES
-            win/plugins/PaintHooks.asm
-        )
-    endif ()
-endif ()
-
 if (COMPILER_IS_GCC_OR_CLANG)
     WEBKIT_ADD_TARGET_CXX_FLAGS(WebKitLegacy -Wno-overloaded-virtual)
 endif ()

Modified: trunk/Source/WebKitLegacy/PlatformWin.cmake (278264 => 278265)


--- trunk/Source/WebKitLegacy/PlatformWin.cmake	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/PlatformWin.cmake	2021-05-31 02:57:04 UTC (rev 278265)
@@ -45,7 +45,6 @@
     "${CMAKE_BINARY_DIR}/../include/private/_javascript_Core"
     "${CMAKE_BINARY_DIR}/../include/private/WebCore"
     "${WEBKITLEGACY_DIR}/win"
-    "${WEBKITLEGACY_DIR}/win/plugins"
     "${WEBKITLEGACY_DIR}/win/WebCoreSupport"
     "${WebKitLegacy_DERIVED_SOURCES_DIR}/include"
     "${WebKitLegacy_DERIVED_SOURCES_DIR}/Interfaces"
@@ -189,25 +188,11 @@
     win/WebView.cpp
     win/WebWorkersPrivate.cpp
 
-    win/plugins/PluginDatabase.cpp
-    win/plugins/PluginDatabaseWin.cpp
-    win/plugins/PluginDebug.cpp
-    win/plugins/PluginMainThreadScheduler.cpp
-    win/plugins/PluginMessageThrottlerWin.cpp
-    win/plugins/PluginPackage.cpp
-    win/plugins/PluginPackageWin.cpp
-    win/plugins/PluginStream.cpp
-    win/plugins/PluginView.cpp
-    win/plugins/PluginViewWin.cpp
-    win/plugins/npapi.cpp
-
     win/storage/WebDatabaseProvider.cpp
 )
 
 list(APPEND WebKitLegacy_SOURCES_WebCoreSupport
     win/WebCoreSupport/AcceleratedCompositingContext.cpp
-    win/WebCoreSupport/EmbeddedWidget.cpp
-    win/WebCoreSupport/EmbeddedWidget.h
     win/WebCoreSupport/WebChromeClient.cpp
     win/WebCoreSupport/WebChromeClient.h
     win/WebCoreSupport/WebContextMenuClient.cpp
@@ -274,29 +259,6 @@
     ${WebKitLegacy_DERIVED_SOURCES_DIR}/WebViewPreferencesChangedGenerated.cpp
 )
 
-
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-    enable_language(ASM_MASM)
-    if (MSVC)
-        set(MASM_EXECUTABLE ml64)
-        set(MASM_FLAGS /c /Fo)
-        add_custom_command(
-            OUTPUT ${WebKitLegacy_DERIVED_SOURCES_DIR}/PaintHooks.obj
-            MAIN_DEPENDENCY win/plugins/PaintHooks.asm
-            COMMAND ${MASM_EXECUTABLE} ${MASM_FLAGS}
-                ${WebKitLegacy_DERIVED_SOURCES_DIR}/PaintHooks.obj
-                ${CMAKE_CURRENT_SOURCE_DIR}/win/plugins/PaintHooks.asm
-            VERBATIM)
-        list(APPEND WebKitLegacy_SOURCES
-            ${WebKitLegacy_DERIVED_SOURCES_DIR}/PaintHooks.obj
-        )
-    else ()
-        list(APPEND WebKitLegacy_SOURCES
-            win/plugins/PaintHooks.asm
-        )
-    endif ()
-endif ()
-
 list(APPEND WebKitLegacy_SOURCES ${WebKitLegacy_INCLUDES} ${WebKitLegacy_SOURCES_Classes} ${WebKitLegacy_SOURCES_WebCoreSupport})
 
 source_group(Includes FILES ${WebKitLegacy_INCLUDES})

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2021-05-31 02:57:04 UTC (rev 278265)
@@ -1,5 +1,64 @@
 2021-05-30  Darin Adler  <[email protected]>
 
+        Remove some of the unneeded WebKitLegacy Windows-specific plug-in code
+        https://bugs.webkit.org/show_bug.cgi?id=226410
+
+        Reviewed by Chris Dumez.
+
+        * Plugins/PaintHooks.asm: Removed.
+        * Plugins/PlatformModule.h: Removed.
+        * Plugins/PluginDatabase.cpp: Removed.
+        * Plugins/PluginDatabase.h: Removed.
+        * Plugins/PluginDatabaseWin.cpp: Removed.
+        * Plugins/PluginDebug.cpp: Removed.
+        * Plugins/PluginDebug.h: Removed.
+        * Plugins/PluginMainThreadScheduler.cpp: Removed.
+        * Plugins/PluginMainThreadScheduler.h: Removed.
+        * Plugins/PluginMessageThrottlerWin.cpp: Removed.
+        * Plugins/PluginMessageThrottlerWin.h: Removed.
+        * Plugins/PluginPackage.cpp: Removed.
+        * Plugins/PluginPackage.h: Removed.
+        * Plugins/PluginPackageWin.cpp: Removed.
+        * Plugins/PluginQuirkSet.h: Removed.
+        * Plugins/PluginStream.cpp: Removed.
+        * Plugins/PluginStream.h: Removed.
+        * Plugins/PluginView.cpp: Removed.
+        * Plugins/PluginView.h: Removed.
+        * Plugins/PluginViewWin.cpp: Removed.
+        * Plugins/npapi.cpp: Removed.
+        * WebCoreSupport/EmbeddedWidget.cpp: Removed.
+        * WebCoreSupport/EmbeddedWidget.h: Removed.
+
+        * WebCoreSupport/WebFrameLoaderClient.cpp: Removed includes of
+        PluginDatabase.h, PluginPackage.h, PluginView.h.
+        (WebFrameLoaderClient::WebFrameLoaderClient): Removed m_manualLoader and
+        m_hasSetnResponseToPlugin.
+        (WebFrameLoaderClient::setMainDocumentError): Removed all the code here,
+        which was only used for m_manualLoader.
+        (WebFrameLoaderClient::committedLoad): Removed code that runs only if
+        m_manualLoader is non-null.
+        (WebFrameLoaderClient::finishedLoading): Removed all the code here, which
+        was only used for m_manualLoader.
+        (WebFrameLoaderClient::objectContentType): Removed call to plug-in database
+        to figure out MIME type and select a plug-in to load.
+        (WebFrameLoaderClient::dispatchDidFailToStartPlugin const): Deleted.
+        (WebFrameLoaderClient::createPlugin): Return nullptr. No longer support
+        Netscape-style plug-ins, nor call the embeddedViewWithArguments function.
+        (WebFrameLoaderClient::redirectDataToPlugin): Removed all the code here.
+        * WebCoreSupport/WebFrameLoaderClient.h: Removed dispatchDidFailToStartPlugin,
+        m_manualLoader, and m_hasSentResponseToPlugin.
+        * WebCoreSupport/WebPluginInfoProvider.cpp: Removed include of PluginDatabase.h.
+        (WebPluginInfoProvider::refreshPlugins): Removed all the code here.
+        (WebPluginInfoProvider::pluginInfo): Ditto.
+        (WebPluginInfoProvider::webVisiblePluginInfo): Ditto.
+        * WebFrame.cpp: Removed includes of PluginDatabase.h and PluginView.h.
+        * WebView.cpp: Ditto.
+        (WebView::WebViewWndProc): Removed workaround specifically for the
+        Windows Media Player plug-in.
+        (WebView::addAdditionalPluginDirectory): Removed all the code here.
+
+2021-05-30  Darin Adler  <[email protected]>
+
         Remove WTF::Optional synonym for std::optional, using that class template directly instead
         https://bugs.webkit.org/show_bug.cgi?id=226433
 

Deleted: trunk/Source/WebKitLegacy/win/WebCoreSupport/EmbeddedWidget.cpp (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/EmbeddedWidget.cpp	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/EmbeddedWidget.cpp	2021-05-31 02:57:04 UTC (rev 278265)
@@ -1,233 +0,0 @@
-/*
- * Copyright (C) 2008, 2013 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "EmbeddedWidget.h"
-
-#include <WebCore/Document.h>
-#include <WebCore/FrameView.h>
-#include <WebCore/HTMLPlugInElement.h>
-#include <WebCore/RenderObject.h>
-#include <wtf/win/GDIObject.h>
-
-#include "MemoryStream.h"
-#include "WebError.h"
-#include "WebURLResponse.h"
-
-using namespace WebCore;
-
-Ref<EmbeddedWidget> EmbeddedWidget::create(IWebEmbeddedView* view, HTMLPlugInElement* element, HWND parentWindow, const IntSize& size)
-{
-    auto widget = adoptRef(*new EmbeddedWidget(view, element));
-
-    widget->createWindow(parentWindow, size);
-    return widget;
-}
-
-EmbeddedWidget::~EmbeddedWidget()
-{
-    if (m_window)
-        DestroyWindow(m_window);
-}
-
-bool EmbeddedWidget::createWindow(HWND parentWindow, const IntSize& size)
-{
-    ASSERT(!m_window);
-
-    HWND window;
-    SIZE pluginSize(size);
-
-    HRESULT hr = m_view->createViewWindow(parentWindow, &pluginSize, &window);
-        
-    if (FAILED(hr) || !window)
-        return false;
-
-    m_window = window;
-    return true;
-}
-
-void EmbeddedWidget::invalidateRect(const IntRect& rect)
-{
-    if (!m_window)
-        return;
-
-    RECT r = rect;
-   ::InvalidateRect(m_window, &r, false);
-}
-
-void EmbeddedWidget::setFrameRect(const IntRect& rect)
-{
-    if (m_element->document().printing())
-        return;
-
-    if (rect != frameRect())
-        Widget::setFrameRect(rect);
-
-    frameRectsChanged();
-}
-
-void EmbeddedWidget::frameRectsChanged()
-{
-    if (!parent())
-        return;
-
-    FrameView& frameView = downcast<FrameView>(*parent());
-
-    IntRect oldWindowRect = m_windowRect;
-    IntRect oldClipRect = m_clipRect;
-
-    m_windowRect = IntRect(frameView.contentsToWindow(frameRect().location()), frameRect().size());
-    m_clipRect = windowClipRect();
-    m_clipRect.move(-m_windowRect.x(), -m_windowRect.y());
-
-    if (!m_window)
-        return;
-
-    if (m_windowRect == oldWindowRect && m_clipRect == oldClipRect)
-        return;
-
-    // To prevent flashes while scrolling, we disable drawing during the window
-    // update process by clipping the window to the zero rect.
-
-    bool clipToZeroRect = true;
-
-    if (clipToZeroRect) {
-        auto rgn = adoptGDIObject(::CreateRectRgn(0, 0, 0, 0));
-        ::SetWindowRgn(m_window, rgn.leak(), FALSE);
-    } else {
-        auto rgn = adoptGDIObject(::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY()));
-        ::SetWindowRgn(m_window, rgn.leak(), TRUE);
-     }
-
-     if (m_windowRect != oldWindowRect)
-        ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
-
-     if (clipToZeroRect) {
-        auto rgn = adoptGDIObject(::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.maxX(), m_clipRect.maxY()));
-        ::SetWindowRgn(m_window, rgn.leak(), TRUE);
-    }
-}
-
-void EmbeddedWidget::setFocus(bool focused)
-{
-    if (m_window && focused)
-        SetFocus(m_window);
-
-    Widget::setFocus(focused);
-}
-
-void EmbeddedWidget::show()
-{
-    m_isVisible = true;
-
-    if (m_attachedToWindow && m_window)
-        ShowWindow(m_window, SW_SHOWNA);
-
-    Widget::show();
-}
-
-void EmbeddedWidget::hide()
-{
-    m_isVisible = false;
-
-    if (m_attachedToWindow && m_window)
-        ShowWindow(m_window, SW_HIDE);
-
-    Widget::hide();
-}
-
-IntRect EmbeddedWidget::windowClipRect() const
-{
-    // Start by clipping to our bounds.
-    IntRect clipRect(m_windowRect);
-    
-    // Take our element and get the clip rect from the enclosing layer and frame view.
-    FrameView* parentView = m_element->document().view();
-    clipRect.intersect(parentView->windowClipRectForFrameOwner(m_element, true));
-
-    return clipRect;
-}
-
-void EmbeddedWidget::setParent(ScrollView* parent)
-{
-    Widget::setParent(parent);
-
-    if (!m_window)
-        return;
-
-    if (parent)
-        return;
-
-    // If the embedded window or one of its children have the focus, we need to 
-    // clear it to prevent the web view window from being focused because that can
-    // trigger a layout while the plugin element is being detached.
-    HWND focusedWindow = ::GetFocus();
-    if (m_window == focusedWindow || ::IsChild(m_window, focusedWindow))
-        ::SetFocus(0);
-}
-
-void EmbeddedWidget::attachToWindow()
-{
-    if (m_attachedToWindow)
-        return;
-
-    m_attachedToWindow = true;
-    if (m_isVisible && m_window)
-        ShowWindow(m_window, SW_SHOWNA);
-}
-
-void EmbeddedWidget::detachFromWindow()
-{
-    if (!m_attachedToWindow)
-        return;
-
-    if (m_isVisible && m_window)
-        ShowWindow(m_window, SW_HIDE);
-    m_attachedToWindow = false;
-}
-
-void EmbeddedWidget::didReceiveResponse(const ResourceResponse& response)
-{
-    ASSERT(m_view);
-
-    COMPtr<IWebURLResponse> urlResponse(AdoptCOM, WebURLResponse::createInstance(response));
-    m_view->didReceiveResponse(urlResponse.get());
-}
-
-void EmbeddedWidget::didReceiveData(const char* data, int length)
-{
-    COMPtr<MemoryStream> stream = MemoryStream::createInstance(SharedBuffer::create(data, length));
-    m_view->didReceiveData(stream.get());
-}
-
-void EmbeddedWidget::didFinishLoading()
-{
-    m_view->didFinishLoading();
-}
-
-void EmbeddedWidget::didFail(const ResourceError& error)
-{
-    COMPtr<IWebError> webError(AdoptCOM, WebError::createInstance(error));
-    m_view->didFail(webError.get());
-}

Deleted: trunk/Source/WebKitLegacy/win/WebCoreSupport/EmbeddedWidget.h (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/EmbeddedWidget.h	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/EmbeddedWidget.h	2021-05-31 02:57:04 UTC (rev 278265)
@@ -1,86 +0,0 @@
-/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef EmbeddedWidget_h
-#define EmbeddedWidget_h
-
-#include "PluginView.h"
-#include "WebKit.h"
-#include <WebCore/COMPtr.h>
-#include <WebCore/IntRect.h>
-
-namespace WebCore {
-class HTMLPlugInElement;
-class IntSize;
-}
-
-interface IWebEmbeddedView;
-
-class EmbeddedWidget : public WebCore::Widget, public WebCore::PluginManualLoader {
-public:
-    static Ref<EmbeddedWidget> create(IWebEmbeddedView*, WebCore::HTMLPlugInElement*, HWND parentWindow, const WebCore::IntSize&);
-    ~EmbeddedWidget();
-
-private:
-    EmbeddedWidget(IWebEmbeddedView* view, WebCore::HTMLPlugInElement* element)
-        : m_view(view)
-        , m_element(element)
-        , m_window(0)
-        , m_isVisible(false)
-        , m_attachedToWindow(false)
-    {
-    }
-
-    bool createWindow(HWND parentWindow, const WebCore::IntSize& size);
-
-    virtual void didReceiveResponse(const WebCore::ResourceResponse&);
-    virtual void didReceiveData(const char*, int);
-    virtual void didFinishLoading();
-    virtual void didFail(const WebCore::ResourceError&);
-
-    virtual void invalidateRect(const WebCore::IntRect&);
-    virtual void setFrameRect(const WebCore::IntRect&);
-    virtual void frameRectsChanged();
-    virtual void setFocus(bool);
-    virtual void show();
-    virtual void hide();
-    virtual WebCore::IntRect windowClipRect() const;
-    virtual void setParent(WebCore::ScrollView*);
-
-    virtual void attachToWindow();
-    virtual void detachFromWindow();
-
-    COMPtr<IWebEmbeddedView> m_view;
-    WebCore::HTMLPlugInElement* m_element;
-    HWND m_window;
-
-    bool m_isVisible;
-    bool m_attachedToWindow;
-        
-    WebCore::IntRect m_clipRect; // The clip rect to apply to an embedded view.
-    WebCore::IntRect m_windowRect; // Our window rect.
-};
-
-#endif // EmbeddedWidget_h

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp	2021-05-31 02:57:04 UTC (rev 278265)
@@ -32,11 +32,7 @@
 #include "COMPropertyBag.h"
 #include "DOMHTMLClasses.h"
 #include "DefaultPolicyDelegate.h"
-#include "EmbeddedWidget.h"
 #include "MarshallingHelpers.h"
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
-#include "PluginView.h"
 #include "WebActionPropertyBag.h"
 #include "WebCachedFramePlatformData.h"
 #include "WebChromeClient.h"
@@ -109,8 +105,6 @@
 WebFrameLoaderClient::WebFrameLoaderClient(WebFrame* webFrame)
     : m_policyListenerPrivate(makeUnique<WebFramePolicyListenerPrivate>())
     , m_webFrame(webFrame)
-    , m_manualLoader(0)
-    , m_hasSentResponseToPlugin(false) 
 {
 }
 
@@ -628,14 +622,8 @@
     completionHandler();
 }
 
-void WebFrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError& error)
+void WebFrameLoaderClient::setMainDocumentError(DocumentLoader*, const ResourceError&)
 {
-    if (!m_manualLoader)
-        return;
-
-    m_manualLoader->didFail(error);
-    m_manualLoader = 0;
-    m_hasSentResponseToPlugin = false;
 }
 
 void WebFrameLoaderClient::startDownload(const ResourceRequest& request, const String& /* suggestedName */)
@@ -655,8 +643,7 @@
 
 void WebFrameLoaderClient::committedLoad(DocumentLoader* loader, const char* data, int length)
 {
-    if (!m_manualLoader)
-        loader->commitData(data, length);
+    loader->commitData(data, length);
 
     // If the document is a stand-alone media document, now is the right time to cancel the WebKit load.
     // FIXME: This code should be shared across all ports. <http://webkit.org/b/48762>.
@@ -663,30 +650,10 @@
     Frame* coreFrame = core(m_webFrame);
     if (coreFrame->document()->isMediaDocument())
         loader->cancelMainResourceLoad(pluginWillHandleLoadError(loader->response()));
-
-    if (!m_manualLoader)
-        return;
-
-    if (!m_hasSentResponseToPlugin) {
-        m_manualLoader->didReceiveResponse(loader->response());
-        // didReceiveResponse sets up a new stream to the plug-in. on a full-page plug-in, a failure in
-        // setting up this stream can cause the main document load to be cancelled, setting m_manualLoader
-        // to null
-        if (!m_manualLoader)
-            return;
-        m_hasSentResponseToPlugin = true;
-    }
-    m_manualLoader->didReceiveData(data, length);
 }
 
 void WebFrameLoaderClient::finishedLoading(DocumentLoader*)
 {
-    if (!m_manualLoader)
-        return;
-
-    m_manualLoader->didFinishLoading();
-    m_manualLoader = 0;
-    m_hasSentResponseToPlugin = false;
 }
 
 void WebFrameLoaderClient::updateGlobalHistory()
@@ -999,22 +966,12 @@
 {
     String mimeType = mimeTypeIn;
 
-    if (mimeType.isEmpty()) {
-        String decodedPath = decodeURLEscapeSequences(url.path());
-        mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(StringView { decodedPath }.substring(decodedPath.reverseFind('.') + 1));
-    }
-
     if (mimeType.isEmpty())
         return ObjectContentType::Frame; // Go ahead and hope that we can display the content.
 
-    bool plugInSupportsMIMEType = PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType);
-
     if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
         return WebCore::ObjectContentType::Image;
 
-    if (plugInSupportsMIMEType)
-        return WebCore::ObjectContentType::PlugIn;
-
     if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType))
         return WebCore::ObjectContentType::Frame;
 
@@ -1021,124 +978,13 @@
     return WebCore::ObjectContentType::None;
 }
 
-void WebFrameLoaderClient::dispatchDidFailToStartPlugin(const PluginView& pluginView) const
+RefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize&, HTMLPlugInElement&, const URL&, const Vector<String>&, const Vector<String>&, const String&, bool)
 {
-#if USE(CF)
-    WebView* webView = m_webFrame->webView();
-
-    COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate;
-    if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate)))
-        return;
-
-    RetainPtr<CFMutableDictionaryRef> userInfo = adoptCF(CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
-
-    Frame* frame = core(m_webFrame);
-    ASSERT(frame == pluginView.parentFrame());
-
-    if (!pluginView.pluginsPage().isNull()) {
-        URL pluginPageURL = frame->document()->completeURL(stripLeadingAndTrailingHTMLSpaces(pluginView.pluginsPage()));
-        if (pluginPageURL.protocolIsInHTTPFamily()) {
-            static NeverDestroyed<RetainPtr<CFStringRef>> key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInPageURLStringKey);
-            CFDictionarySetValue(userInfo.get(), key.get().get(), pluginPageURL.string().createCFString().get());
-        }
-    }
-
-    if (!pluginView.mimeType().isNull()) {
-        static NeverDestroyed<RetainPtr<CFStringRef>> key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorMIMETypeKey);
-        CFDictionarySetValue(userInfo.get(), key.get().get(), pluginView.mimeType().createCFString().get());
-    }
-
-    if (pluginView.plugin()) {
-        String pluginName = pluginView.plugin()->name();
-        if (!pluginName.isNull()) {
-            static NeverDestroyed<RetainPtr<CFStringRef>> key = MarshallingHelpers::LPCOLESTRToCFStringRef(WebKitErrorPlugInNameKey);
-            CFDictionarySetValue(userInfo.get(), key.get().get(), pluginName.createCFString().get());
-        }
-    }
-
-    COMPtr<CFDictionaryPropertyBag> userInfoBag = CFDictionaryPropertyBag::createInstance();
-    userInfoBag->setDictionary(userInfo.get());
- 
-    int errorCode = 0;
-    String description;
-    switch (pluginView.status()) {
-        case PluginStatusCanNotFindPlugin:
-            errorCode = WebKitErrorCannotFindPlugIn;
-            description = WEB_UI_STRING("The plug-in can\xE2\x80\x99t be found", "WebKitErrorCannotFindPlugin description");
-            break;
-        case PluginStatusCanNotLoadPlugin:
-            errorCode = WebKitErrorCannotLoadPlugIn;
-            description = WEB_UI_STRING("The plug-in can\xE2\x80\x99t be loaded", "WebKitErrorCannotLoadPlugin description");
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-    }
-
-    ResourceError resourceError(String(WebKitErrorDomain), errorCode, pluginView.url(), String());
-    COMPtr<IWebError> error(AdoptCOM, WebError::createInstance(resourceError, userInfoBag.get()));
-     
-    resourceLoadDelegate->plugInFailedWithError(webView, error.get(), getWebDataSource(frame->loader().documentLoader()));
-#else
-    ASSERT(0);
-#endif
-}
-
-RefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement& element, const URL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
-{
-    WebView* webView = m_webFrame->webView();
-
-    COMPtr<IWebUIDelegate> ui;
-    if (SUCCEEDED(webView->uiDelegate(&ui)) && ui) {
-        COMPtr<IWebUIDelegatePrivate> uiPrivate(Query, ui);
-
-        if (uiPrivate) {
-            // Assemble the view arguments in a property bag.
-            HashMap<String, String> viewArguments;
-            for (unsigned i = 0; i < paramNames.size(); i++) 
-                viewArguments.set(paramNames[i], paramValues[i]);
-            COMPtr<IPropertyBag> viewArgumentsBag(AdoptCOM, COMPropertyBag<String>::adopt(viewArguments));
-            COMPtr<IDOMElement> containingElement(AdoptCOM, DOMElement::createInstance(&element));
-
-            HashMap<String, COMVariant> arguments;
-
-            arguments.set(WebEmbeddedViewAttributesKey, viewArgumentsBag);
-            arguments.set(WebEmbeddedViewBaseURLKey, url.string());
-            arguments.set(WebEmbeddedViewContainingElementKey, containingElement);
-            arguments.set(WebEmbeddedViewMIMETypeKey, mimeType);
-
-            COMPtr<IPropertyBag> argumentsBag(AdoptCOM, COMPropertyBag<COMVariant>::adopt(arguments));
-
-            COMPtr<IWebEmbeddedView> view;
-            HRESULT result = uiPrivate->embeddedViewWithArguments(webView, m_webFrame, argumentsBag.get(), &view);
-            if (SUCCEEDED(result)) {
-                HWND parentWindow;
-                HRESULT hr = webView->viewWindow(&parentWindow);
-                ASSERT(SUCCEEDED(hr));
-
-                return EmbeddedWidget::create(view.get(), &element, parentWindow, pluginSize);
-            }
-        }
-    }
-
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    Frame* frame = core(m_webFrame);
-    auto pluginView = PluginView::create(frame, pluginSize, &element, url, paramNames, paramValues, mimeType, loadManually);
-
-    if (pluginView->status() == PluginStatusLoadedSuccessfully)
-        return pluginView;
-
-    dispatchDidFailToStartPlugin(pluginView.get());
-#endif
     return nullptr;
 }
 
-void WebFrameLoaderClient::redirectDataToPlugin(Widget& pluginWidget)
+void WebFrameLoaderClient::redirectDataToPlugin(Widget&)
 {
-    // Ideally, this function shouldn't be necessary, see <rdar://problem/4852889>
-    if (pluginWidget.isPluginView())
-        m_manualLoader = toPluginView(&pluginWidget);
-    else 
-        m_manualLoader = static_cast<EmbeddedWidget*>(&pluginWidget);
 }
 
 WebHistory* WebFrameLoaderClient::webHistory() const

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h	2021-05-31 02:57:04 UTC (rev 278265)
@@ -32,11 +32,6 @@
 #include <WebCore/FrameLoaderClient.h>
 #include <WebCore/ProgressTrackerClient.h>
 
-namespace WebCore {
-    class PluginManualLoader;
-    class PluginView;
-}
-
 class WebFrame;
 class WebFramePolicyListener;
 class WebHistory;
@@ -49,8 +44,6 @@
     void setWebFrame(WebFrame* webFrame) { m_webFrame = webFrame; }
     WebFrame* webFrame() const { return m_webFrame; }
 
-    void dispatchDidFailToStartPlugin(const WebCore::PluginView&) const;
-
     std::optional<WebCore::PageIdentifier> pageID() const final;
     std::optional<WebCore::FrameIdentifier> frameID() const final;
 
@@ -199,9 +192,4 @@
     std::unique_ptr<WebFramePolicyListenerPrivate> m_policyListenerPrivate;
 
     WebFrame* m_webFrame;
-
-    // Points to the manual loader that data should be redirected to.
-    WebCore::PluginManualLoader* m_manualLoader;
-
-    bool m_hasSentResponseToPlugin;
 };

Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPluginInfoProvider.cpp	2021-05-31 02:57:04 UTC (rev 278265)
@@ -25,8 +25,6 @@
 
 #include "WebPluginInfoProvider.h"
 
-#include "PluginDatabase.h"
-
 using namespace WebCore;
 
 WebPluginInfoProvider& WebPluginInfoProvider::singleton()
@@ -46,46 +44,14 @@
 
 void WebPluginInfoProvider::refreshPlugins()
 {
-    PluginDatabase::installedPlugins()->refresh();
 }
 
 Vector<WebCore::PluginInfo> WebPluginInfoProvider::pluginInfo(WebCore::Page& page, std::optional<Vector<WebCore::SupportedPluginIdentifier>>&)
 {
-    Vector<WebCore::PluginInfo> outPlugins;
-    const Vector<PluginPackage*>& plugins = PluginDatabase::installedPlugins()->plugins();
-
-    outPlugins.resize(plugins.size());
-
-    for (size_t i = 0; i < plugins.size(); ++i) {
-        PluginPackage* package = plugins[i];
-
-        PluginInfo info;
-        info.name = package->name();
-        info.file = package->fileName();
-        info.desc = package->description();
-
-        const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
-
-        info.mimes.reserveCapacity(mimeToDescriptions.size());
-
-        MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
-        for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
-            MimeClassInfo mime;
-
-            mime.type = it->key;
-            mime.desc = it->value;
-            mime.extensions = package->mimeToExtensions().get(mime.type);
-
-            info.mimes.append(mime);
-        }
-
-        outPlugins[i] = info;
-    }
-    return outPlugins;
+    return { };
 }
 
 Vector<WebCore::PluginInfo> WebPluginInfoProvider::webVisiblePluginInfo(WebCore::Page& page, const URL&)
 {
-    std::optional<Vector<WebCore::SupportedPluginIdentifier>> supportedPluginNames;
-    return pluginInfo(page, supportedPluginNames);
+    return { };
 }

Modified: trunk/Source/WebKitLegacy/win/WebFrame.cpp (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebFrame.cpp	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebFrame.cpp	2021-05-31 02:57:04 UTC (rev 278265)
@@ -31,8 +31,6 @@
 #include "COMPropertyBag.h"
 #include "DOMCoreClasses.h"
 #include "MarshallingHelpers.h"
-#include "PluginDatabase.h"
-#include "PluginView.h"
 #include "WebActionPropertyBag.h"
 #include "WebChromeClient.h"
 #include "WebDataSource.h"

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (278264 => 278265)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2021-05-31 02:02:22 UTC (rev 278264)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2021-05-31 02:57:04 UTC (rev 278265)
@@ -33,8 +33,6 @@
 #include "FullscreenVideoController.h"
 #include "MarshallingHelpers.h"
 #include "PageStorageSessionProvider.h"
-#include "PluginDatabase.h"
-#include "PluginView.h"
 #include "WebApplicationCache.h"
 #include "WebBackForwardList.h"
 #include "WebChromeClient.h"
@@ -2577,19 +2575,6 @@
     COMPtr<WebView> protector(webView);
     ASSERT(webView);
 
-    // Windows Media Player has a modal message loop that will deliver messages
-    // to us at inappropriate times and we will crash if we handle them when:
-    // they are delivered. We repost paint messages so that we eventually get
-    // a chance to paint once the modal loop has exited, but other messages
-    // aren't safe to repost, so we just drop them.
-#if ENABLE(NETSCAPE_PLUGIN_API)
-    if (PluginView::isCallingPlugin()) {
-        if (message == WM_PAINT)
-            PostMessage(hWnd, message, wParam, lParam);
-        return 0;
-    }
-#endif
-
     bool handled = true;
 
     switch (message) {
@@ -6021,9 +6006,8 @@
     return S_OK;
 }
 
-HRESULT WebView::addAdditionalPluginDirectory(_In_ BSTR directory)
+HRESULT WebView::addAdditionalPluginDirectory(_In_ BSTR)
 {
-    PluginDatabase::installedPlugins()->addExtraPluginDirectory(toString(directory));
     return S_OK;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to