Guard Netscape plug-in code with ENABLE(NETSCAPE_PLUGIN_API)
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2012 03:55:58 +0000 (03:55 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 May 2012 03:55:58 +0000 (03:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86496

Reviewed by Sam Weinig.

Ensure that WebKit2 can compile with ENABLE_NETSCAPE_PLUGIN_API disabled.

* Shared/Plugins/Netscape/NetscapePluginModule.cpp:
* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
* Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
* Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
* UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
(WebKit::PluginInfoStore::getPluginInfo):
* WebProcess/Plugins/Netscape/JSNPMethod.cpp:
* WebProcess/Plugins/Netscape/JSNPMethod.h:
* WebProcess/Plugins/Netscape/JSNPObject.cpp:
* WebProcess/Plugins/Netscape/JSNPObject.h:
* WebProcess/Plugins/Netscape/NPJSObject.cpp:
* WebProcess/Plugins/Netscape/NPJSObject.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
* WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp:
* WebProcess/Plugins/Netscape/NPRuntimeUtilities.h:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue):
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
* WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.h:
* WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm:
* WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
* WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp:
* WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
* WebProcess/Plugins/PluginController.h:
(PluginController):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::Stream::didFinishLoading):
(WebKit::PluginView::PluginView):
(WebKit::PluginView::~PluginView):
(WebKit::PluginView::scriptObject):
(WebKit):
* WebProcess/Plugins/PluginView.h:
(PluginView):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getSitesWithPluginData):
(WebKit::WebProcess::clearPluginSiteData):

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

35 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.cpp
Source/WebKit2/Shared/Plugins/Netscape/NetscapePluginModule.h
Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
Source/WebKit2/Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp
Source/WebKit2/Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp
Source/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.h
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/JSNPObject.h
Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.h
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NPRuntimeUtilities.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginStream.h
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.h
Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm
Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm
Source/WebKit2/WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
Source/WebKit2/WebProcess/Plugins/PluginController.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/Plugins/PluginView.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp

index 4d03069..8624d45 100644 (file)
@@ -1,3 +1,59 @@
+2012-05-15  Andy Estes  <aestes@apple.com>
+
+        Guard Netscape plug-in code with ENABLE(NETSCAPE_PLUGIN_API)
+        https://bugs.webkit.org/show_bug.cgi?id=86496
+
+        Reviewed by Sam Weinig.
+
+        Ensure that WebKit2 can compile with ENABLE_NETSCAPE_PLUGIN_API disabled.
+
+        * Shared/Plugins/Netscape/NetscapePluginModule.cpp:
+        * Shared/Plugins/Netscape/NetscapePluginModule.h:
+        * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
+        * Shared/Plugins/Netscape/win/NetscapePluginModuleWin.cpp:
+        * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
+        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+        (WebKit::PluginInfoStore::getPluginInfo):
+        * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
+        * WebProcess/Plugins/Netscape/JSNPMethod.h:
+        * WebProcess/Plugins/Netscape/JSNPObject.cpp:
+        * WebProcess/Plugins/Netscape/JSNPObject.h:
+        * WebProcess/Plugins/Netscape/NPJSObject.cpp:
+        * WebProcess/Plugins/Netscape/NPJSObject.h:
+        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
+        * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
+        * WebProcess/Plugins/Netscape/NPRuntimeUtilities.cpp:
+        * WebProcess/Plugins/Netscape/NPRuntimeUtilities.h:
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
+        (WebKit::NPN_GetValue):
+        * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
+        * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        * WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.h:
+        * WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm:
+        * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
+        * WebProcess/Plugins/Netscape/qt/PluginProxyQt.cpp:
+        * WebProcess/Plugins/Netscape/win/NetscapePluginWin.cpp:
+        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
+        * WebProcess/Plugins/PluginController.h:
+        (PluginController):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::Stream::didFinishLoading):
+        (WebKit::PluginView::PluginView):
+        (WebKit::PluginView::~PluginView):
+        (WebKit::PluginView::scriptObject):
+        (WebKit):
+        * WebProcess/Plugins/PluginView.h:
+        (PluginView):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::createPlugin):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::getSitesWithPluginData):
+        (WebKit::WebProcess::clearPluginSiteData):
+
 2012-05-15  Michael BrĂ¼ning  <michael.bruning@nokia.com>
 
         [Qt][WK2] http/tests/security/xss-DENIED-xsl-document-securityOrigin.xml crashes
index c1874d9..4a24225 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetscapePluginModule.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "Module.h"
 #include "NPRuntimeUtilities.h"
 #include "NetscapeBrowserFuncs.h"
@@ -269,3 +271,4 @@ void NetscapePluginModule::unload()
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index e96bd2d..f11eae3 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetscapePluginModule_h
 #define NetscapePluginModule_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "Module.h"
 #include "PluginModuleInfo.h"
 #include "PluginQuirks.h"
@@ -99,4 +101,6 @@ private:
     
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // NetscapePluginModule_h
index ae247a1..439de79 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "NetscapePluginModule.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #import "PluginProcessProxy.h"
 #import <WebCore/WebCoreNSStringExtras.h>
 #import <wtf/HashSet.h>
@@ -526,3 +528,5 @@ void NetscapePluginModule::determineQuirks()
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 36cbce2..bffdde2 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetscapePluginModule.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <WebCore/FileSystem.h>
 #include <wtf/OwnArrayPtr.h>
 
@@ -139,3 +141,4 @@ void NetscapePluginModule::determineQuirks()
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index ea59e3d..f92fb0b 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "config.h"
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #include "NetscapePluginModule.h"
 
@@ -225,4 +225,4 @@ bool NetscapePluginModule::scanPlugin(const String& pluginPath)
 
 } // namespace WebKit
 
-#endif // PLUGIN_ARCHITECTURE(X11)
+#endif // PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
index 7a04b53..8688cfa 100644 (file)
@@ -73,7 +73,13 @@ Vector<String> PluginInfoStore::individualPluginPaths()
 
 bool PluginInfoStore::getPluginInfo(const String& pluginPath, PluginModuleInfo& plugin)
 {
+#if ENABLE(NETSCAPE_PLUGIN_API)
     return NetscapePluginModule::getPluginInfo(pluginPath, plugin);
+#else
+    UNUSED_PARAM(pluginPath);
+    UNUSED_PARAM(plugin);
+    return false;
+#endif
 }
 
 bool PluginInfoStore::shouldUsePlugin(Vector<PluginModuleInfo>& alreadyLoadedPlugins, const PluginModuleInfo& plugin)
index 2e6d118..edf42e4 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "JSNPMethod.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "JSNPObject.h"
 #include <JavaScriptCore/Error.h>
 #include <JavaScriptCore/FunctionPrototype.h>
@@ -86,3 +88,5 @@ CallType JSNPMethod::getCallData(JSCell*, CallData& callData)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index a622389..3cb33fc 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef JSNPMethod_h
 #define JSNPMethod_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <JavaScriptCore/FunctionPrototype.h>
 #include <JavaScriptCore/InternalFunction.h>
 #include <JavaScriptCore/JSGlobalObject.h>
@@ -70,4 +72,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // JSNPMethod_h
index 825ba94..5c64527 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "JSNPObject.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "JSNPMethod.h"
 #include "NPJSObject.h"
 #include "NPRuntimeObjectMap.h"
@@ -490,3 +492,5 @@ JSObject* JSNPObject::throwInvalidAccessError(ExecState* exec)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index f8ae98e..5723baa 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef JSNPObject_h
 #define JSNPObject_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <JavaScriptCore/JSGlobalObject.h>
 #include <JavaScriptCore/JSObject.h>
 #include <JavaScriptCore/ObjectPrototype.h>
@@ -104,4 +106,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // JSNPObject_h
index 802c2df..4cea7e5 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NPJSObject.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "JSNPObject.h"
 #include "NPRuntimeObjectMap.h"
 #include "NPRuntimeUtilities.h"
@@ -381,3 +383,5 @@ bool NPJSObject::NP_Construct(NPObject* npObject, const NPVariant* arguments, ui
 }
     
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index f0ee07a..9dc0824 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NPJSObject_h
 #define NPJSObject_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <JavaScriptCore/Strong.h>
 #include <WebCore/npruntime_internal.h>
 #include <wtf/Noncopyable.h>
@@ -95,4 +97,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // NPJSObject_h
index 2efa0b8..c883e3c 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NPRuntimeObjectMap.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "JSNPObject.h"
 #include "NPJSObject.h"
 #include "NPRuntimeUtilities.h"
@@ -301,3 +303,5 @@ void NPRuntimeObjectMap::finalize(JSC::Handle<JSC::Unknown> handle, void* contex
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index deffd54..d9c002e 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NPJSObjectWrapperMap_h
 #define NPJSObjectWrapperMap_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <WebCore/RunLoop.h>
 #include <heap/Weak.h>
 #include <wtf/Forward.h>
@@ -101,4 +103,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // NPJSObjectWrapperMap_h
index 71bf90b..2cb507b 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NPRuntimeUtilities.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <wtf/text/CString.h>
 
 namespace WebKit {
@@ -150,3 +152,5 @@ void releaseNPVariantValue(NPVariant* variant)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 2f135b2..4775d62 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NPRuntimeUtilities_h
 #define NPRuntimeUtilities_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <WebCore/npruntime_internal.h>
 #include <wtf/Forward.h>
 
@@ -67,4 +69,6 @@ void releaseNPVariantValue(NPVariant*);
 
 }
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // NPRuntimeUtilities_h
index fcd31f1..759765d 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetscapeBrowserFuncs.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "NPRuntimeUtilities.h"
 #include "NetscapePlugin.h"
 #include "PluginController.h"
@@ -505,7 +507,7 @@ static NPError NPN_GetValue(NPP npp, NPNVariable variable, void *value)
             *(NPBool*)value = true;
             break;
 
-#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD) && ENABLE(PLUGIN_PROCESS)
         case WKNVSandboxFunctions:
         {
             *(WKNSandboxFunctions **)value = netscapeSandboxFunctions();
@@ -1060,3 +1062,5 @@ NPNetscapeFuncs* netscapeBrowserFuncs()
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 583df97..37e61da 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetscapeBrowserFuncs_h
 #define NetscapeBrowserFuncs_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <WebCore/npfunctions.h>
 
 namespace WebKit {
@@ -37,5 +39,6 @@ NPNetscapeFuncs* netscapeBrowserFuncs();
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
 
 #endif // NetscapeBrowserFuncs_h
index adc632d..d191980 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetscapePlugin.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "NPRuntimeObjectMap.h"
 #include "NPRuntimeUtilities.h"
 #include "NetscapePluginStream.h"
@@ -970,3 +972,5 @@ bool NetscapePlugin::convertFromRootView(const IntPoint& pointInRootViewCoordina
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 7bba977..9194984 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetscapePlugin_h
 #define NetscapePlugin_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "NetscapePluginModule.h"
 #include "Plugin.h"
 #include <WebCore/AffineTransform.h>
@@ -360,4 +362,6 @@ public: // Need to call it in the NPN_GetValue browser callback.
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // NetscapePlugin_h
index 5e496e3..65ab2e5 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetscapePluginStream.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "NetscapePlugin.h"
 #include <utility>
 #include <wtf/PassOwnPtr.h>
@@ -361,3 +363,5 @@ void NetscapePluginStream::notifyAndDestroyStream(NPReason reason)
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 05873e4..b95b235 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetscapePluginStream_h
 #define NetscapePluginStream_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include <WebCore/FileSystem.h>
 #include <WebCore/RunLoop.h>
 #include <WebCore/npruntime_internal.h>
@@ -110,4 +112,6 @@ private:
 
 } // namespace WebKit
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
+
 #endif // NetscapePluginStream_h
index d011345..f1fa2f6 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "NetscapePlugin.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #import "NetscapeBrowserFuncs.h"
 #import "PluginController.h"
 #import "WebEvent.h"
@@ -1106,3 +1108,5 @@ void NetscapePlugin::nullEventTimerFired()
 #endif
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 4c77981..d589243 100644 (file)
@@ -26,6 +26,8 @@
 #ifndef NetscapeSandboxFunctions_h
 #define NetscapeSandboxFunctions_h
 
+#if ENABLE(NETSCAPE_PLUGIN_API) && ENABLE(PLUGIN_PROCESS)
+
 #include <WebCore/npapi.h>
 
 #ifdef __cplusplus
@@ -55,4 +57,6 @@ WKNSandboxFunctions* netscapeSandboxFunctions();
 }
 #endif
 
+#endif // ENABLE(NETSCAPE_PLUGIN_API) && ENABLE(PLUGIN_PROCESS)
+
 #endif
index f2386c4..775e3ca 100644 (file)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "NetscapeSandboxFunctions.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API) && ENABLE(PLUGIN_PROCESS)
+
 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
 
 #import "PluginProcess.h"
@@ -188,4 +190,6 @@ NPError WKN_FileStopAccessing(const char* path)
     return NPERR_NO_ERROR;
 }
 
-#endif
+#endif // !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API) && ENABLE(PLUGIN_PROCESS)
index 8448612..4160656 100644 (file)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "PluginProxy.h"
 
-#if ENABLE(PLUGIN_PROCESS)
+#if ENABLE(PLUGIN_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #import "PluginController.h"
 #import "PluginControllerProxyMessages.h"
@@ -88,4 +88,4 @@ void PluginProxy::setLayerHostingContextID(uint32_t layerHostingContextID)
 
 } // namespace WebKit
 
-#endif // ENABLE(PLUGIN_PROCESS)
+#endif // ENABLE(PLUGIN_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
index 7af1784..f140a9c 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "PluginProxy.h"
 
-#if ENABLE(PLUGIN_PROCESS)
+#if ENABLE(PLUGIN_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #include <WebCore/NotImplemented.h>
 
@@ -40,4 +40,4 @@ bool PluginProxy::needsBackingStore() const
 
 } // namespace WebKit
 
-#endif // ENABLE(PLUGIN_PROCESS)
+#endif // ENABLE(PLUGIN_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
index b14f31d..9d0deb2 100644 (file)
@@ -26,6 +26,8 @@
 #include "config.h"
 #include "NetscapePlugin.h"
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
+
 #include "PluginController.h"
 #include "WebEvent.h"
 #include "WindowGeometry.h"
@@ -396,3 +398,5 @@ BOOL NetscapePlugin::hookedTrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y
 }
 
 } // namespace WebKit
+
+#endif // ENABLE(NETSCAPE_PLUGIN_API)
index 6564fd1..da2478d 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "config.h"
-#if PLUGIN_ARCHITECTURE(X11)
+#if PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
 
 #include "NetscapePlugin.h"
 
@@ -622,4 +622,4 @@ bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& event)
 
 } // namespace WebKit
 
-#endif // PLUGIN_ARCHITECTURE(X11)
+#endif // PLUGIN_ARCHITECTURE(X11) && ENABLE(NETSCAPE_PLUGIN_API)
index 25032cc..42c2959 100644 (file)
@@ -76,6 +76,7 @@ public:
     // Cancels the load of the manual stream.
     virtual void cancelManualStreamLoad() = 0;
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     // Get the NPObject that corresponds to the window JavaScript object. Returns a retained object.
     virtual NPObject* windowScriptNPObject() = 0;
 
@@ -84,6 +85,7 @@ public:
 
     // Evaluates the given script string in the context of the given NPObject.
     virtual bool evaluate(NPObject*, const String& scriptString, NPVariant* result, bool allowPopups) = 0;
+#endif
 
     // Set the statusbar text.
     virtual void setStatusbarText(const String&) = 0;
index 03dd60f..de17915 100644 (file)
@@ -227,8 +227,10 @@ void PluginView::Stream::didFinishLoading(NetscapePlugInStreamLoader*)
     // Calling streamDidFinishLoading could cause us to be deleted, so we hold on to a reference here.
     RefPtr<Stream> protectStream(this);
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     // Protect the plug-in while we're calling into it.
     NPRuntimeObjectMap::PluginProtector pluginProtector(&m_pluginView->m_npRuntimeObjectMap);
+#endif
     m_pluginView->m_plugin->streamDidFinishLoading(m_streamID);
 
     m_pluginView->removeStream(this);
@@ -261,7 +263,9 @@ PluginView::PluginView(PassRefPtr<HTMLPlugInElement> pluginElement, PassRefPtr<P
     , m_isWaitingUntilMediaCanStart(false)
     , m_isBeingDestroyed(false)
     , m_pendingURLRequestsTimer(RunLoop::main(), this, &PluginView::pendingURLRequestsTimerFired)
+#if ENABLE(NETSCAPE_PLUGIN_API)
     , m_npRuntimeObjectMap(this)
+#endif
     , m_manualStreamState(StreamStateInitial)
 {
 #if PLATFORM(MAC)
@@ -293,8 +297,10 @@ PluginView::~PluginView()
 #endif
     }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     // Invalidate the object map.
     m_npRuntimeObjectMap.invalidate();
+#endif
 
     cancelAllStreams();
 
@@ -529,6 +535,7 @@ JSObject* PluginView::scriptObject(JSGlobalObject* globalObject)
     if (!m_isInitialized || !m_plugin)
         return 0;
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     NPObject* scriptableNPObject = m_plugin->pluginScriptableNPObject();
     if (!scriptableNPObject)
         return 0;
@@ -537,6 +544,10 @@ JSObject* PluginView::scriptObject(JSGlobalObject* globalObject)
     releaseNPObject(scriptableNPObject);
 
     return jsObject;
+#else
+    UNUSED_PARAM(globalObject);
+    return 0;
+#endif
 }
 
 void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
@@ -1054,6 +1065,7 @@ void PluginView::cancelManualStreamLoad()
         documentLoader->cancelMainResourceLoad(frame()->loader()->cancelledError(m_parameters.url));
 }
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
 NPObject* PluginView::windowScriptNPObject()
 {
     if (!frame())
@@ -1090,6 +1102,7 @@ bool PluginView::evaluate(NPObject* npObject, const String& scriptString, NPVari
     UserGestureIndicator gestureIndicator(allowPopups ? DefinitelyProcessingUserGesture : PossiblyProcessingUserGesture);
     return m_npRuntimeObjectMap.evaluate(npObject, scriptString, result);
 }
+#endif
 
 void PluginView::setStatusbarText(const String& statusbarText)
 {
index d5cb257..547109b 100644 (file)
@@ -137,9 +137,11 @@ private:
                          const WebCore::HTTPHeaderMap& headerFields, const Vector<uint8_t>& httpBody, bool allowPopups);
     virtual void cancelStreamLoad(uint64_t streamID);
     virtual void cancelManualStreamLoad();
+#if ENABLE(NETSCAPE_PLUGIN_API)
     virtual NPObject* windowScriptNPObject();
     virtual NPObject* pluginElementNPObject();
     virtual bool evaluate(NPObject*, const String&scriptString, NPVariant* result, bool allowPopups);
+#endif
     virtual void setStatusbarText(const String&);
     virtual bool isAcceleratedCompositingEnabled();
     virtual void pluginProcessCrashed();
@@ -190,8 +192,10 @@ private:
     // Streams that the plug-in has requested to load. 
     HashMap<uint64_t, RefPtr<Stream> > m_streams;
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     // A map of all related NPObjects for this plug-in view.
     NPRuntimeObjectMap m_npRuntimeObjectMap;
+#endif
 
     // The manual stream state. This is used so we can deliver a manual stream to a plug-in
     // when it is initialized.
index c4c48f7..91401a5 100644 (file)
@@ -418,9 +418,11 @@ PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* plu
 
 #if ENABLE(PLUGIN_PROCESS)
     return PluginProxy::create(pluginPath);
-#else
+#elif ENABLE(NETSCAPE_PLUGIN_API)
     NetscapePlugin::setSetExceptionFunction(NPRuntimeObjectMap::setGlobalException);
     return NetscapePlugin::create(NetscapePluginModule::getOrCreate(pluginPath));
+#else
+    return 0;
 #endif
 }
 
index f292334..4a8608a 100644 (file)
@@ -810,6 +810,7 @@ void WebProcess::getSitesWithPluginData(const Vector<String>& pluginPaths, uint6
 
     HashSet<String> sitesSet;
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     for (size_t i = 0; i < pluginPaths.size(); ++i) {
         RefPtr<NetscapePluginModule> netscapePluginModule = NetscapePluginModule::getOrCreate(pluginPaths[i]);
         if (!netscapePluginModule)
@@ -819,6 +820,7 @@ void WebProcess::getSitesWithPluginData(const Vector<String>& pluginPaths, uint6
         for (size_t i = 0; i < sites.size(); ++i)
             sitesSet.add(sites[i]);
     }
+#endif
 
     Vector<String> sites;
     copyToVector(sitesSet, sites);
@@ -830,6 +832,7 @@ void WebProcess::clearPluginSiteData(const Vector<String>& pluginPaths, const Ve
 {
     LocalTerminationDisabler terminationDisabler(*this);
 
+#if ENABLE(NETSCAPE_PLUGIN_API)
     for (size_t i = 0; i < pluginPaths.size(); ++i) {
         RefPtr<NetscapePluginModule> netscapePluginModule = NetscapePluginModule::getOrCreate(pluginPaths[i]);
         if (!netscapePluginModule)
@@ -844,6 +847,7 @@ void WebProcess::clearPluginSiteData(const Vector<String>& pluginPaths, const Ve
         for (size_t i = 0; i < sites.size(); ++i)
             netscapePluginModule->clearSiteData(sites[i], flags, maxAgeInSeconds);
     }
+#endif
 
     connection()->send(Messages::WebContext::DidClearPluginSiteData(callbackID), 0);
 }