summaryrefslogtreecommitdiffstats
path: root/WebCore/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/plugins')
-rw-r--r--WebCore/plugins/PluginDatabase.cpp1
-rw-r--r--WebCore/plugins/PluginView.cpp34
-rw-r--r--WebCore/plugins/PluginView.h3
-rw-r--r--WebCore/plugins/gtk/PluginViewGtk.cpp4
-rw-r--r--WebCore/plugins/qt/PluginContainerQt.cpp2
-rw-r--r--WebCore/plugins/qt/PluginDataQt.cpp98
-rw-r--r--WebCore/plugins/qt/PluginViewQt.cpp12
-rw-r--r--WebCore/plugins/win/PluginViewWin.cpp4
8 files changed, 47 insertions, 111 deletions
diff --git a/WebCore/plugins/PluginDatabase.cpp b/WebCore/plugins/PluginDatabase.cpp
index 2426f78..368c83e 100644
--- a/WebCore/plugins/PluginDatabase.cpp
+++ b/WebCore/plugins/PluginDatabase.cpp
@@ -34,6 +34,7 @@
#include "FileSystem.h"
#endif
#include <stdlib.h>
+#include <wtf/text/CString.h>
#if PLATFORM(ANDROID)
#include "JavaSharedClient.h"
diff --git a/WebCore/plugins/PluginView.cpp b/WebCore/plugins/PluginView.cpp
index c657523..0413b21 100644
--- a/WebCore/plugins/PluginView.cpp
+++ b/WebCore/plugins/PluginView.cpp
@@ -28,7 +28,9 @@
#include "config.h"
#include "PluginView.h"
+#if USE(JSC)
#include "Bridge.h"
+#endif
#include "Chrome.h"
#include "Document.h"
#include "DocumentLoader.h"
@@ -562,8 +564,8 @@ NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNoti
// For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
return NPERR_INVALID_PARAM;
- } else if (!SecurityOrigin::canDisplay(url, String(), m_parentFrame->document()))
- return NPERR_GENERIC_ERROR;
+ } else if (!m_parentFrame->document()->securityOrigin()->canDisplay(url))
+ return NPERR_GENERIC_ERROR;
PluginRequest* request = new PluginRequest(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed());
scheduleRequest(request);
@@ -767,10 +769,9 @@ void PluginView::setJavaScriptPaused(bool paused)
m_requestTimer.startOneShot(0);
}
-#if USE(JSC)
-PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
-{
#if ENABLE(NETSCAPE_PLUGIN_API)
+NPObject* PluginView::npObject()
+{
NPObject* object = 0;
if (!m_isStarted || !m_plugin || !m_plugin->pluginFuncs()->getvalue)
@@ -784,13 +785,30 @@ PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
NPError npErr;
{
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
npErr = m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginScriptableNPObject, &object);
setCallingPlugin(false);
PluginView::setCurrentPluginView(0);
}
+ if (npErr != NPERR_NO_ERROR)
+ return 0;
+
+ return object;
+}
+#endif
+
+#if USE(JSC)
+PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
+{
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ NPObject* object = npObject();
+ if (!object)
+ return 0;
+
if (hasOneRef()) {
// The renderer for the PluginView was destroyed during the above call, and
// the PluginView will be destroyed when this function returns, so we
@@ -798,9 +816,6 @@ PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance()
return 0;
}
- if (npErr != NPERR_NO_ERROR || !object)
- return 0;
-
RefPtr<JSC::Bindings::RootObject> root = m_parentFrame->script()->createRootObject(this);
RefPtr<JSC::Bindings::Instance> instance = JSC::Bindings::CInstance::create(object, root.release());
@@ -1475,8 +1490,11 @@ void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
return;
PluginView::setCurrentPluginView(this);
+<<<<<<< HEAD
// ANDROID
// Upstream to webkit.org
+=======
+>>>>>>> webkit.org at r67908
#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
#endif
diff --git a/WebCore/plugins/PluginView.h b/WebCore/plugins/PluginView.h
index a17d327..8587c37 100644
--- a/WebCore/plugins/PluginView.h
+++ b/WebCore/plugins/PluginView.h
@@ -152,6 +152,9 @@ namespace WebCore {
void setNPWindowRect(const IntRect&);
static PluginView* currentPluginView();
+#if ENABLE(NETSCAPE_PLUGIN_API)
+ NPObject* npObject();
+#endif
#if USE(JSC)
PassRefPtr<JSC::Bindings::Instance> bindingInstance();
#endif
diff --git a/WebCore/plugins/gtk/PluginViewGtk.cpp b/WebCore/plugins/gtk/PluginViewGtk.cpp
index 6d631e3..bee7821 100644
--- a/WebCore/plugins/gtk/PluginViewGtk.cpp
+++ b/WebCore/plugins/gtk/PluginViewGtk.cpp
@@ -143,7 +143,7 @@ void PluginView::updatePluginWidget()
m_drawable = XCreatePixmap(GDK_DISPLAY(), getRootWindow(m_parentFrame.get()),
m_windowRect.width(), m_windowRect.height(),
((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth);
- XSync(GDK_DISPLAY(), False); // make sure that the server knows about the Drawable
+ XSync(GDK_DISPLAY(), false); // make sure that the server knows about the Drawable
}
#endif
@@ -265,7 +265,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
dispatchNPEvent(xevent);
if (syncX)
- XSync(m_pluginDisplay, False); // sync changes by plugin
+ XSync(m_pluginDisplay, false); // sync changes by plugin
cairo_t* cr = context->platformContext();
cairo_save(cr);
diff --git a/WebCore/plugins/qt/PluginContainerQt.cpp b/WebCore/plugins/qt/PluginContainerQt.cpp
index cb894a7..8486180 100644
--- a/WebCore/plugins/qt/PluginContainerQt.cpp
+++ b/WebCore/plugins/qt/PluginContainerQt.cpp
@@ -56,7 +56,7 @@ PluginClientWrapper::~PluginClientWrapper()
bool PluginClientWrapper::x11Event(XEvent* event)
{
// modify the event window id and insert it into the Qt event system.
- event->xany.window = m_parent->parentWidget()->winId();
+ event->xany.window = m_parent->effectiveWinId();
static_cast<QApplication*>(QApplication::instance())->x11ProcessEvent(event);
return true;
}
diff --git a/WebCore/plugins/qt/PluginDataQt.cpp b/WebCore/plugins/qt/PluginDataQt.cpp
deleted file mode 100644
index 3dc86d0..0000000
--- a/WebCore/plugins/qt/PluginDataQt.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
- Copyright (C) 2008 Collabora Ltd. All rights reserved.
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
-*/
-
-#include "config.h"
-#include "PluginData.h"
-
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
-
-#include "Chrome.h"
-#include "ChromeClientQt.h"
-#include "Page.h"
-#include <qwebpage.h>
-#include <qwebpluginfactory.h>
-
-namespace WebCore {
-
-void PluginData::initPlugins()
-{
- QWebPage* webPage = static_cast<ChromeClientQt*>(m_page->chrome()->client())->m_webPage;
- QWebPluginFactory* factory = webPage->pluginFactory();
- if (factory) {
-
- QList<QWebPluginFactory::Plugin> qplugins = factory->plugins();
- for (int i = 0; i < qplugins.count(); ++i) {
- const QWebPluginFactory::Plugin& qplugin = qplugins.at(i);
-
- PluginInfo info;
- info.name = qplugin.name;
- info.desc = qplugin.description;
-
- for (int j = 0; j < qplugin.mimeTypes.count(); ++j) {
- const QWebPluginFactory::MimeType& mimeType = qplugin.mimeTypes.at(j);
-
- MimeClassInfo mimeInfo;
- mimeInfo.type = mimeType.name;
- mimeInfo.desc = mimeType.description;
- for (int k = 0; k < mimeType.fileExtensions.count(); ++k)
- mimeInfo.extensions.append(mimeType.fileExtensions.at(k));
-
- info.mimes.append(mimeInfo);
- }
-
- m_plugins.append(info);
- }
- }
-
- PluginDatabase *db = PluginDatabase::installedPlugins();
- const Vector<PluginPackage*> &plugins = db->plugins();
-
- for (unsigned int i = 0; i < plugins.size(); ++i) {
- PluginInfo info;
- PluginPackage* package = plugins[i];
-
- info.name = package->name();
- info.file = package->fileName();
- info.desc = package->description();
-
- const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions();
- MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end();
- for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) {
- MimeClassInfo mime;
-
- mime.type = it->first;
- mime.desc = it->second;
- mime.extensions = package->mimeToExtensions().get(mime.type);
-
- info.mimes.append(mime);
- }
-
- m_plugins.append(info);
- }
-}
-
-void PluginData::refresh()
-{
- PluginDatabase *db = PluginDatabase::installedPlugins();
- db->refresh();
-}
-
-};
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index e2df392..de7d12d 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -28,7 +28,9 @@
#include "config.h"
#include "PluginView.h"
+#if USE(JSC)
#include "Bridge.h"
+#endif
#include "Document.h"
#include "DocumentLoader.h"
#include "Element.h"
@@ -44,7 +46,9 @@
#include "HTMLPlugInElement.h"
#include "HostWindow.h"
#include "Image.h"
+#if USE(JSC)
#include "JSDOMBinding.h"
+#endif
#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "NotImplemented.h"
@@ -322,7 +326,7 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
dispatchNPEvent(xevent);
if (syncX)
- XSync(m_pluginDisplay, False); // sync changes by plugin
+ XSync(m_pluginDisplay, false); // sync changes by plugin
painter->drawPixmap(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), qtDrawable,
exposedRect);
@@ -335,7 +339,9 @@ bool PluginView::dispatchNPEvent(NPEvent& event)
return false;
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
bool accepted = m_plugin->pluginFuncs()->event(m_instance, &event);
setCallingPlugin(false);
@@ -622,7 +628,9 @@ void PluginView::setNPWindowIfNeeded()
}
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow);
setCallingPlugin(false);
@@ -838,7 +846,9 @@ bool PluginView::platformStart()
if (m_plugin->pluginFuncs()->getvalue) {
PluginView::setCurrentPluginView(this);
+#if USE(JSC)
JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly);
+#endif
setCallingPlugin(true);
m_plugin->pluginFuncs()->getvalue(m_instance, NPPVpluginNeedsXEmbed, &m_needsXEmbed);
setCallingPlugin(false);
diff --git a/WebCore/plugins/win/PluginViewWin.cpp b/WebCore/plugins/win/PluginViewWin.cpp
index 84d2984..758d90a 100644
--- a/WebCore/plugins/win/PluginViewWin.cpp
+++ b/WebCore/plugins/win/PluginViewWin.cpp
@@ -520,7 +520,9 @@ bool PluginView::dispatchNPEvent(NPEvent& npEvent)
void PluginView::paintIntoTransformedContext(HDC hdc)
{
if (m_isWindowed) {
+#if !OS(WINCE)
SendMessage(platformPluginWidget(), WM_PRINTCLIENT, reinterpret_cast<WPARAM>(hdc), PRF_CLIENT | PRF_CHILDREN | PRF_OWNED);
+#endif
return;
}
@@ -1010,7 +1012,7 @@ void PluginView::platformDestroy()
PassRefPtr<Image> PluginView::snapshot()
{
-#if !PLATFORM(WX)
+#if !PLATFORM(WX) && !OS(WINCE)
OwnPtr<HDC> hdc(CreateCompatibleDC(0));
if (!m_isWindowed) {