diff options
Diffstat (limited to 'WebCore/plugins')
-rw-r--r-- | WebCore/plugins/PluginDataNone.cpp (renamed from WebCore/plugins/wx/PluginDataWx.cpp) | 0 | ||||
-rw-r--r-- | WebCore/plugins/PluginPackage.cpp | 3 | ||||
-rw-r--r-- | WebCore/plugins/PluginPackageNone.cpp (renamed from WebCore/plugins/wx/PluginPackageWx.cpp) | 6 | ||||
-rw-r--r-- | WebCore/plugins/PluginView.cpp | 7 | ||||
-rw-r--r-- | WebCore/plugins/PluginView.h | 12 | ||||
-rw-r--r-- | WebCore/plugins/PluginViewNone.cpp (renamed from WebCore/plugins/wx/PluginViewWx.cpp) | 18 | ||||
-rw-r--r-- | WebCore/plugins/gtk/PluginPackageGtk.cpp | 2 | ||||
-rw-r--r-- | WebCore/plugins/gtk/PluginViewGtk.cpp | 117 | ||||
-rw-r--r-- | WebCore/plugins/mac/PluginViewMac.cpp | 15 | ||||
-rw-r--r-- | WebCore/plugins/npfunctions.h | 7 | ||||
-rw-r--r-- | WebCore/plugins/qt/PluginViewQt.cpp | 7 | ||||
-rw-r--r-- | WebCore/plugins/win/PluginPackageWin.cpp | 5 |
12 files changed, 106 insertions, 93 deletions
diff --git a/WebCore/plugins/wx/PluginDataWx.cpp b/WebCore/plugins/PluginDataNone.cpp index 28e3967..28e3967 100644 --- a/WebCore/plugins/wx/PluginDataWx.cpp +++ b/WebCore/plugins/PluginDataNone.cpp diff --git a/WebCore/plugins/PluginPackage.cpp b/WebCore/plugins/PluginPackage.cpp index 82daca7..747d937 100644 --- a/WebCore/plugins/PluginPackage.cpp +++ b/WebCore/plugins/PluginPackage.cpp @@ -97,7 +97,8 @@ int PluginPackage::compare(const PluginPackage& compareTo) const if (diff) return diff; - if (diff = compareFileVersion(compareTo.version())) + diff = compareFileVersion(compareTo.version()); + if (diff) return diff; return strcmp(parentDirectory().utf8().data(), compareTo.parentDirectory().utf8().data()); diff --git a/WebCore/plugins/wx/PluginPackageWx.cpp b/WebCore/plugins/PluginPackageNone.cpp index b93ead2..3f43855 100644 --- a/WebCore/plugins/wx/PluginPackageWx.cpp +++ b/WebCore/plugins/PluginPackageNone.cpp @@ -35,7 +35,7 @@ namespace WebCore { -void PluginPackage::determineQuirks(const String& mimeType) +void PluginPackage::determineQuirks(const String&) { notImplemented(); } @@ -59,13 +59,13 @@ unsigned PluginPackage::hash() const return 0; } -bool PluginPackage::equal(const PluginPackage& a, const PluginPackage& b) +bool PluginPackage::equal(const PluginPackage&, const PluginPackage&) { notImplemented(); return false; } -int PluginPackage::compareFileVersion(const PlatformModuleVersion& compareVersion) const +int PluginPackage::compareFileVersion(const PlatformModuleVersion&) const { notImplemented(); return 0; diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp index ed867fc..60287f6 100644 --- a/WebCore/plugins/PluginView.cpp +++ b/WebCore/plugins/PluginView.cpp @@ -404,12 +404,12 @@ int32 PluginView::write(NPStream* stream, int32 len, void* buffer) NPError PluginView::destroyStream(NPStream* stream, NPReason reason) { - PluginStream* browserStream = static_cast<PluginStream*>(stream->ndata); - if (!stream || PluginStream::ownerForStream(stream) != m_instance) return NPERR_INVALID_INSTANCE_ERROR; + PluginStream* browserStream = static_cast<PluginStream*>(stream->ndata); browserStream->cancelAndDestroyStream(reason); + return NPERR_NO_ERROR; } @@ -569,9 +569,6 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p #if PLATFORM(GTK) || defined(Q_WS_X11) , m_needsXEmbed(false) #endif -#if PLATFORM(QT) - , m_isNPAPIPlugin(false) -#endif #if PLATFORM(WIN_OS) && !PLATFORM(WX) && ENABLE(NETSCAPE_PLUGIN_API) , m_pluginWndProc(0) , m_lastMessage(0) diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h index 5be7d1f..e895165 100644 --- a/WebCore/plugins/PluginView.h +++ b/WebCore/plugins/PluginView.h @@ -199,11 +199,6 @@ namespace WebCore { static bool isCallingPlugin(); -#if PLATFORM(QT) - bool isNPAPIPlugin() const { return m_isNPAPIPlugin; } - void setIsNPAPIPlugin(bool b) { m_isNPAPIPlugin = b; } -#endif - private: PluginView(Frame* parentFrame, const IntSize&, PluginPackage*, Element*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually); @@ -284,10 +279,6 @@ namespace WebCore { bool m_isTransparent; bool m_haveInitialized; -#if PLATFORM(QT) - bool m_isNPAPIPlugin; -#endif - #if PLATFORM(GTK) || defined(Q_WS_X11) bool m_needsXEmbed; #endif @@ -330,6 +321,9 @@ private: void nullEventTimerFired(Timer<PluginView>*); Point globalMousePosForPlugin() const; #endif +#if PLATFORM(GTK) || defined(Q_WS_X11) + void setNPWindowIfNeeded(); +#endif IntRect m_clipRect; // The clip rect to apply to a windowed plug-in IntRect m_windowRect; // Our window rect. diff --git a/WebCore/plugins/wx/PluginViewWx.cpp b/WebCore/plugins/PluginViewNone.cpp index a95713a..2766a6b 100644 --- a/WebCore/plugins/wx/PluginViewWx.cpp +++ b/WebCore/plugins/PluginViewNone.cpp @@ -48,27 +48,27 @@ void PluginView::hide() notImplemented(); } -void PluginView::paint(GraphicsContext* context, const IntRect& rect) +void PluginView::paint(GraphicsContext*, const IntRect&) { notImplemented(); } -void PluginView::handleKeyboardEvent(KeyboardEvent* event) +void PluginView::handleKeyboardEvent(KeyboardEvent*) { notImplemented(); } -void PluginView::handleMouseEvent(MouseEvent* event) +void PluginView::handleMouseEvent(MouseEvent*) { notImplemented(); } -void PluginView::setParent(ScrollView* parent) +void PluginView::setParent(ScrollView*) { notImplemented(); } -void PluginView::setNPWindowRect(const IntRect& rect) +void PluginView::setNPWindowRect(const IntRect&) { notImplemented(); } @@ -84,20 +84,20 @@ const char* PluginView::userAgent() return 0; } -NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf) +NPError PluginView::handlePostReadFile(Vector<char>&, uint32, const char*) { notImplemented(); return 0; } -NPError PluginView::getValue(NPNVariable variable, void* value) +NPError PluginView::getValue(NPNVariable, void*) { notImplemented(); return 0; } -void PluginView::invalidateRect(NPRect* rect) +void PluginView::invalidateRect(NPRect*) { notImplemented(); } @@ -107,7 +107,7 @@ void PluginView::invalidateRect(const IntRect&) notImplemented(); } -void PluginView::invalidateRegion(NPRegion region) +void PluginView::invalidateRegion(NPRegion) { notImplemented(); } diff --git a/WebCore/plugins/gtk/PluginPackageGtk.cpp b/WebCore/plugins/gtk/PluginPackageGtk.cpp index 997583e..1337c31 100644 --- a/WebCore/plugins/gtk/PluginPackageGtk.cpp +++ b/WebCore/plugins/gtk/PluginPackageGtk.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "PluginPackage.h" +#include <stdio.h> + #include "CString.h" #include "MIMETypeRegistry.h" #include "NotImplemented.h" diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp index 2b93e56..30be6b0 100644 --- a/WebCore/plugins/gtk/PluginViewGtk.cpp +++ b/WebCore/plugins/gtk/PluginViewGtk.cpp @@ -82,6 +82,23 @@ namespace WebCore { using namespace HTMLNames; +bool PluginView::dispatchNPEvent(NPEvent& event) +{ + // sanity check + if (!m_plugin->pluginFuncs()->event) + return false; + + PluginView::setCurrentPluginView(this); + JSC::JSLock::DropAllLocks dropAllLocks(false); + setCallingPlugin(true); + + bool accepted = m_plugin->pluginFuncs()->event(m_instance, &event); + + setCallingPlugin(false); + PluginView::setCurrentPluginView(0); + return accepted; +} + void PluginView::updatePluginWidget() { if (!parent() || !m_isWindowed) @@ -97,16 +114,8 @@ void PluginView::updatePluginWidget() m_clipRect = windowClipRect(); m_clipRect.move(-m_windowRect.x(), -m_windowRect.y()); - GtkAllocation allocation = { m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height() }; - if (platformPluginWidget()) { - gtk_widget_size_allocate(platformPluginWidget(), &allocation); -#if PLATFORM(X11) - if (!m_needsXEmbed) { - gtk_xtbin_set_position(GTK_XTBIN(platformPluginWidget()), m_windowRect.x(), m_windowRect.y()); - gtk_xtbin_resize(platformPluginWidget(), m_windowRect.width(), m_windowRect.height()); - } -#endif - } + if (platformPluginWidget() && (m_windowRect != oldWindowRect || m_clipRect != oldClipRect)) + setNPWindowIfNeeded(); } void PluginView::setFocus() @@ -144,7 +153,12 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) return; } - if (m_isWindowed || context->paintingDisabled()) + if (context->paintingDisabled()) + return; + + setNPWindowIfNeeded(); + + if (m_isWindowed) return; NPEvent npEvent; @@ -154,12 +168,8 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) ASSERT(parent()->isFrameView()); - if (m_plugin->pluginFuncs()->event) { - JSC::JSLock::DropAllLocks dropAllLocks(false); - m_plugin->pluginFuncs()->event(m_instance, &npEvent); - } - - setNPWindowRect(frameRect()); + if (!dispatchNPEvent(npEvent)) + LOG(Events, "PluginView::paint(): Paint event not accepted"); } void PluginView::handleKeyboardEvent(KeyboardEvent* event) @@ -169,7 +179,7 @@ void PluginView::handleKeyboardEvent(KeyboardEvent* event) /* FIXME: Synthesize an XEvent to pass through */ JSC::JSLock::DropAllLocks dropAllLocks(false); - if (!m_plugin->pluginFuncs()->event(m_instance, &npEvent)) + if (!dispatchNPEvent(npEvent)) event->setDefaultHandled(); } @@ -184,7 +194,7 @@ void PluginView::handleMouseEvent(MouseEvent* event) IntPoint p = static_cast<FrameView*>(parent())->contentsToWindow(IntPoint(event->pageX(), event->pageY())); JSC::JSLock::DropAllLocks dropAllLocks(false); - if (!m_plugin->pluginFuncs()->event(m_instance, &npEvent)) + if (!dispatchNPEvent(npEvent)) event->setDefaultHandled(); } @@ -200,40 +210,41 @@ void PluginView::setParent(ScrollView* parent) } } -void PluginView::setNPWindowRect(const IntRect& rect) +void PluginView::setNPWindowRect(const IntRect&) { - if (!m_isStarted || !parent()) - return; - - IntPoint p = static_cast<FrameView*>(parent())->contentsToWindow(rect.location()); - m_npWindow.x = p.x(); - m_npWindow.y = p.y(); - - m_npWindow.width = rect.width(); - m_npWindow.height = rect.height(); - - m_npWindow.clipRect.left = 0; - m_npWindow.clipRect.top = 0; - m_npWindow.clipRect.right = rect.width(); - m_npWindow.clipRect.bottom = rect.height(); + setNPWindowIfNeeded(); +} - if (m_npWindow.x < 0 || m_npWindow.y < 0 || - m_npWindow.width <= 0 || m_npWindow.height <= 0) +void PluginView::setNPWindowIfNeeded() +{ + if (!m_isStarted || !parent() || !m_plugin->pluginFuncs()->setwindow) return; - if (m_plugin->pluginFuncs()->setwindow) { - PluginView::setCurrentPluginView(this); - JSC::JSLock::DropAllLocks dropAllLocks(false); - setCallingPlugin(true); - m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow); - setCallingPlugin(false); - PluginView::setCurrentPluginView(0); + m_npWindow.x = m_windowRect.x(); + m_npWindow.y = m_windowRect.y(); + m_npWindow.width = m_windowRect.width(); + m_npWindow.height = m_windowRect.height(); - if (!m_isWindowed) - return; + m_npWindow.clipRect.left = m_clipRect.x(); + m_npWindow.clipRect.top = m_clipRect.y(); + m_npWindow.clipRect.right = m_clipRect.width(); + m_npWindow.clipRect.bottom = m_clipRect.height(); - ASSERT(platformPluginWidget()); + GtkAllocation allocation = { m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height() }; + gtk_widget_size_allocate(platformPluginWidget(), &allocation); +#if PLATFORM(X11) + if (!m_needsXEmbed) { + gtk_xtbin_set_position(GTK_XTBIN(platformPluginWidget()), m_windowRect.x(), m_windowRect.y()); + gtk_xtbin_resize(platformPluginWidget(), m_windowRect.width(), m_windowRect.height()); } +#endif + + PluginView::setCurrentPluginView(this); + JSC::JSLock::DropAllLocks dropAllLocks(false); + setCallingPlugin(true); + m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow); + setCallingPlugin(false); + PluginView::setCurrentPluginView(0); } void PluginView::setParentVisible(bool visible) @@ -349,22 +360,22 @@ NPError PluginView::getValueStatic(NPNVariable variable, void* value) switch (variable) { case NPNVToolkit: #if PLATFORM(GTK) - *((uint32 *)value) = 2; + *static_cast<uint32*>(value) = 2; #else - *((uint32 *)value) = 0; + *static_cast<uint32*>(value) = 0; #endif return NPERR_NO_ERROR; case NPNVSupportsXEmbedBool: #if PLATFORM(X11) - *((uint32 *)value) = true; + *static_cast<NPBool*>(value) = true; #else - *((uint32 *)value) = false; + *static_cast<NPBool*>(value) = false; #endif return NPERR_NO_ERROR; case NPNVjavascriptEnabledBool: - *((uint32 *)value) = true; + *static_cast<NPBool*>(value) = true; return NPERR_NO_ERROR; default: @@ -576,10 +587,12 @@ void PluginView::init() m_npWindow.window = 0; } + // TODO remove in favor of null events, like mac port? if (!(m_plugin->quirks().contains(PluginQuirkDeferFirstSetWindowCall))) - setNPWindowRect(frameRect()); + updatePluginWidget(); // was: setNPWindowIfNeeded(), but this doesn't produce 0x0 rects at first go m_status = PluginStatusLoadedSuccessfully; } } // namespace WebCore + diff --git a/WebCore/plugins/mac/PluginViewMac.cpp b/WebCore/plugins/mac/PluginViewMac.cpp index 9e58906..a46aca6 100644 --- a/WebCore/plugins/mac/PluginViewMac.cpp +++ b/WebCore/plugins/mac/PluginViewMac.cpp @@ -158,8 +158,6 @@ void PluginView::init() m_npWindow.clipRect.right = 0; m_npWindow.clipRect.bottom = 0; - setIsNPAPIPlugin(true); - show(); m_status = PluginStatusLoadedSuccessfully; @@ -222,11 +220,11 @@ NPError PluginView::getValueStatic(NPNVariable variable, void* value) switch (variable) { case NPNVToolkit: - *((uint32 *)value) = 0; + *static_cast<uint32*>(value) = 0; return NPERR_NO_ERROR; case NPNVjavascriptEnabledBool: - *((uint32 *)value) = true; + *static_cast<NPBool*>(value) = true; return NPERR_NO_ERROR; default: @@ -277,7 +275,7 @@ NPError PluginView::getValue(NPNVariable variable, void* value) } case NPNVsupportsCoreGraphicsBool: - *((uint32 *)value) = true; + *static_cast<NPBool*>(value) = true; return NPERR_NO_ERROR; default: @@ -445,11 +443,8 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) void PluginView::invalidateRect(const IntRect& rect) { - if (platformPluginWidget()) { - // TODO: optimize - platformPluginWidget()->update(); - return; - } + if (platformPluginWidget()) + platformPluginWidget()->update(convertToContainingWindow(rect)); } void PluginView::invalidateRect(NPRect* rect) diff --git a/WebCore/plugins/npfunctions.h b/WebCore/plugins/npfunctions.h index 21e2e15..beaa1fb 100644 --- a/WebCore/plugins/npfunctions.h +++ b/WebCore/plugins/npfunctions.h @@ -66,6 +66,10 @@ typedef void* (*NPN_GetJavaPeerProcPtr)(NPP instance); typedef void (*NPN_PushPopupsEnabledStateProcPtr)(NPP instance, NPBool enabled); typedef void (*NPN_PopPopupsEnabledStateProcPtr)(NPP instance); typedef void (*NPN_PluginThreadAsyncCallProcPtr)(NPP npp, void (*func)(void *), void *userData); +typedef NPError (*NPN_GetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, char** value, uint32_t* len); +typedef NPError (*NPN_SetValueForURLProcPtr)(NPP npp, NPNURLVariable variable, const char* url, const char* value, uint32_t* len); +typedef NPError (*NPN_GetAuthenticationInfoPtr)(NPP npp, const char* protocol, const char* host, int32_t port, const char* scheme, const char *realm, char** username, uint32_t* ulen, char** password, uint32_t* plen); + typedef uint32 (*NPN_ScheduleTimerProcPtr)(NPP npp, uint32 interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32 timerID)); typedef void (*NPN_UnscheduleTimerProcPtr)(NPP npp, uint32 timerID); typedef NPError (*NPN_PopUpContextMenuProcPtr)(NPP instance, NPMenu* menu); @@ -161,6 +165,9 @@ typedef struct _NPNetscapeFuncs { NPN_EnumerateProcPtr enumerate; NPN_PluginThreadAsyncCallProcPtr pluginthreadasynccall; NPN_ConstructProcPtr construct; + NPN_GetValueForURLProcPtr getvalueforurl; + NPN_SetValueForURLProcPtr setvalueforurl; + NPN_GetAuthenticationInfoPtr getauthenticationinfo; NPN_ScheduleTimerProcPtr scheduletimer; NPN_UnscheduleTimerProcPtr unscheduletimer; NPN_PopUpContextMenuProcPtr popupcontextmenu; diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp index 4982d08..c8dd0e5 100644 --- a/WebCore/plugins/qt/PluginViewQt.cpp +++ b/WebCore/plugins/qt/PluginViewQt.cpp @@ -301,15 +301,15 @@ NPError PluginView::getValueStatic(NPNVariable variable, void* value) { switch (variable) { case NPNVToolkit: - *((uint32 *)value) = 0; + *static_cast<uint32*>(value) = 0; return NPERR_NO_ERROR; case NPNVSupportsXEmbedBool: - *((uint32 *)value) = true; + *static_cast<NPBool*>(value) = true; return NPERR_NO_ERROR; case NPNVjavascriptEnabledBool: - *((uint32 *)value) = true; + *static_cast<NPBool*>(value) = true; return NPERR_NO_ERROR; default: @@ -459,7 +459,6 @@ void PluginView::init() if (m_needsXEmbed) { setPlatformWidget(new QX11EmbedContainer(m_parentFrame->view()->hostWindow()->platformWindow())); - setIsNPAPIPlugin(true); } else { notImplemented(); m_status = PluginStatusCanNotLoadPlugin; diff --git a/WebCore/plugins/win/PluginPackageWin.cpp b/WebCore/plugins/win/PluginPackageWin.cpp index fe9b544..0edcef3 100644 --- a/WebCore/plugins/win/PluginPackageWin.cpp +++ b/WebCore/plugins/win/PluginPackageWin.cpp @@ -68,6 +68,11 @@ int PluginPackage::compareFileVersion(const PlatformModuleVersion& compareVersio bool PluginPackage::isPluginBlacklisted() { + if (name() == "Citrix ICA Client") { + // The Citrix ICA Client plug-in requires a Mozilla-based browser; see <rdar://6418681>. + return true; + } + if (name() == "Silverlight Plug-In") { // workaround for <rdar://5557379> Crash in Silverlight when opening microsoft.com. // the latest 1.0 version of Silverlight does not reproduce this crash, so allow it |