Title: [287121] trunk
Revision
287121
Author
achristen...@apple.com
Date
2021-12-15 17:52:47 -0800 (Wed, 15 Dec 2021)

Log Message

Remove unreachable code in Plugin and PluginController
https://bugs.webkit.org/show_bug.cgi?id=234365

Reviewed by Geoff Garen and Anders Carlsson.

Source/WebCore:

* bindings/js/ScriptController.h:
* bindings/js/ScriptControllerMac.mm:
* history/BackForwardCache.cpp:
(WebCore::canCacheFrame):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setExperimentalPlugInSandboxProfilesEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::experimentalPlugInSandboxProfilesEnabled const): Deleted.

Source/WebKit:

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPageCacheSupportsPlugins):
(WKPreferencesGetPageCacheSupportsPlugins):
(WKPreferencesSetAsynchronousPluginInitializationEnabled):
(WKPreferencesGetAsynchronousPluginInitializationEnabled):
(WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins):
(WKPreferencesGetAsynchronousPluginInitializationEnabledForAllPlugins):
(WKPreferencesSetArtificialPluginInitializationDelayEnabled):
(WKPreferencesGetArtificialPluginInitializationDelayEnabled):
(WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins):
(WKPreferencesGetPluginSandboxProfilesEnabledForAllPlugins):
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setPageCacheSupportsPlugins:]):
(-[WKPreferences _pageCacheSupportsPlugins]):
(-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
(-[WKPreferences _asynchronousPluginInitializationEnabled]):
(-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
(-[WKPreferences _artificialPluginInitializationDelayEnabled]):
(-[WKPreferences _setExperimentalPlugInSandboxProfilesEnabled:]):
(-[WKPreferences _experimentalPlugInSandboxProfilesEnabled]):
* WebProcess/Plugins/PDF/PDFPlugin.h:
(isType):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::PDFPlugin):
(WebKit::PDFPlugin::getSelectionForWordAtPoint const): Deleted.
* WebProcess/Plugins/Plugin.cpp:
(WebKit::Plugin::Plugin): Deleted.
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::type const): Deleted.
(WebKit::Plugin::isPluginProxy const): Deleted.
(WebKit::Plugin::isNetscapePlugin const): Deleted.
(WebKit::Plugin::isPDFPlugin const): Deleted.
* WebProcess/Plugins/PluginController.h:
(WebKit::PluginController::asynchronousPluginInitializationEnabled const): Deleted.
(WebKit::PluginController::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted.
(WebKit::PluginController::artificialPluginInitializationDelayEnabled const): Deleted.
(WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector): Deleted.
(WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector): Deleted.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::initializePlugin):
(WebKit::PluginView::pluginFocusOrWindowFocusChanged):
(WebKit::PluginView::didFailToInitializePlugin): Deleted.
(WebKit::PluginView::getSelectionForWordAtPoint const): Deleted.
(WebKit::PluginView::invalidate): Deleted.
(WebKit::PluginView::userAgent): Deleted.
(WebKit::PluginView::cancelStreamLoad): Deleted.
(WebKit::PluginView::continueStreamLoad): Deleted.
(WebKit::PluginView::cancelManualStreamLoad): Deleted.
(WebKit::PluginView::setStatusbarText): Deleted.
(WebKit::PluginView::isAcceleratedCompositingEnabled): Deleted.
(WebKit::PluginView::compositingRenderServerPort): Deleted.
(WebKit::PluginView::getAuthenticationInfo): Deleted.
(WebKit::PluginView::isPrivateBrowsingEnabled): Deleted.
(WebKit::PluginView::asynchronousPluginInitializationEnabled const): Deleted.
(WebKit::PluginView::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted.
(WebKit::PluginView::artificialPluginInitializationDelayEnabled const): Deleted.
(WebKit::PluginView::protectPluginFromDestruction): Deleted.
(WebKit::PluginView::unprotectPluginFromDestruction): Deleted.
* WebProcess/Plugins/PluginView.h:
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::asynchronousPluginInitializationEnabled const): Deleted.
(WebKit::WebPage::setAsynchronousPluginInitializationEnabled): Deleted.
(WebKit::WebPage::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted.
(WebKit::WebPage::setAsynchronousPluginInitializationEnabledForAllPlugins): Deleted.
(WebKit::WebPage::artificialPluginInitializationDelayEnabled const): Deleted.
(WebKit::WebPage::setArtificialPluginInitializationDelayEnabled): Deleted.

Source/WTF:

* Scripts/Preferences/WebPreferences.yaml:
* Scripts/Preferences/WebPreferencesInternal.yaml:

LayoutTests:

* fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
* media/crash-closing-page-with-media-as-plugin-fallback.html:
* plugins/crash-restoring-plugin-page-from-page-cache.html:
* plugins/frameset-with-plugin-frame.html:
* plugins/netscape-plugin-page-cache-works.html:
* plugins/netscape-plugin-page-cache-works-expected.html: Remove test for no-longer-reachable configuration.

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (287120 => 287121)


--- trunk/LayoutTests/ChangeLog	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/ChangeLog	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1,3 +1,17 @@
+2021-12-15  Alex Christensen  <achristen...@webkit.org>
+
+        Remove unreachable code in Plugin and PluginController
+        https://bugs.webkit.org/show_bug.cgi?id=234365
+
+        Reviewed by Geoff Garen and Anders Carlsson.
+
+        * fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html:
+        * media/crash-closing-page-with-media-as-plugin-fallback.html:
+        * plugins/crash-restoring-plugin-page-from-page-cache.html:
+        * plugins/frameset-with-plugin-frame.html:
+        * plugins/netscape-plugin-page-cache-works.html:
+        * plugins/netscape-plugin-page-cache-works-expected.html: Remove test for no-longer-reachable configuration.
+
 2021-12-15  Gabriel Nava Marino  <gnavamar...@apple.com>
 
         null ptr deref in WebCore::ApplyStyleCommand::applyRelativeFontStyleChange

Modified: trunk/LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html (287120 => 287121)


--- trunk/LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/fast/frames/restoring-page-cache-should-not-run-scripts-via-style-update.html	2021-12-16 01:52:47 UTC (rev 287121)
@@ -9,7 +9,6 @@
 if (window.testRunner) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    internals.settings.setBackForwardCacheSupportsPlugins(true);
 }
 
 let newWindow;

Modified: trunk/LayoutTests/media/crash-closing-page-with-media-as-plugin-fallback.html (287120 => 287121)


--- trunk/LayoutTests/media/crash-closing-page-with-media-as-plugin-fallback.html	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/media/crash-closing-page-with-media-as-plugin-fallback.html	2021-12-16 01:52:47 UTC (rev 287121)
@@ -13,7 +13,6 @@
 if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    internals.settings.setBackForwardCacheSupportsPlugins(true);
     var button = document.getElementById("button");
     eventSender.mouseMoveTo(button.offsetParent.offsetLeft + button.offsetLeft + button.offsetWidth / 2, button.offsetParent.offsetTop +  button.offsetTop + button.offsetHeight / 2);
     eventSender.mouseDown();

Modified: trunk/LayoutTests/platform/win/TestExpectations (287120 => 287121)


--- trunk/LayoutTests/platform/win/TestExpectations	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/platform/win/TestExpectations	2021-12-16 01:52:47 UTC (rev 287121)
@@ -784,7 +784,6 @@
 webkit.org/b/88107 platform/win/plugins/window-region-is-set-to-clip-rect.html [ Skip ]
 webkit.org/b/88107 plugins/crash-restoring-plugin-page-from-page-cache.html [ Skip ]
 webkit.org/b/88107 plugins/fullscreen-plugins-dont-reload.html [ Skip ]
-webkit.org/b/88107 plugins/netscape-plugin-page-cache-works.html [ Skip ]
 # This test causes any following plugins test to crash
 plugins/nested-plugin-objects.html [ Skip ]
 

Modified: trunk/LayoutTests/plugins/crash-restoring-plugin-page-from-page-cache.html (287120 => 287121)


--- trunk/LayoutTests/plugins/crash-restoring-plugin-page-from-page-cache.html	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/plugins/crash-restoring-plugin-page-from-page-cache.html	2021-12-16 01:52:47 UTC (rev 287121)
@@ -4,7 +4,6 @@
 if (window.testRunner && window.internals) {
     testRunner.dumpAsText();
     testRunner.waitUntilDone();
-    internals.settings.setBackForwardCacheSupportsPlugins(true);
 }
 
 function pageShown() {

Modified: trunk/LayoutTests/plugins/frameset-with-plugin-frame.html (287120 => 287121)


--- trunk/LayoutTests/plugins/frameset-with-plugin-frame.html	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/plugins/frameset-with-plugin-frame.html	2021-12-16 01:52:47 UTC (rev 287121)
@@ -5,7 +5,6 @@
         testRunner.dumpAsText();
         testRunner.waitUntilDone();
         internals.settings.setFrameFlattening("FullyEnabled")
-        internals.settings.setBackForwardCacheSupportsPlugins(true);
     }
 </script>
 

Deleted: trunk/LayoutTests/plugins/netscape-plugin-page-cache-works-expected.txt (287120 => 287121)


--- trunk/LayoutTests/plugins/netscape-plugin-page-cache-works-expected.txt	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/plugins/netscape-plugin-page-cache-works-expected.txt	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1,22 +0,0 @@
-This tests that pages with plugins behave properly with the page cache. This includes:
--The plugin being destroyed upon navigation away from the page.
--The plugin being recreated upon restoring the page from the page cache.
--Plugin script objects accessed the first time the plugin was created are appropriately invalidated after the page has been restored from the page cache.
-
-Unfortunately there is no reliable way to get affirmative confirmation that the plugin was destroyed upon navigation away from the page. For now we'll assume recreation means it had successfully been destroyed.
-
-Initial load: Page loaded
-Initial load: Page shown
-Initial load: Plugin created
-Initial load: Accessing testObject.property
-Initial load: Accessed testObject.property without exception
-Initial load: Assigning to testObject.property
-Initial load: Assigned to testObject.property without exception
-Initial load: Page hidden
-Restored from page cache: Page shown
-Restored from page cache: Plugin created
-Restored from page cache: Accessing testObject.property
-Restored from page cache: While accessing testObject.property: ReferenceError: Trying to access object from destroyed plug-in.
-Restored from page cache: Assigning to testObject.property
-Restored from page cache: While assigning to testObject.property: ReferenceError: Trying to access object from destroyed plug-in.
-

Deleted: trunk/LayoutTests/plugins/netscape-plugin-page-cache-works.html (287120 => 287121)


--- trunk/LayoutTests/plugins/netscape-plugin-page-cache-works.html	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/LayoutTests/plugins/netscape-plugin-page-cache-works.html	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1,83 +0,0 @@
-<!-- webkit-test-runner [ UsesBackForwardCache=true ] -->
-<html>
-<script>
-if (window.testRunner && window.internals) {
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-    internals.settings.setBackForwardCacheSupportsPlugins(true);
-}
-
-var savedTestObject = null;
-var currentTestStage = null;
-var hasHidden = false;
-
-function runTest()
-{
-    var plugin = document.getElementById("testPlugin");
-    
-    if (!savedTestObject)
-        savedTestObject = plugin.testObject;
-
-    try {
-        log("Accessing testObject.property");
-        savedTestObject.property;
-        log("Accessed testObject.property without exception");
-    } catch (e) {
-        log("While accessing testObject.property: " + e);
-    }
-
-    try {
-        log("Assigning to testObject.property");
-        savedTestObject.property = 'hello';
-        log("Assigned to testObject.property without exception");
-    } catch (e) {
-        log("While assigning to testObject.property: " + e);
-    }
-    
-    if (!hasHidden)
-        setTimeout("window.location.href = ''", 0);
-    else {
-        if (window.testRunner)
-            testRunner.notifyDone();
-    }
-    
-}
-
-function loaded() {
-    currentTestStage = "Initial load";
-    log("Page loaded");
-}
-
-function hidden() {
-    log("Page hidden");
-    hasHidden = true;
-}
-
-function shown() {
-    if (hasHidden)
-        currentTestStage = "Restored from page cache"
-    log("Page shown");
-}
-
-function pluginCreated()
-{
-    log("Plugin created");
-    setTimeout("runTest()", 0);
-}
-
-function log(message)
-{
-   document.getElementById("logging").innerHTML += currentTestStage + ": " + message + "<br>";
-}
-</script>
-
-<body _onload_="loaded()" _onpagehide_="hidden();" _onpageshow_="shown();">
-This tests that pages with plugins behave properly with the page cache.  This includes:<br>
--The plugin being destroyed upon navigation away from the page.<br>
--The plugin being recreated upon restoring the page from the page cache.<br>
--Plugin script objects accessed the first time the plugin was created are appropriately invalidated after the page has been restored from the page cache.<br><br>
-Unfortunately there is no reliable way to get affirmative confirmation that the plugin was destroyed upon navigation away from the page.  For now we'll assume recreation means it had successfully been destroyed.<br>
-<embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" height="200" _onNew_="pluginCreated()"></embed><br>
-<div id="logging"></div>
-</body>
-</html>

Modified: trunk/Source/WTF/ChangeLog (287120 => 287121)


--- trunk/Source/WTF/ChangeLog	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WTF/ChangeLog	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1,3 +1,13 @@
+2021-12-15  Alex Christensen  <achristen...@webkit.org>
+
+        Remove unreachable code in Plugin and PluginController
+        https://bugs.webkit.org/show_bug.cgi?id=234365
+
+        Reviewed by Geoff Garen and Anders Carlsson.
+
+        * Scripts/Preferences/WebPreferences.yaml:
+        * Scripts/Preferences/WebPreferencesInternal.yaml:
+
 2021-12-15  Chris Dumez  <cdu...@apple.com>
 
         Support passing an old-style enum to add(Hasher&, ...)

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml (287120 => 287121)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferences.yaml	2021-12-16 01:52:47 UTC (rev 287121)
@@ -312,30 +312,6 @@
       "ENABLE(APPLE_PAY_REMOTE_UI)": true
       default: false
 
-ArtificialPluginInitializationDelayEnabled:
-  type: bool
-  webcoreBinding: none
-  exposed: [ WebKit ]
-  defaultValue:
-    WebKit:
-      default: false
-
-AsynchronousPluginInitializationEnabled:
-  type: bool
-  webcoreBinding: none
-  exposed: [ WebKit ]
-  defaultValue:
-    WebKit:
-      default: false
-
-AsynchronousPluginInitializationEnabledForAllPlugins:
-  type: bool
-  webcoreBinding: none
-  exposed: [ WebKit ]
-  defaultValue:
-    WebKit:
-      default: false
-
 AsynchronousSpellCheckingEnabled:
   type: bool
   defaultValue:
@@ -369,17 +345,6 @@
     WebCore:
       default: true
 
-BackForwardCacheSupportsPlugins:
-  type: bool
-  webKitLegacyPreferenceKey: WebKitPageCacheSupportsPluginsPreferenceKey
-  defaultValue:
-    WebKitLegacy:
-      default: true
-    WebKit:
-      default: true
-    WebCore:
-      default: false
-
 BackspaceKeyNavigationEnabled:
   type: bool
   defaultValue:

Modified: trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml (287120 => 287121)


--- trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WTF/Scripts/Preferences/WebPreferencesInternal.yaml	2021-12-16 01:52:47 UTC (rev 287121)
@@ -256,18 +256,6 @@
   WebCore:
    default: false
 
-# FIXME: This is not relevent for WebKitLegacy, so should be excluded from WebKitLegacy entirely.
-ExperimentalPlugInSandboxProfilesEnabled:
-  type: bool
-  humanReadableName: "Sandbox Plug-Ins"
-  humanReadableDescription: "Enable Plug-In sandboxing"
-  webcoreBinding: RuntimeEnabledFeatures
-  defaultValue:
-    WebKitLegacy:
-      default: false
-    WebKit:
-      default: false
-
 FasterClicksEnabled:
   type: bool
   humanReadableName: "Fast clicks"

Modified: trunk/Source/WebCore/ChangeLog (287120 => 287121)


--- trunk/Source/WebCore/ChangeLog	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebCore/ChangeLog	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1,3 +1,18 @@
+2021-12-15  Alex Christensen  <achristen...@webkit.org>
+
+        Remove unreachable code in Plugin and PluginController
+        https://bugs.webkit.org/show_bug.cgi?id=234365
+
+        Reviewed by Geoff Garen and Anders Carlsson.
+
+        * bindings/js/ScriptController.h:
+        * bindings/js/ScriptControllerMac.mm:
+        * history/BackForwardCache.cpp:
+        (WebCore::canCacheFrame):
+        * page/RuntimeEnabledFeatures.h:
+        (WebCore::RuntimeEnabledFeatures::setExperimentalPlugInSandboxProfilesEnabled): Deleted.
+        (WebCore::RuntimeEnabledFeatures::experimentalPlugInSandboxProfilesEnabled const): Deleted.
+
 2021-12-15  Chris Dumez  <cdu...@apple.com>
 
         Support passing an old-style enum to add(Hasher&, ...)

Modified: trunk/Source/WebCore/bindings/js/ScriptController.h (287120 => 287121)


--- trunk/Source/WebCore/bindings/js/ScriptController.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebCore/bindings/js/ScriptController.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -38,8 +38,6 @@
 OBJC_CLASS WebScriptObject;
 #endif
 
-struct NPObject;
-
 namespace JSC {
 class CallFrame;
 class JSGlobalObject;

Modified: trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm (287120 => 287121)


--- trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebCore/bindings/js/ScriptControllerMac.mm	2021-12-16 01:52:47 UTC (rev 287121)
@@ -46,7 +46,6 @@
 
 @interface NSObject (WebPlugin)
 - (id)objectForWebScript;
-- (NPObject *)createPluginScriptableObject;
 - (RefPtr<JSC::Bindings::Instance>)createPluginBindingsInstance:(Ref<JSC::Bindings::RootObject>&&)rootObject;
 @end
 

Modified: trunk/Source/WebCore/history/BackForwardCache.cpp (287120 => 287121)


--- trunk/Source/WebCore/history/BackForwardCache.cpp	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebCore/history/BackForwardCache.cpp	2021-12-16 01:52:47 UTC (rev 287121)
@@ -135,10 +135,6 @@
         logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::isErrorPageKey());
         isCacheable = false;
     }
-    if (frameLoader.subframeLoader().containsPlugins() && !frame.page()->settings().backForwardCacheSupportsPlugins()) {
-        PCLOG("   -Frame contains plugins");
-        isCacheable = false;
-    }
     if (frame.isMainFrame() && frame.document() && frame.document()->url().protocolIs("https") && documentLoader->response().cacheControlContainsNoStore()) {
         PCLOG("   -Frame is HTTPS, and cache control prohibits storing");
         logBackForwardCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::httpsNoStoreKey());

Modified: trunk/Source/WebCore/page/RuntimeEnabledFeatures.h (287120 => 287121)


--- trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebCore/page/RuntimeEnabledFeatures.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -101,9 +101,6 @@
     void setServerTimingEnabled(bool isEnabled) { m_isServerTimingEnabled = isEnabled; }
     bool serverTimingEnabled() const { return m_isServerTimingEnabled; }
 
-    void setExperimentalPlugInSandboxProfilesEnabled(bool isEnabled) { m_experimentalPlugInSandboxProfilesEnabled = isEnabled; }
-    bool experimentalPlugInSandboxProfilesEnabled() const { return m_experimentalPlugInSandboxProfilesEnabled; }
-
     void setAttrStyleEnabled(bool isEnabled) { m_attrStyleEnabled = isEnabled; }
     bool attrStyleEnabled() const { return m_attrStyleEnabled; }
 
@@ -288,7 +285,6 @@
     bool m_itpDebugMode { false };
     bool m_isRestrictedHTTPResponseAccess { true };
     bool m_isServerTimingEnabled { false };
-    bool m_experimentalPlugInSandboxProfilesEnabled { false };
     bool m_attrStyleEnabled { false };
     bool m_webAPIStatisticsEnabled { false };
     bool m_syntheticEditingCommandsEnabled { true };

Modified: trunk/Source/WebKit/ChangeLog (287120 => 287121)


--- trunk/Source/WebKit/ChangeLog	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/ChangeLog	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1,3 +1,77 @@
+2021-12-15  Alex Christensen  <achristen...@webkit.org>
+
+        Remove unreachable code in Plugin and PluginController
+        https://bugs.webkit.org/show_bug.cgi?id=234365
+
+        Reviewed by Geoff Garen and Anders Carlsson.
+
+        * UIProcess/API/C/WKPreferences.cpp:
+        (WKPreferencesSetPageCacheSupportsPlugins):
+        (WKPreferencesGetPageCacheSupportsPlugins):
+        (WKPreferencesSetAsynchronousPluginInitializationEnabled):
+        (WKPreferencesGetAsynchronousPluginInitializationEnabled):
+        (WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins):
+        (WKPreferencesGetAsynchronousPluginInitializationEnabledForAllPlugins):
+        (WKPreferencesSetArtificialPluginInitializationDelayEnabled):
+        (WKPreferencesGetArtificialPluginInitializationDelayEnabled):
+        (WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins):
+        (WKPreferencesGetPluginSandboxProfilesEnabledForAllPlugins):
+        * UIProcess/API/Cocoa/WKPreferences.mm:
+        (-[WKPreferences _setPageCacheSupportsPlugins:]):
+        (-[WKPreferences _pageCacheSupportsPlugins]):
+        (-[WKPreferences _setAsynchronousPluginInitializationEnabled:]):
+        (-[WKPreferences _asynchronousPluginInitializationEnabled]):
+        (-[WKPreferences _setArtificialPluginInitializationDelayEnabled:]):
+        (-[WKPreferences _artificialPluginInitializationDelayEnabled]):
+        (-[WKPreferences _setExperimentalPlugInSandboxProfilesEnabled:]):
+        (-[WKPreferences _experimentalPlugInSandboxProfilesEnabled]):
+        * WebProcess/Plugins/PDF/PDFPlugin.h:
+        (isType):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::PDFPlugin):
+        (WebKit::PDFPlugin::getSelectionForWordAtPoint const): Deleted.
+        * WebProcess/Plugins/Plugin.cpp:
+        (WebKit::Plugin::Plugin): Deleted.
+        * WebProcess/Plugins/Plugin.h:
+        (WebKit::Plugin::type const): Deleted.
+        (WebKit::Plugin::isPluginProxy const): Deleted.
+        (WebKit::Plugin::isNetscapePlugin const): Deleted.
+        (WebKit::Plugin::isPDFPlugin const): Deleted.
+        * WebProcess/Plugins/PluginController.h:
+        (WebKit::PluginController::asynchronousPluginInitializationEnabled const): Deleted.
+        (WebKit::PluginController::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted.
+        (WebKit::PluginController::artificialPluginInitializationDelayEnabled const): Deleted.
+        (WebKit::PluginController::PluginDestructionProtector::PluginDestructionProtector): Deleted.
+        (WebKit::PluginController::PluginDestructionProtector::~PluginDestructionProtector): Deleted.
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::initializePlugin):
+        (WebKit::PluginView::pluginFocusOrWindowFocusChanged):
+        (WebKit::PluginView::didFailToInitializePlugin): Deleted.
+        (WebKit::PluginView::getSelectionForWordAtPoint const): Deleted.
+        (WebKit::PluginView::invalidate): Deleted.
+        (WebKit::PluginView::userAgent): Deleted.
+        (WebKit::PluginView::cancelStreamLoad): Deleted.
+        (WebKit::PluginView::continueStreamLoad): Deleted.
+        (WebKit::PluginView::cancelManualStreamLoad): Deleted.
+        (WebKit::PluginView::setStatusbarText): Deleted.
+        (WebKit::PluginView::isAcceleratedCompositingEnabled): Deleted.
+        (WebKit::PluginView::compositingRenderServerPort): Deleted.
+        (WebKit::PluginView::getAuthenticationInfo): Deleted.
+        (WebKit::PluginView::isPrivateBrowsingEnabled): Deleted.
+        (WebKit::PluginView::asynchronousPluginInitializationEnabled const): Deleted.
+        (WebKit::PluginView::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted.
+        (WebKit::PluginView::artificialPluginInitializationDelayEnabled const): Deleted.
+        (WebKit::PluginView::protectPluginFromDestruction): Deleted.
+        (WebKit::PluginView::unprotectPluginFromDestruction): Deleted.
+        * WebProcess/Plugins/PluginView.h:
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::asynchronousPluginInitializationEnabled const): Deleted.
+        (WebKit::WebPage::setAsynchronousPluginInitializationEnabled): Deleted.
+        (WebKit::WebPage::asynchronousPluginInitializationEnabledForAllPlugins const): Deleted.
+        (WebKit::WebPage::setAsynchronousPluginInitializationEnabledForAllPlugins): Deleted.
+        (WebKit::WebPage::artificialPluginInitializationDelayEnabled const): Deleted.
+        (WebKit::WebPage::setArtificialPluginInitializationDelayEnabled): Deleted.
+
 2021-12-15  J Pascoe  <j_pas...@apple.com>
 
         [WebAuthn] Allow same-site, cross-origin iframe get()

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp (287120 => 287121)


--- trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPreferences.cpp	2021-12-16 01:52:47 UTC (rev 287121)
@@ -605,14 +605,13 @@
     return toImpl(preferencesRef)->usesBackForwardCache();
 }
 
-void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef, bool backForwardCacheSupportsPlugins)
+void WKPreferencesSetPageCacheSupportsPlugins(WKPreferencesRef, bool)
 {
-    toImpl(preferencesRef)->setBackForwardCacheSupportsPlugins(backForwardCacheSupportsPlugins);
 }
 
-bool WKPreferencesGetPageCacheSupportsPlugins(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetPageCacheSupportsPlugins(WKPreferencesRef)
 {
-    return toImpl(preferencesRef)->backForwardCacheSupportsPlugins();
+    return false;
 }
 
 void WKPreferencesSetPaginateDuringLayoutEnabled(WKPreferencesRef preferencesRef, bool enabled)
@@ -1005,34 +1004,31 @@
     return toImpl(preferencesRef)->diagnosticLoggingEnabled();
 }
 
-void WKPreferencesSetAsynchronousPluginInitializationEnabled(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetAsynchronousPluginInitializationEnabled(WKPreferencesRef, bool)
 {
-    toImpl(preferencesRef)->setAsynchronousPluginInitializationEnabled(enabled);
 }
 
-bool WKPreferencesGetAsynchronousPluginInitializationEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetAsynchronousPluginInitializationEnabled(WKPreferencesRef)
 {
-    return toImpl(preferencesRef)->asynchronousPluginInitializationEnabled();
+    return false;
 }
 
-void WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetAsynchronousPluginInitializationEnabledForAllPlugins(WKPreferencesRef, bool)
 {
-    toImpl(preferencesRef)->setAsynchronousPluginInitializationEnabledForAllPlugins(enabled);
 }
 
-bool WKPreferencesGetAsynchronousPluginInitializationEnabledForAllPlugins(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetAsynchronousPluginInitializationEnabledForAllPlugins(WKPreferencesRef)
 {
-    return toImpl(preferencesRef)->asynchronousPluginInitializationEnabledForAllPlugins();
+    return false;
 }
 
-void WKPreferencesSetArtificialPluginInitializationDelayEnabled(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetArtificialPluginInitializationDelayEnabled(WKPreferencesRef, bool)
 {
-    toImpl(preferencesRef)->setArtificialPluginInitializationDelayEnabled(enabled);
 }
 
-bool WKPreferencesGetArtificialPluginInitializationDelayEnabled(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetArtificialPluginInitializationDelayEnabled(WKPreferencesRef)
 {
-    return toImpl(preferencesRef)->artificialPluginInitializationDelayEnabled();
+    return false;
 }
 
 void WKPreferencesSetInteractiveFormValidationEnabled(WKPreferencesRef preferencesRef, bool enabled)
@@ -1064,14 +1060,13 @@
     return false;
 }
 
-void WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins(WKPreferencesRef preferencesRef, bool enabled)
+void WKPreferencesSetPluginSandboxProfilesEnabledForAllPlugins(WKPreferencesRef, bool)
 {
-    toImpl(preferencesRef)->setExperimentalPlugInSandboxProfilesEnabled(enabled);
 }
 
-bool WKPreferencesGetPluginSandboxProfilesEnabledForAllPlugins(WKPreferencesRef preferencesRef)
+bool WKPreferencesGetPluginSandboxProfilesEnabledForAllPlugins(WKPreferencesRef)
 {
-    return toImpl(preferencesRef)->experimentalPlugInSandboxProfilesEnabled();
+    return false;
 }
 
 void WKPreferencesSetSnapshotAllPlugIns(WKPreferencesRef, bool)

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm (287120 => 287121)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKPreferences.mm	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1036,12 +1036,11 @@
 
 - (void)_setPageCacheSupportsPlugins:(BOOL)enabled
 {
-    _preferences->setBackForwardCacheSupportsPlugins(enabled);
 }
 
 - (BOOL)_pageCacheSupportsPlugins
 {
-    return _preferences->backForwardCacheSupportsPlugins();
+    return NO;
 }
 
 - (void)_setShouldPrintBackgrounds:(BOOL)enabled
@@ -1096,32 +1095,29 @@
 
 - (void)_setAsynchronousPluginInitializationEnabled:(BOOL)enabled
 {
-    _preferences->setAsynchronousPluginInitializationEnabled(enabled);
 }
 
 - (BOOL)_asynchronousPluginInitializationEnabled
 {
-    return _preferences->asynchronousPluginInitializationEnabled();
+    return NO;
 }
 
 - (void)_setArtificialPluginInitializationDelayEnabled:(BOOL)enabled
 {
-    _preferences->setArtificialPluginInitializationDelayEnabled(enabled);
 }
 
 - (BOOL)_artificialPluginInitializationDelayEnabled
 {
-    return _preferences->artificialPluginInitializationDelayEnabled();
+    return NO;
 }
 
 - (void)_setExperimentalPlugInSandboxProfilesEnabled:(BOOL)enabled
 {
-    _preferences->setExperimentalPlugInSandboxProfilesEnabled(enabled);
 }
 
 - (BOOL)_experimentalPlugInSandboxProfilesEnabled
 {
-    return _preferences->experimentalPlugInSandboxProfilesEnabled();
+    return NO;
 }
 
 - (void)_setCookieEnabled:(BOOL)enabled

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -194,7 +194,6 @@
     bool handlesPageScaleFactor() const final;
     bool requiresUnifiedScaleFactor() const final { return true; }
     void setFocus(bool) final { }
-    NPObject* pluginScriptableNPObject() final { return nullptr; }
     void windowFocusChanged(bool) final { }
     void windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInScreenCoordinates, const WebCore::IntRect& viewFrameInWindowCoordinates) final { }
     void windowVisibilityChanged(bool) final { }
@@ -224,7 +223,6 @@
 
     bool performDictionaryLookupAtLocation(const WebCore::FloatPoint&) final;
     String getSelectionString() const final;
-    String getSelectionForWordAtPoint(const WebCore::FloatPoint&) const final;
     bool existingSelectionContainsPoint(const WebCore::FloatPoint&) const final;
 
     bool shouldAllowScripting() final { return false; }
@@ -436,7 +434,7 @@
 } // namespace WebKit
 
 SPECIALIZE_TYPE_TRAITS_BEGIN(WebKit::PDFPlugin)
-    static bool isType(const WebKit::Plugin& plugin) { return plugin.isPDFPlugin(); }
+    static bool isType(const WebKit::Plugin&) { return true; } // FIXME: Consolidate PDFPlugin and Plugin into one class.
     static bool isType(const WebCore::ScrollableArea& area) { return area.isPDFPlugin(); }
 SPECIALIZE_TYPE_TRAITS_END()
 

Modified: trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm	2021-12-16 01:52:47 UTC (rev 287121)
@@ -633,8 +633,7 @@
 }
 
 inline PDFPlugin::PDFPlugin(WebFrame& frame, HTMLPlugInElement* pluginElement)
-    : Plugin(PDFPluginType)
-    , m_frame(frame)
+    : m_frame(frame)
     , m_containerLayer(adoptNS([[CALayer alloc] init]))
     , m_contentLayer(adoptNS([[CALayer alloc] init]))
     , m_scrollCornerLayer(adoptNS([[WKPDFPluginScrollbarLayer alloc] initWithPDFPlugin:this]))
@@ -2838,14 +2837,6 @@
     return [[m_pdfLayerController currentSelection] string];
 }
 
-String PDFPlugin::getSelectionForWordAtPoint(const WebCore::FloatPoint& point) const
-{
-    IntPoint pointInView = convertFromPluginToPDFView(convertFromRootViewToPlugin(roundedIntPoint(point)));
-    PDFSelection *selectionForWord = [m_pdfLayerController getSelectionForWordAtPoint:pointInView];
-    [m_pdfLayerController setCurrentSelection:selectionForWord];
-    return [selectionForWord string];
-}
-
 bool PDFPlugin::existingSelectionContainsPoint(const WebCore::FloatPoint& locationInViewCoordinates) const
 {
     PDFSelection *currentSelection = [m_pdfLayerController currentSelection];

Modified: trunk/Source/WebKit/WebProcess/Plugins/Plugin.cpp (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/Plugin.cpp	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/Plugin.cpp	2021-12-16 01:52:47 UTC (rev 287121)
@@ -79,11 +79,7 @@
     return true;
 }
 
-Plugin::Plugin(PluginType type)
-    : m_type(type)
-{
-}
-
+Plugin::Plugin() = default;
 Plugin::~Plugin() = default;
 
 bool Plugin::initialize(PluginController& pluginController, const Parameters& parameters)

Modified: trunk/Source/WebKit/WebProcess/Plugins/Plugin.h (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/Plugin.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/Plugin.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -44,8 +44,6 @@
 OBJC_CLASS PDFSelection;
 #endif
 
-struct NPObject;
-
 namespace IPC {
 class Encoder;
 class Decoder;
@@ -73,12 +71,6 @@
     
 class PluginController;
 
-enum PluginType {
-    PluginProxyType,
-    NetscapePluginType,
-    PDFPluginType,
-};
-
 enum class LayerHostingMode : uint8_t;
 
 class Plugin : public ThreadSafeRefCounted<Plugin> {
@@ -109,12 +101,6 @@
 
     virtual ~Plugin();
 
-    PluginType type() const { return m_type; }
-
-    bool isPluginProxy() const { return m_type == PluginProxyType; }
-    bool isNetscapePlugin() const { return m_type == NetscapePluginType; }
-    bool isPDFPlugin() const { return m_type == PDFPluginType; }
-
 private:
     // Initializes the plug-in. If the plug-in fails to initialize this should return false.
     // This is only called by the other initialize overload so it can be made private.
@@ -231,9 +217,6 @@
     // Tells the plug-in about focus changes.
     virtual void setFocus(bool) = 0;
 
-    // Get the NPObject that corresponds to the plug-in's scriptable object. Returns a retained object.
-    virtual NPObject* pluginScriptableNPObject() = 0;
-
     // Tells the plug-in about window focus changes.
     virtual void windowFocusChanged(bool) = 0;
     
@@ -293,7 +276,6 @@
     virtual bool performDictionaryLookupAtLocation(const WebCore::FloatPoint&) = 0;
 
     virtual String getSelectionString() const = 0;
-    virtual String getSelectionForWordAtPoint(const WebCore::FloatPoint&) const = 0;
     virtual bool existingSelectionContainsPoint(const WebCore::FloatPoint&) const = 0;
 
     virtual void mutedStateChanged(bool) { }
@@ -307,10 +289,8 @@
     virtual bool pluginHandlesContentOffsetForAccessibilityHitTest() const { return false; }
 
 protected:
-    Plugin(PluginType);
+    Plugin();
 
-    PluginType m_type;
-
     bool m_isBeingDestroyed { false };
 
 private:

Modified: trunk/Source/WebKit/WebProcess/Plugins/PluginController.h (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/PluginController.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/PluginController.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -28,14 +28,6 @@
 #include <wtf/Forward.h>
 #include <wtf/WeakPtr.h>
 
-struct NPObject;
-typedef struct _NPVariant NPVariant;
-typedef void* NPIdentifier;
-
-namespace WTF {
-class MachSendRight;
-}
-
 namespace WebCore {
 class HTTPHeaderMap;
 class IntRect;
@@ -46,12 +38,6 @@
 
 class PluginController : public CanMakeWeakPtr<PluginController> {
 public:
-    // Tells the controller that the plug-in wants the given rect to be repainted. The rect is in the plug-in's coordinate system.
-    virtual void invalidate(const WebCore::IntRect&) = 0;
-
-    // Returns the user agent string.
-    virtual String userAgent() = 0;
-
     // Loads the given URL and associates it with the request ID.
     // 
     // If a target is specified, then the URL will be loaded in the window or frame that the target refers to.
@@ -62,78 +48,17 @@
     virtual void loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, 
                          const WebCore::HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups) = 0;
 
-    // Continues the load of a stream that was requested by loadURL.
-    virtual void continueStreamLoad(uint64_t streamID) = 0;
-
-    // Cancels the load of a stream that was requested by loadURL.
-    virtual void cancelStreamLoad(uint64_t streamID) = 0;
-
-    // Cancels the load of the manual stream.
-    virtual void cancelManualStreamLoad() = 0;
-
-    // Set the statusbar text.
-    virtual void setStatusbarText(const String&) = 0;
-
-    // Return whether accelerated compositing is enabled.
-    virtual bool isAcceleratedCompositingEnabled() = 0;
-
 #if PLATFORM(COCOA)
     // Tells the controller that the plug-in focus or window focus did change.
     virtual void pluginFocusOrWindowFocusChanged(bool) = 0;
-
-    // Returns the mach port of the compositing render server.
-    virtual const WTF::MachSendRight& compositingRenderServerPort() = 0;
 #endif
 
     // Returns the contents scale factor.
     virtual float contentsScaleFactor() = 0;
 
-    // Get authentication credentials for the given protection space.
-    virtual bool getAuthenticationInfo(const WebCore::ProtectionSpace&, String& username, String& password) = 0;
-
-    // Returns whether private browsing is enabled.
-    virtual bool isPrivateBrowsingEnabled() = 0;
-    
-    // Returns whether or not asynchronous plugin initialization is enabled.
-    virtual bool asynchronousPluginInitializationEnabled() const { return false; }
-    
-    // Returns whether or not asynchronous plugin initialization should be attempted for all plugins.
-    virtual bool asynchronousPluginInitializationEnabledForAllPlugins() const { return false; }
-    
-    // Returns the articifical plugin delay to use for testing of asynchronous plugin initialization.
-    virtual bool artificialPluginInitializationDelayEnabled() const { return false; }
-
-    // Increments a counter that prevents the plug-in from being destroyed.
-    virtual void protectPluginFromDestruction() = 0;
-
-    // Decrements a counter that, when it reaches 0, stops preventing the plug-in from being destroyed.
-    virtual void unprotectPluginFromDestruction() = 0;
-
     // Called when the a plug-in instance is successfully initialized, either synchronously or asynchronously.
     virtual void didInitializePlugin() = 0;
     
-    // Called when the a plug-in instance fails to initialized, either synchronously or asynchronously.
-    virtual void didFailToInitializePlugin() = 0;
-
-    // Helper class for delaying destruction of a plug-in.
-    class PluginDestructionProtector {
-        WTF_MAKE_FAST_ALLOCATED;
-    public:
-        explicit PluginDestructionProtector(PluginController* pluginController)
-            : m_pluginController(pluginController)
-        {
-            m_pluginController->protectPluginFromDestruction();
-        }
-        
-        ~PluginDestructionProtector()
-        {
-            m_pluginController->unprotectPluginFromDestruction();
-        }
-        
-    private:
-        PluginController* m_pluginController;
-    };
-    
 protected:
     virtual ~PluginController() { }
 };

Modified: trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp	2021-12-16 01:52:47 UTC (rev 287121)
@@ -332,21 +332,6 @@
     cancelAllStreams();
 }
 
-void PluginView::recreateAndInitialize(Ref<Plugin>&& plugin)
-{
-    if (m_plugin)
-        destroyPluginAndReset();
-
-    m_plugin = WTFMove(plugin);
-    m_isInitialized = false;
-    m_isWaitingForSynchronousInitialization = false;
-    m_isWaitingUntilMediaCanStart = false;
-    m_manualStreamState = ManualStreamState::Initial;
-    m_transientPaintingSnapshot = nullptr;
-
-    initializePlugin();
-}
-
 void PluginView::setLayerHostingMode(LayerHostingMode layerHostingMode)
 {
 #if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
@@ -569,14 +554,9 @@
 
     m_plugin->initialize(*this, m_parameters);
     
-    // Plug-in initialization continued in didFailToInitializePlugin() or didInitializePlugin().
+    // Plug-in initialization continued in didInitializePlugin().
 }
 
-void PluginView::didFailToInitializePlugin()
-{
-    m_plugin = nullptr;
-}
-
 void PluginView::didInitializePlugin()
 {
     m_isInitialized = true;
@@ -942,14 +922,6 @@
     return m_plugin->performDictionaryLookupAtLocation(point);
 }
 
-String PluginView::getSelectionForWordAtPoint(const WebCore::FloatPoint& point) const
-{
-    if (!m_isInitialized || !m_plugin)
-        return String();
-    
-    return m_plugin->getSelectionForWordAtPoint(point);
-}
-
 bool PluginView::existingSelectionContainsPoint(const WebCore::FloatPoint& point) const
 {
     if (!m_isInitialized || !m_plugin)
@@ -1290,20 +1262,6 @@
 {
 }
 
-void PluginView::invalidate(const IntRect& dirtyRect)
-{
-    invalidateRect(dirtyRect);
-}
-
-String PluginView::userAgent()
-{
-    Frame* frame = m_pluginElement->document().frame();
-    if (!frame)
-        return String();
-    
-    return frame->loader().client().userAgent(URL());
-}
-
 void PluginView::loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups)
 {
     FrameLoadRequest frameLoadRequest { m_pluginElement->document(), m_pluginElement->document().securityOrigin(), { }, target, InitiatedByMainFrame::Unknown };
@@ -1324,59 +1282,6 @@
     m_pendingURLRequestsTimer.startOneShot(0_s);
 }
 
-void PluginView::cancelStreamLoad(uint64_t streamID)
-{
-    // Keep a reference to the stream. Stream::cancel might remove the stream from the map, and thus
-    // releasing its last reference.
-    RefPtr<Stream> stream = m_streams.get(streamID);
-    if (!stream)
-        return;
-
-    // Cancelling the stream here will remove it from the map.
-    stream->cancel();
-    ASSERT(!m_streams.contains(streamID));
-}
-
-void PluginView::continueStreamLoad(uint64_t streamID)
-{
-    RefPtr<Stream> stream = m_streams.get(streamID);
-    if (!stream)
-        return;
-
-    stream->continueLoad();
-}
-
-void PluginView::cancelManualStreamLoad()
-{
-    if (!frame())
-        return;
-
-    DocumentLoader* documentLoader = frame()->loader().activeDocumentLoader();
-    ASSERT(documentLoader);
-    if (documentLoader && documentLoader->isLoadingMainResource())
-        documentLoader->cancelMainResourceLoad(frame()->loader().cancelledError(m_parameters.url));
-}
-
-void PluginView::setStatusbarText(const String& statusbarText)
-{
-    if (!frame())
-        return;
-    
-    Page* page = frame()->page();
-    if (!page)
-        return;
-
-    page->chrome().setStatusbarText(*frame(), statusbarText);
-}
-
-bool PluginView::isAcceleratedCompositingEnabled()
-{
-    if (!frame())
-        return false;
-    
-    return frame()->settings().acceleratedCompositingEnabled();
-}
-
 #if PLATFORM(COCOA)
 void PluginView::pluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus)
 {
@@ -1383,12 +1288,6 @@
     if (m_webPage)
         m_webPage->send(Messages::WebPageProxy::PluginFocusOrWindowFocusChanged(m_plugin->pluginComplexTextInputIdentifier(), pluginHasFocusAndWindowHasFocus));
 }
-
-const MachSendRight& PluginView::compositingRenderServerPort()
-{
-    return WebProcess::singleton().compositingRenderServerPort();
-}
-
 #endif
 
 float PluginView::contentsScaleFactor()
@@ -1399,74 +1298,6 @@
     return 1;
 }
 
-bool PluginView::getAuthenticationInfo(const ProtectionSpace& protectionSpace, String& username, String& password)
-{
-    auto* contentDocument = m_pluginElement->contentDocument();
-    if (!contentDocument)
-        return false;
-
-    auto credential = CredentialStorage::getFromPersistentStorage(protectionSpace);
-    if (!credential.hasPassword())
-        return false;
-
-    username = credential.user();
-    password = credential.password();
-
-    return true;
-}
-
-bool PluginView::isPrivateBrowsingEnabled()
-{
-    // If we can't get the real setting, we'll assume that private browsing is enabled.
-    if (!frame())
-        return true;
-
-    if (!frame()->document()->securityOrigin().canAccessPluginStorage(frame()->document()->topOrigin()))
-        return true;
-
-    return frame()->page()->usesEphemeralSession();
-}
-
-bool PluginView::asynchronousPluginInitializationEnabled() const
-{
-    return m_webPage->asynchronousPluginInitializationEnabled();
-}
-
-bool PluginView::asynchronousPluginInitializationEnabledForAllPlugins() const
-{
-    return m_webPage->asynchronousPluginInitializationEnabledForAllPlugins();
-}
-
-bool PluginView::artificialPluginInitializationDelayEnabled() const
-{
-    return m_webPage->artificialPluginInitializationDelayEnabled();
-}
-
-void PluginView::protectPluginFromDestruction()
-{
-    if (m_plugin && !m_plugin->isBeingDestroyed())
-        ref();
-}
-
-void PluginView::unprotectPluginFromDestruction()
-{
-    if (!m_plugin || m_plugin->isBeingDestroyed())
-        return;
-
-    // A plug-in may ask us to evaluate _javascript_ that removes the plug-in from the
-    // page, but expect the object to still be alive when the call completes. Flash,
-    // for example, may crash if the plug-in is destroyed and we return to code for
-    // the destroyed object higher on the stack. To prevent this, if the plug-in has
-    // only one remaining reference, call deref() asynchronously.
-    if (hasOneRef()) {
-        RunLoop::main().dispatch([lastRef = adoptRef(*this)] {
-        });
-        return;
-    }
-
-    deref();
-}
-
 void PluginView::didFinishLoad(WebFrame* webFrame)
 {
     RefPtr<URLRequest> request = m_pendingFrameLoads.take(webFrame);

Modified: trunk/Source/WebKit/WebProcess/Plugins/PluginView.h (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/Plugins/PluginView.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/Plugins/PluginView.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -68,8 +68,6 @@
 public:
     static Ref<PluginView> create(WebCore::HTMLPlugInElement&, Ref<Plugin>&&, const Plugin::Parameters&);
 
-    void recreateAndInitialize(Ref<Plugin>&&);
-
     WebCore::Frame* frame() const;
 
     bool isBeingDestroyed() const { return !m_plugin || m_plugin->isBeingDestroyed(); }
@@ -118,7 +116,6 @@
 
     RefPtr<WebCore::FragmentedSharedBuffer> liveResourceData() const;
     bool performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
-    String getSelectionForWordAtPoint(const WebCore::FloatPoint&) const;
     bool existingSelectionContainsPoint(const WebCore::FloatPoint&) const;
 
 private:
@@ -190,29 +187,13 @@
     void pageMutedStateDidChange() override;
 
     // PluginController
-    void invalidate(const WebCore::IntRect&) override;
-    String userAgent() override;
     void loadURL(uint64_t requestID, const String& method, const String& urlString, const String& target, const WebCore::HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups) override;
-    void cancelStreamLoad(uint64_t streamID) override;
-    void continueStreamLoad(uint64_t streamID) override;
-    void cancelManualStreamLoad() override;
-    void setStatusbarText(const String&) override;
-    bool isAcceleratedCompositingEnabled() override;
 #if PLATFORM(COCOA)
     void pluginFocusOrWindowFocusChanged(bool pluginHasFocusAndWindowHasFocus) override;
-    const WTF::MachSendRight& compositingRenderServerPort() override;
 #endif
     float contentsScaleFactor() override;
-    bool getAuthenticationInfo(const WebCore::ProtectionSpace&, String& username, String& password) override;
-    bool isPrivateBrowsingEnabled() override;
-    bool asynchronousPluginInitializationEnabled() const override;
-    bool asynchronousPluginInitializationEnabledForAllPlugins() const override;
-    bool artificialPluginInitializationDelayEnabled() const override;
-    void protectPluginFromDestruction() override;
-    void unprotectPluginFromDestruction() override;
 
     void didInitializePlugin() override;
-    void didFailToInitializePlugin() override;
     void destroyPluginAndReset();
 
     // WebFrame::LoadListener

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2021-12-16 01:52:47 UTC (rev 287121)
@@ -3978,9 +3978,6 @@
     DatabaseManager::singleton().setIsAvailable(store.getBoolValueForKey(WebPreferencesKey::databasesEnabledKey()));
 
     m_tabToLinks = store.getBoolValueForKey(WebPreferencesKey::tabsToLinksKey());
-    m_asynchronousPluginInitializationEnabled = store.getBoolValueForKey(WebPreferencesKey::asynchronousPluginInitializationEnabledKey());
-    m_asynchronousPluginInitializationEnabledForAllPlugins = store.getBoolValueForKey(WebPreferencesKey::asynchronousPluginInitializationEnabledForAllPluginsKey());
-    m_artificialPluginInitializationDelayEnabled = store.getBoolValueForKey(WebPreferencesKey::artificialPluginInitializationDelayEnabledKey());
 
     bool isAppNapEnabled = store.getBoolValueForKey(WebPreferencesKey::pageVisibilityBasedProcessSuppressionEnabledKey());
     if (m_isAppNapEnabled != isAppNapEnabled) {

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (287120 => 287121)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2021-12-16 01:18:05 UTC (rev 287120)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2021-12-16 01:52:47 UTC (rev 287121)
@@ -1131,13 +1131,6 @@
 
     bool shouldUseCustomContentProviderForResponse(const WebCore::ResourceResponse&);
 
-    bool asynchronousPluginInitializationEnabled() const { return m_asynchronousPluginInitializationEnabled; }
-    void setAsynchronousPluginInitializationEnabled(bool enabled) { m_asynchronousPluginInitializationEnabled = enabled; }
-    bool asynchronousPluginInitializationEnabledForAllPlugins() const { return m_asynchronousPluginInitializationEnabledForAllPlugins; }
-    void setAsynchronousPluginInitializationEnabledForAllPlugins(bool enabled) { m_asynchronousPluginInitializationEnabledForAllPlugins = enabled; }
-    bool artificialPluginInitializationDelayEnabled() const { return m_artificialPluginInitializationDelayEnabled; }
-    void setArtificialPluginInitializationDelayEnabled(bool enabled) { m_artificialPluginInitializationDelayEnabled = enabled; }
-
 #if PLATFORM(COCOA)
     bool pdfPluginEnabled() const { return m_pdfPluginEnabled; }
     void setPDFPluginEnabled(bool enabled) { m_pdfPluginEnabled = enabled; }
@@ -1981,9 +1974,6 @@
     bool m_isClosed { false };
     bool m_tabToLinks { false };
     
-    bool m_asynchronousPluginInitializationEnabled { false };
-    bool m_asynchronousPluginInitializationEnabledForAllPlugins { false };
-    bool m_artificialPluginInitializationDelayEnabled { false };
     bool m_mainFrameIsScrollable { true };
 
     bool m_alwaysShowsHorizontalScroller { false };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to