Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
<http://webkit.org/b/44285> Fix compilation with NETSCAPE_PLUGIN_API …
…disabled

Reviewed by Joseph Pecoraro.

WebCore:

* WebCore.exp.in:
(WebCore::HTMLPlugInElement::getNPObject): Moved from general
section into ENABLE(NETSCAPE_PLUGIN_API) section.
(WebCore::FrameView::windowClipRectForLayer): Moved from
ENABLE(NETSCAPE_PLUGIN_API) section to general section since
it's used by WebKit2.
* plugins/PluginView.h: Added #if ENABLE(NETSCAPE_PLUGIN_API)
and #endif macros as needed to make iOS WebKit build with
NETSCAPE_PLUGIN_API disabled.
* plugins/PluginViewNone.cpp: Ditto.
(WebCore::PluginView::platformGetValueStatic):

WebKit/mac:

* Plugins/Hosted/HostedNetscapePluginStream.mm: Changed
USE(PLUGIN_HOST_PROCESS) to
USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API).
* Plugins/Hosted/NetscapePluginHostManager.mm: Ditto.
* Plugins/Hosted/NetscapePluginHostProxy.mm: Ditto.
* Plugins/Hosted/NetscapePluginInstanceProxy.mm: Ditto.
* Plugins/Hosted/ProxyInstance.mm: Ditto.
* Plugins/Hosted/WebHostedNetscapePluginView.mm: Ditto.
* WebCoreSupport/WebChromeClient.mm: Ditto.
(WebChromeClient::createWindow):
* WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
(WebFrameLoaderClient::dispatchCreatePage):
* WebView/WebHTMLView.mm:
(needsCursorRectsSupportAtPoint): Added #if
ENABLE(NETSCAPE_PLUGIN_API) and #endif macros as needed.
* WebView/WebView.mm:
(+[WebView _isNodeHaltedPlugin:]): Ditto.
(+[WebView _hasPluginForNodeBeenHalted:]): Ditto.
(+[WebView _restartHaltedPluginForNode:]): Ditto.

Canonical link: https://commits.webkit.org/56477@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@65697 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
ddkilzer committed Aug 19, 2010
1 parent 9228ecc commit 9fa6f25
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 26 deletions.
18 changes: 18 additions & 0 deletions WebCore/ChangeLog
@@ -1,3 +1,21 @@
2010-08-19 David Kilzer <ddkilzer@apple.com>

<http://webkit.org/b/44285> Fix compilation with NETSCAPE_PLUGIN_API disabled

Reviewed by Joseph Pecoraro.

* WebCore.exp.in:
(WebCore::HTMLPlugInElement::getNPObject): Moved from general
section into ENABLE(NETSCAPE_PLUGIN_API) section.
(WebCore::FrameView::windowClipRectForLayer): Moved from
ENABLE(NETSCAPE_PLUGIN_API) section to general section since
it's used by WebKit2.
* plugins/PluginView.h: Added #if ENABLE(NETSCAPE_PLUGIN_API)
and #endif macros as needed to make iOS WebKit build with
NETSCAPE_PLUGIN_API disabled.
* plugins/PluginViewNone.cpp: Ditto.
(WebCore::PluginView::platformGetValueStatic):

2010-08-17 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.
Expand Down
4 changes: 2 additions & 2 deletions WebCore/WebCore.exp.in
Expand Up @@ -404,7 +404,6 @@ __ZN7WebCore17DOMImplementation14isTextMIMETypeERKN3WTF6StringE
__ZN7WebCore16DeviceMotionData6createEbdbdbdbdbdbdbd
__ZN7WebCore17DeviceOrientation6createEbdbdbd
__ZN7WebCore17GlyphPageTreeNode18treeGlyphPageCountEv
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
__ZN7WebCore17HistoryController26saveDocumentAndScrollStateEv
__ZN7WebCore17nameForCursorTypeENS_6Cursor4TypeE
__ZN7WebCore17openTemporaryFileEPKcRi
Expand Down Expand Up @@ -1058,6 +1057,7 @@ __ZNK7WebCore9FrameTree6parentEb
__ZNK7WebCore9FrameView11needsLayoutEv
__ZNK7WebCore9FrameView13paintBehaviorEv
__ZNK7WebCore9FrameView20isSoftwareRenderableEv
__ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
__ZNK7WebCore9FrameView28isEnclosedInCompositingLayerEv
__ZNK7WebCore9PageCache10frameCountEv
__ZNK7WebCore9PageCache21autoreleasedPageCountEv
Expand Down Expand Up @@ -1250,11 +1250,11 @@ __NPN_SetProperty
__NPN_UTF8FromIdentifier
__ZN7WebCore16ScriptController20windowScriptNPObjectEv
__ZN7WebCore16ScriptController29cleanupScriptObjectsForPluginEPv
__ZN7WebCore17HTMLPlugInElement11getNPObjectEv
__ZNK7WebCore12RenderObject4viewEv
__ZNK7WebCore14SecurityOrigin9canAccessEPKS0_
__ZNK7WebCore4KURL7hasPathEv
__ZNK7WebCore4KURL9prettyURLEv
__ZNK7WebCore9FrameView22windowClipRectForLayerEPKNS_11RenderLayerEb
#endif

#if ENABLE(ORIENTATION_EVENTS)
Expand Down
29 changes: 25 additions & 4 deletions WebCore/plugins/PluginView.h
Expand Up @@ -32,11 +32,9 @@
#include "HaltablePlugin.h"
#include "IntRect.h"
#include "MediaCanStartListener.h"
#include "PluginStream.h"
#include "ResourceRequest.h"
#include "Timer.h"
#include "Widget.h"
#include "npruntime_internal.h"
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
#include <wtf/OwnPtr.h>
Expand All @@ -45,6 +43,11 @@
#include <wtf/Vector.h>
#include <wtf/text/CString.h>

#if ENABLE(NETSCAPE_PLUGIN_API)
#include "PluginStream.h"
#include "npruntime_internal.h"
#endif

#if OS(WINDOWS) && (PLATFORM(QT) || PLATFORM(WX))
typedef struct HWND__* HWND;
typedef HWND PlatformPluginWidget;
Expand Down Expand Up @@ -117,13 +120,21 @@ namespace WebCore {
virtual void didFail(const ResourceError&) = 0;
};

class PluginView : public Widget, private PluginStreamClient, public PluginManualLoader, private HaltablePlugin, private MediaCanStartListener {
class PluginView : public Widget
#if ENABLE(NETSCAPE_PLUGIN_API)
, private PluginStreamClient
#endif
, public PluginManualLoader
, private HaltablePlugin
, private MediaCanStartListener {
public:
static PassRefPtr<PluginView> create(Frame* parentFrame, const IntSize&, Element*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually);
virtual ~PluginView();

PluginPackage* plugin() const { return m_plugin.get(); }
#if ENABLE(NETSCAPE_PLUGIN_API)
NPP instance() const { return m_instance; }
#endif

void setNPWindowRect(const IntRect&);
static PluginView* currentPluginView();
Expand All @@ -134,6 +145,7 @@ namespace WebCore {

PluginStatus status() const { return m_status; }

#if ENABLE(NETSCAPE_PLUGIN_API)
// NPN functions
NPError getURLNotify(const char* url, const char* target, void* notifyData);
NPError getURL(const char* url, const char* target);
Expand All @@ -142,6 +154,7 @@ namespace WebCore {
NPError newStream(NPMIMEType type, const char* target, NPStream** stream);
int32_t write(NPStream* stream, int32_t len, void* buffer);
NPError destroyStream(NPStream* stream, NPReason reason);
#endif
const char* userAgent();
#if ENABLE(NETSCAPE_PLUGIN_API)
static const char* userAgentStatic();
Expand All @@ -151,10 +164,10 @@ namespace WebCore {
#if ENABLE(NETSCAPE_PLUGIN_API)
NPError getValue(NPNVariable variable, void* value);
static NPError getValueStatic(NPNVariable variable, void* value);
#endif
NPError setValue(NPPVariable variable, void* value);
void invalidateRect(NPRect*);
void invalidateRegion(NPRegion);
#endif
void forceRedraw();
void pushPopupsEnabledState(bool state);
void popPopupsEnabledState();
Expand Down Expand Up @@ -238,9 +251,11 @@ namespace WebCore {
void stop();
void platformDestroy();
static void setCurrentPluginView(PluginView*);
#if ENABLE(NETSCAPE_PLUGIN_API)
NPError load(const FrameLoadRequest&, bool sendNotification, void* notifyData);
NPError handlePost(const char* url, const char* target, uint32_t len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders);
NPError handlePostReadFile(Vector<char>& buffer, uint32_t len, const char* buf);
#endif
static void freeStringArray(char** stringArray, int length);
void setCallingPlugin(bool) const;

Expand All @@ -254,8 +269,10 @@ namespace WebCore {
static BOOL WINAPI hookedEndPaint(HWND, const PAINTSTRUCT*);
#endif

#if ENABLE(NETSCAPE_PLUGIN_API)
static bool platformGetValueStatic(NPNVariable variable, void* value, NPError* result);
bool platformGetValue(NPNVariable variable, void* value, NPError* result);
#endif

RefPtr<Frame> m_parentFrame;
RefPtr<PluginPackage> m_plugin;
Expand All @@ -280,7 +297,9 @@ namespace WebCore {
Timer<PluginView> m_lifeSupportTimer;

#ifndef NP_NO_CARBON
#if ENABLE(NETSCAPE_PLUGIN_API)
bool dispatchNPEvent(NPEvent&);
#endif // ENABLE(NETSCAPE_PLUGIN_API)
#endif
void updatePluginWidget();
void paintMissingPluginIcon(GraphicsContext*, const IntRect&);
Expand All @@ -306,9 +325,11 @@ namespace WebCore {
String m_mimeType;
WTF::CString m_userAgent;

#if ENABLE(NETSCAPE_PLUGIN_API)
NPP m_instance;
NPP_t m_instanceStruct;
NPWindow m_npWindow;
#endif

Vector<bool, 4> m_popupStateStack;

Expand Down
6 changes: 4 additions & 2 deletions WebCore/plugins/PluginViewNone.cpp
Expand Up @@ -66,12 +66,12 @@ void PluginView::setNPWindowRect(const IntRect&)
{
}

#if ENABLE(NETSCAPE_PLUGIN_API)
NPError PluginView::handlePostReadFile(Vector<char>&, uint32_t, const char*)
{
return 0;
}

#if ENABLE(NETSCAPE_PLUGIN_API)
bool PluginView::platformGetValue(NPNVariable, void*, NPError*)
{
return false;
Expand All @@ -81,19 +81,21 @@ bool PluginView::platformGetValueStatic(NPNVariable, void*, NPError*)
{
return false;
}
#endif

void PluginView::invalidateRect(NPRect*)
{
}
#endif

void PluginView::invalidateRect(const IntRect&)
{
}

#if ENABLE(NETSCAPE_PLUGIN_API)
void PluginView::invalidateRegion(NPRegion)
{
}
#endif

void PluginView::forceRedraw()
{
Expand Down
26 changes: 26 additions & 0 deletions WebKit/mac/ChangeLog
@@ -1,3 +1,29 @@
2010-08-19 David Kilzer <ddkilzer@apple.com>

<http://webkit.org/b/44285> Fix compilation with NETSCAPE_PLUGIN_API disabled

Reviewed by Joseph Pecoraro.

* Plugins/Hosted/HostedNetscapePluginStream.mm: Changed
USE(PLUGIN_HOST_PROCESS) to
USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API).
* Plugins/Hosted/NetscapePluginHostManager.mm: Ditto.
* Plugins/Hosted/NetscapePluginHostProxy.mm: Ditto.
* Plugins/Hosted/NetscapePluginInstanceProxy.mm: Ditto.
* Plugins/Hosted/ProxyInstance.mm: Ditto.
* Plugins/Hosted/WebHostedNetscapePluginView.mm: Ditto.
* WebCoreSupport/WebChromeClient.mm: Ditto.
(WebChromeClient::createWindow):
* WebCoreSupport/WebFrameLoaderClient.mm: Ditto.
(WebFrameLoaderClient::dispatchCreatePage):
* WebView/WebHTMLView.mm:
(needsCursorRectsSupportAtPoint): Added #if
ENABLE(NETSCAPE_PLUGIN_API) and #endif macros as needed.
* WebView/WebView.mm:
(+[WebView _isNodeHaltedPlugin:]): Ditto.
(+[WebView _hasPluginForNodeBeenHalted:]): Ditto.
(+[WebView _restartHaltedPluginForNode:]): Ditto.

2010-08-17 Jesus Sanchez-Palencia <jesus.palencia@openbossa.org>

Reviewed by Darin Adler.
Expand Down
4 changes: 2 additions & 2 deletions WebKit/mac/Plugins/Hosted/HostedNetscapePluginStream.mm
Expand Up @@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

#import "HostedNetscapePluginStream.h"

Expand Down Expand Up @@ -275,5 +275,5 @@

} // namespace WebKit

#endif // USE(PLUGIN_HOST_PROCESS)
#endif // USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

4 changes: 2 additions & 2 deletions WebKit/mac/Plugins/Hosted/NetscapePluginHostManager.mm
Expand Up @@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

#import "NetscapePluginHostManager.h"

Expand Down Expand Up @@ -323,4 +323,4 @@

} // namespace WebKit

#endif // USE(PLUGIN_HOST_PROCESS)
#endif // USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
4 changes: 2 additions & 2 deletions WebKit/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
Expand Up @@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

#import "NetscapePluginHostProxy.h"

Expand Down Expand Up @@ -1185,4 +1185,4 @@ kern_return_t WKPCSetException(mach_port_t clientPort, data_t message, mach_msg_
return KERN_SUCCESS;
}

#endif // USE(PLUGIN_HOST_PROCESS)
#endif // USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
4 changes: 2 additions & 2 deletions WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm
Expand Up @@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

#import "NetscapePluginInstanceProxy.h"

Expand Down Expand Up @@ -1677,4 +1677,4 @@

} // namespace WebKit

#endif // USE(PLUGIN_HOST_PROCESS)
#endif // USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
4 changes: 2 additions & 2 deletions WebKit/mac/Plugins/Hosted/ProxyInstance.mm
Expand Up @@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

#import "ProxyInstance.h"

Expand Down Expand Up @@ -454,5 +454,5 @@

} // namespace WebKit

#endif // USE(PLUGIN_HOST_PROCESS)
#endif // USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

5 changes: 3 additions & 2 deletions WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
Expand Up @@ -22,7 +22,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if USE(PLUGIN_HOST_PROCESS)

#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)

#import "WebHostedNetscapePluginView.h"

Expand Down Expand Up @@ -505,4 +506,4 @@ - (void)webFrame:(WebFrame *)webFrame didFinishLoadWithError:(NSError *)error

@end

#endif
#endif // USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
4 changes: 2 additions & 2 deletions WebKit/mac/WebCoreSupport/WebChromeClient.mm
Expand Up @@ -77,7 +77,7 @@
#import <WebCore/GraphicsLayer.h>
#endif

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
#import "NetscapePluginHostManager.h"
#endif

Expand Down Expand Up @@ -250,7 +250,7 @@ - (id)initWithGeolocation:(Geolocation*)geolocation;
newWebView = CallUIDelegate(m_webView, @selector(webView:createWebViewWithRequest:), URLRequest);
}

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
if (newWebView)
WebKit::NetscapePluginHostManager::shared().didCreateWindow();
#endif
Expand Down
8 changes: 4 additions & 4 deletions WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Expand Up @@ -127,7 +127,7 @@
#import "WebJavaPlugIn.h"
#endif

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
#import "NetscapePluginHostManager.h"
#import "WebHostedNetscapePluginView.h"
#endif
Expand Down Expand Up @@ -706,7 +706,7 @@ static inline void applyAppleDictionaryApplicationQuirk(WebFrameLoaderClient* cl
windowFeatures:features];
[features release];

#if USE(PLUGIN_HOST_PROCESS)
#if USE(PLUGIN_HOST_PROCESS) && ENABLE(NETSCAPE_PLUGIN_API)
if (newWebView)
WebKit::NetscapePluginHostManager::shared().didCreateWindow();
#endif
Expand Down Expand Up @@ -1552,14 +1552,14 @@ virtual void handleEvent(Event* event)

};

#endif // ENABLE(NETSCAPE_PLUGIN_API)

#if USE(PLUGIN_HOST_PROCESS)
#define NETSCAPE_PLUGIN_VIEW WebHostedNetscapePluginView
#else
#define NETSCAPE_PLUGIN_VIEW WebNetscapePluginView
#endif

#endif // ENABLE(NETSCAPE_PLUGIN_API)

PassRefPtr<Widget> WebFrameLoaderClient::createPlugin(const IntSize& size, HTMLPlugInElement* element, const KURL& url,
const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually)
{
Expand Down
2 changes: 2 additions & 0 deletions WebKit/mac/WebView/WebHTMLView.mm
Expand Up @@ -167,9 +167,11 @@ static bool needsCursorRectsSupportAtPoint(NSWindow* window, NSPoint point)
if ([view isKindOfClass:[WebHTMLView class]])
return false;

#if ENABLE(NETSCAPE_PLUGIN_API)
// Neither do NPAPI plug-ins.
if ([view isKindOfClass:[WebBaseNetscapePluginView class]])
return false;
#endif

// Non-Web content, WebPDFView, and WebKit plug-ins use normal cursor handling.
return true;
Expand Down

0 comments on commit 9fa6f25

Please sign in to comment.