Commit a55698b8 authored by alp@webkit.org's avatar alp@webkit.org

2008-05-01 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>

        Reviewed by Alp Toker.
        Qt parts OK'ed by Simon Hausmann.

        Based on work by several authors.

        https://bugs.webkit.org/show_bug.cgi?id=14750
        Added support for NPAPI plugins on Gtk and Qt-x11 ports.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32766 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8c3d7c7c
2008-05-01 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
Reviewed by Alp Toker.
https://bugs.webkit.org/show_bug.cgi?id=14750
Added support for NPAPI plugins on Gtk and Qt-x11 ports.
* GNUmakefile.am: Added Xt library.
2008-04-29 David Kilzer <ddkilzer@apple.com>
BUILD FIX for ENABLE(DASHBOARD_SUPPORT)
......
......@@ -246,6 +246,7 @@ endif
if TARGET_X11
global_cppflags += -DXP_UNIX
webcore_libadd += -lXt
endif
if !ENABLE_DEBUG
......
2008-05-01 Marc Ordinas i Llopis <marc.ordinasillopis@collabora.co.uk>
Reviewed by Alp Toker.
Qt parts OK'ed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=14750
Added support for NPAPI plugins on Gtk and Qt-x11 ports.
* GNUmakefile.am: Added Gtk plugin files.
* WebCore.pro: Added Qt plugins files, defined XP_UNIX and
ENABLE_NETSCAPE_PLUGIN_API
* bridge/npruntime_internal.h: Additional undefs that conflict
with Qt headers.
* page/gtk/FrameGtk.cpp: Create js bindings for PluginView.
(WebCore::Frame::createScriptInstanceForWidget):
* page/qt/FrameQt.cpp: Create js bindings for PluginView.
(WebCore::Frame::createScriptInstanceForWidget):
(WebCore::Frame::clearPlatformScriptObjects):
(WebCore::Frame::disconnectPlatformScriptObjects):
* platform/FileSystem.h: Qt FileSystem implementation.
* platform/Widget.h: Members to differentiate between Qt plugins and
NPAPI ones.
* platform/gtk/ScrollViewGtk.cpp:
(WebCore::ScrollView::addChild): Set containing window before calling setParent.
* platform/gtk/TemporaryLinkStubs.cpp: Removed implemented functions.
(PluginView::invalidateRegion):
* platform/qt/FileSystemQt.cpp: Implemented functions necessary for
NPAPI plugins.
(WebCore::openTemporaryFile):
(WebCore::closeFile):
(WebCore::writeToFile):
(WebCore::unloadModule): Delete module if unloaded.
* platform/qt/TemporaryLinkStubs.cpp: Removed implemented functions.
* platform/qt/WidgetQt.cpp: Differentiate between Qt plugins and
NPAPI ones.
(WebCore::WidgetPrivate::WidgetPrivate):
(WebCore::Widget::isNPAPIPlugin):
(WebCore::Widget::setIsNPAPIPlugin):
* plugins/PluginPackage.cpp:
(WebCore::PluginPackage::~PluginPackage): Unload the module before
destruction.
(WebCore::PluginPackage::compare): Moved here as it's platform
independent.
* plugins/PluginView.cpp: Moved platform-independent functions here.
(WebCore::PluginView::PluginView): Initialize m_npWindow.ws_info on
Unix platforms.
(WebCore::PluginView::freeStringArray):
(WebCore::startsWithBlankLine):
(WebCore::locationAfterFirstBlankLine):
(WebCore::findEOL):
(WebCore::capitalizeRFC822HeaderFieldName):
(WebCore::parseRFC822HeaderFields):
(WebCore::PluginView::handlePost):
* plugins/PluginView.h: Moved platform-independent functions here.
Added member to signal plugin needs XEmbed extension.
* plugins/gtk/PluginDataGtk.cpp: Added.
(WebCore::PluginData::initPlugins):
(WebCore::PluginData::refresh):
* plugins/gtk/PluginDatabaseGtk.cpp:
(WebCore::PluginDatabase::defaultPluginDirectories):
(WebCore::PluginDatabase::isPreferredPluginDirectory):
* plugins/gtk/PluginPackageGtk.cpp: Added.
(WebCore::PluginPackage::determineQuirks):
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):
(WebCore::PluginPackage::hash):
(WebCore::PluginPackage::equal):
(WebCore::PluginPackage::compareFileVersion):
* plugins/gtk/PluginViewGtk.cpp: Added.
(WebCore::PluginView::updateWindow):
(WebCore::PluginView::setFocus):
(WebCore::PluginView::show):
(WebCore::PluginView::hide):
(WebCore::PluginView::paint):
(WebCore::PluginView::handleKeyboardEvent):
(WebCore::PluginView::handleMouseEvent):
(WebCore::PluginView::setParent):
(WebCore::PluginView::setNPWindowRect):
(WebCore::PluginView::attachToWindow):
(WebCore::PluginView::detachFromWindow):
(WebCore::PluginView::stop):
(WebCore::PluginView::userAgent):
(WebCore::PluginView::handlePostReadFile):
(WebCore::PluginView::getValue):
(WebCore::PluginView::invalidateRect):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::~PluginView):
(WebCore::plug_removed_cb): Added callback to handle plug removal.
(WebCore::PluginView::init):
* plugins/gtk/xembed.h: Added.
* plugins/npapi.cpp:
(NPN_GetValue): Return error if no view present.
* plugins/qt/PluginDataQt.cpp:
(WebCore::PluginData::initPlugins):
(WebCore::PluginData::refresh):
* plugins/qt/PluginDatabaseQt.cpp: Added.
(WebCore::PluginDatabase::getPluginPathsInDirectories):
(WebCore::addQtWebKitPluginDirectories):
(WebCore::addMozillaPluginDirectories):
(WebCore::PluginDatabase::defaultPluginDirectories):
(WebCore::PluginDatabase::isPreferredPluginDirectory):
* plugins/qt/PluginPackageQt.cpp: Added.
(WebCore::PluginPackage::determineQuirks):
(WebCore::PluginPackage::fetchInfo):
(WebCore::PluginPackage::load):
(WebCore::PluginPackage::hash):
(WebCore::PluginPackage::equal):
(WebCore::PluginPackage::compareFileVersion):
* plugins/qt/PluginViewQt.cpp: Added.
(WebCore::PluginView::updateWindow):
(WebCore::PluginView::setFocus):
(WebCore::PluginView::show):
(WebCore::PluginView::hide):
(WebCore::PluginView::paint):
(WebCore::PluginView::handleKeyboardEvent):
(WebCore::PluginView::handleMouseEvent):
(WebCore::PluginView::setParent):
(WebCore::PluginView::setNPWindowRect):
(WebCore::PluginView::attachToWindow):
(WebCore::PluginView::detachFromWindow):
(WebCore::PluginView::stop):
(WebCore::PluginView::userAgent):
(WebCore::PluginView::handlePostReadFile):
(WebCore::PluginView::getValue):
(WebCore::PluginView::invalidateRect):
(WebCore::PluginView::invalidateRegion):
(WebCore::PluginView::forceRedraw):
(WebCore::PluginView::~PluginView):
(WebCore::PluginView::init):
* plugins/win/PluginPackageWin.cpp: Moved platform-independent code
to plugins/PluginPackage.cpp
* plugins/win/PluginViewWin.cpp: Moved platform-independent code to
plugins/PluginView.cpp
(WebCore::PluginView::stop):
(WebCore::PluginView::handlePostReadFile):
(WebCore::PluginView::getValue): Moved this function to each platform.
2008-05-01 Sam Weinig <sam@webkit.org>
Fix build.
......@@ -924,7 +924,10 @@ webcore_sources += \
WebCore/plugins/PluginStream.cpp \
WebCore/plugins/PluginView.cpp \
WebCore/plugins/npapi.cpp \
WebCore/plugins/gtk/PluginDataGtk.cpp \
WebCore/plugins/gtk/PluginDatabaseGtk.cpp \
WebCore/plugins/gtk/PluginPackageGtk.cpp \
WebCore/plugins/gtk/PluginViewGtk.cpp \
WebCore/rendering/AutoTableLayout.cpp \
WebCore/rendering/bidi.cpp \
WebCore/rendering/break_lines.cpp \
......@@ -986,6 +989,10 @@ webcore_sources += \
WebCore/xml/XMLHttpRequest.cpp \
WebCore/xml/XMLHttpRequestProgressEvent.cpp \
WebCore/xml/XMLSerializer.cpp
if TARGET_X11
webcore_sources += \
WebCore/plugins/gtk/gtk2xtbin.c
endif
webkitgtk_headers += \
WebCore/platform/gtk/ClipboardGtk.h \
......
......@@ -122,6 +122,10 @@ include($$PWD/../JavaScriptCore/JavaScriptCore.pri)
#LIBS += -L$$OUTPUT_DIR/lib -lJavaScriptCore
qt-port {
unix {
DEFINES += XP_UNIX ENABLE_NETSCAPE_PLUGIN_API=1
}
RESOURCES += \
$$PWD/../WebCore/page/inspector/WebKit.qrc \
$$PWD/../WebCore/Resources/WebKitResources.qrc
......@@ -1050,7 +1054,12 @@ qt-port {
../WebKit/qt/Api/qwebhistoryinterface.cpp \
../WebKit/qt/Api/qwebpluginfactory.cpp
unix: SOURCES += platform/qt/SystemTimeQt.cpp
unix: {
SOURCES += platform/qt/SystemTimeQt.cpp \
plugins/qt/PluginDatabaseQt.cpp \
plugins/qt/PluginPackageQt.cpp \
plugins/qt/PluginViewQt.cpp
}
else: SOURCES += platform/win/SystemTimeWin.cpp
# Files belonging to the Qt 4.3 build
......@@ -1069,6 +1078,7 @@ qt-port {
}
gtk-port {
INCLUDEPATH += ../WebCore/plugins/gtk
HEADERS += \
../WebCore/platform/gtk/ClipboardGtk.h \
../WebCore/platform/gtk/PasteboardHelper.h \
......
/*
* Copyright (C) 2007 Collabora, Ltd. All rights reserved.
* Copyright (C) 2007-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 Lesser General Public
......@@ -38,4 +38,13 @@
#undef Auto
#undef Complex
#undef Status
#undef CursorShape
#undef FocusIn
#undef FocusOut
#undef KeyPress
#undef KeyRelease
#undef Unsorted
#undef Bool
#undef FontChange
#undef GrayScale
#endif
......@@ -2,6 +2,7 @@
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
......@@ -30,15 +31,21 @@
#include "Frame.h"
#include "NotImplemented.h"
#include "PluginView.h"
#include "kjs_proxy.h"
#include "runtime_root.h"
#include "runtime.h"
namespace WebCore {
PassRefPtr<KJS::Bindings::Instance> Frame::createScriptInstanceForWidget(Widget*)
PassRefPtr<KJS::Bindings::Instance> Frame::createScriptInstanceForWidget(Widget* widget)
{
notImplemented();
return 0;
// FIXME: Ideally we'd have an isPluginView() here but we can't add that to the open source tree right now.
if (widget->isFrameView())
return 0;
return static_cast<PluginView*>(widget)->bindingInstance();
}
void Frame::clearPlatformScriptObjects()
......
......@@ -6,6 +6,7 @@
* Copyright (C) 2006 Rob Buis <buis@kde.org>
* Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
* Copyright (C) 2007 Trolltech ASA
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
*
* All rights reserved.
*
......@@ -34,6 +35,8 @@
#include "config.h"
#include "Frame.h"
#include "PluginView.h"
#include "Element.h"
#include "RenderObject.h"
#include "RenderWidget.h"
......@@ -99,6 +102,11 @@ static void doScroll(const RenderObject* r, bool isHorizontal, int multiplier)
PassRefPtr<KJS::Bindings::Instance> Frame::createScriptInstanceForWidget(WebCore::Widget* widget)
{
if (widget->isFrameView())
return 0;
if (widget->isNPAPIPlugin())
return static_cast<PluginView*>(widget)->bindingInstance();
QWidget* nativeWidget = widget->nativeWidget();
if (!nativeWidget)
return 0;
......@@ -107,10 +115,12 @@ PassRefPtr<KJS::Bindings::Instance> Frame::createScriptInstanceForWidget(WebCore
void Frame::clearPlatformScriptObjects()
{
notImplemented();
}
void Frame::disconnectPlatformScriptObjects()
{
notImplemented();
}
DragImageRef Frame::dragImageForSelection()
......
......@@ -33,6 +33,10 @@
#if PLATFORM(GTK)
#include <gmodule.h>
#endif
#if PLATFORM(QT)
#include <QFile>
#include <QLibrary>
#endif
#include <time.h>
......@@ -67,6 +71,11 @@ struct PlatformModuleVersion {
}
};
#elif PLATFORM(QT)
typedef QFile* PlatformFileHandle;
typedef QLibrary* PlatformModule;
const PlatformFileHandle invalidPlatformFileHandle = 0;
typedef unsigned PlatformModuleVersion;
#else
typedef int PlatformFileHandle;
#if PLATFORM(GTK)
......
......@@ -176,6 +176,9 @@ protected:
void setNativeWidget(QWidget *widget);
QWidget* nativeWidget() const;
void setIsNPAPIPlugin(bool);
bool isNPAPIPlugin() const;
virtual void setParent(ScrollView*);
ScrollView* parent() const;
virtual void geometryChanged() const;
......
......@@ -469,11 +469,11 @@ void ScrollView::setFrameGeometry(const IntRect& newGeometry)
void ScrollView::addChild(Widget* child)
{
child->setParent(this);
child->setContainingWindow(containingWindow());
child->setParent(this);
m_data->children.add(child);
if (child->gtkWidget())
if (child->gtkWidget() && !GTK_IS_SOCKET(child->gtkWidget()))
gtk_container_add(GTK_CONTAINER(containingWindow()), child->gtkWidget());
}
......
......@@ -33,8 +33,6 @@
#include "FTPDirectoryDocument.h"
#include "KURL.h"
#include "NotImplemented.h"
#include "PluginPackage.h"
#include "PluginData.h"
#include "PluginView.h"
#include "SharedBuffer.h"
......@@ -58,28 +56,7 @@ Vector<char> loadResourceIntoArray(const char* resourceName)
/* Completely empty stubs (mostly to allow DRT to run): */
/********************************************************/
int PluginPackage::compare(const PluginPackage&) const { notImplemented(); return 0; }
bool PluginPackage::fetchInfo() { notImplemented(); return false; }
unsigned PluginPackage::hash() const { notImplemented(); return 0; }
bool PluginPackage::equal(const PluginPackage&, const PluginPackage&) { notImplemented(); return false; }
bool PluginPackage::load() { notImplemented(); return false; }
void PluginView::setNPWindowRect(const IntRect&) { notImplemented(); }
const char* PluginView::userAgent() { notImplemented(); return 0; }
void PluginView::invalidateRect(NPRect*) { notImplemented(); }
void PluginView::invalidateRegion(NPRegion) { notImplemented(); }
void PluginView::forceRedraw() { notImplemented(); }
void PluginView::setFocus() { Widget::setFocus(); }
void PluginView::show() { Widget::show(); }
void PluginView::hide() { Widget::hide(); }
void PluginView::paint(GraphicsContext*, const IntRect&) { notImplemented(); }
void PluginView::setParent(ScrollView* view) { Widget::setParent(view); }
void PluginView::attachToWindow() { notImplemented(); }
void PluginView::detachFromWindow() { notImplemented(); }
NPError PluginView::handlePost(const char*, const char*, uint32, const char*, bool, void*, bool, bool) { notImplemented(); return NPERR_GENERIC_ERROR; }
void PluginView::updateWindow() const { notImplemented(); }
void PluginView::handleKeyboardEvent(KeyboardEvent*) { notImplemented(); }
void PluginView::handleMouseEvent(MouseEvent*) { notImplemented(); }
PluginView::~PluginView() {}
Color WebCore::focusRingColor() { return 0xFF0000FF; }
void WebCore::setFocusRingColorChangeFunction(void (*)()) { }
......@@ -93,8 +70,5 @@ String KURL::fileSystemPath() const { notImplemented(); return String(); }
PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&) { notImplemented(); return 0; }
void PluginData::initPlugins() { notImplemented(); }
void PluginData::refresh() { notImplemented(); }
}
......@@ -38,7 +38,9 @@
#include <QDateTime>
#include <QFile>
#include <QTemporaryFile>
#include <QFileInfo>
#include <QDateTime>
#include <QDir>
namespace WebCore {
......@@ -90,14 +92,39 @@ String pathGetFileName(const String& path)
String directoryName(const String& path)
{
notImplemented();
return String();
return String(QFileInfo(path).baseName());
}
CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
{
QFile *temp = new QTemporaryFile(QString(prefix));
if( temp->open(QIODevice::ReadWrite) ) {
handle = temp;
return String(temp->fileName()).utf8();
}
handle = invalidPlatformFileHandle;
return 0;
}
void closeFile(PlatformFileHandle& handle)
{
if(handle) {
handle->close();
delete handle;
}
}
int writeToFile(PlatformFileHandle handle, const char* data, int length)
{
if(handle && handle->exists() && handle->isWritable()) {
handle->write(data, length);
}
}
bool unloadModule(PlatformModule)
bool unloadModule(PlatformModule module)
{
notImplemented();
return false;
if (module->unload())
delete module;
}
}
......
......@@ -72,41 +72,11 @@
using namespace WebCore;
void PluginDatabase::getPluginPathsInDirectories(HashSet<String>&) const { notImplemented(); }
Vector<String> PluginDatabase::defaultPluginDirectories() { notImplemented(); return Vector<String>(); }
bool PluginDatabase::isPreferredPluginDirectory(const String&) { notImplemented(); return false; }
int PluginPackage::compare(const PluginPackage&) const { notImplemented(); return 0; }
bool PluginPackage::fetchInfo() { notImplemented(); return false; }
unsigned PluginPackage::hash() const { notImplemented(); return 0; }
bool PluginPackage::equal(const PluginPackage&, const PluginPackage&) { notImplemented(); return false; }
bool PluginPackage::load() { notImplemented(); return false; }
void PluginView::setNPWindowRect(const IntRect&) { notImplemented(); }
const char* PluginView::userAgent() { notImplemented(); return 0; }
void PluginView::invalidateRect(NPRect*) { notImplemented(); }
void PluginView::invalidateRegion(NPRegion) { notImplemented(); }
void PluginView::forceRedraw() { notImplemented(); }
void PluginView::setFocus() { Widget::setFocus(); }
void PluginView::show() { Widget::show(); }
void PluginView::hide() { Widget::hide(); }
void PluginView::paint(GraphicsContext*, const IntRect&) { notImplemented(); }
void PluginView::setParent(ScrollView* view) { Widget::setParent(view); }
void PluginView::attachToWindow() { notImplemented(); }
void PluginView::detachFromWindow() { notImplemented(); }
NPError PluginView::handlePost(const char*, const char*, uint32, const char*, bool, void*, bool, bool) { notImplemented(); return NPERR_GENERIC_ERROR; }
void PluginView::updateWindow() const { notImplemented(); }
void PluginView::handleKeyboardEvent(KeyboardEvent*) { notImplemented(); }
void PluginView::handleMouseEvent(MouseEvent*) { notImplemented(); }
PluginView::~PluginView() {}
namespace WebCore {
Vector<String> supportedKeySizes() { notImplemented(); return Vector<String>(); }
String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) { return String(); }
CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle) { notImplemented(); handle = invalidPlatformFileHandle; return 0; }
void closeFile(PlatformFileHandle&) { notImplemented(); };
int writeToFile(PlatformFileHandle, const char* data, int length) { return -1; };
#if !defined(Q_OS_WIN)
// defined in win/SystemTimeWin.cpp, which is compiled for the Qt/Windows port
float userIdleTime() { notImplemented(); return 0.0; }
......
......@@ -62,6 +62,7 @@ struct WidgetPrivate
, enabled(true)
, suppressInvalidation(false)
, m_widget(0)
, isNPAPIPlugin(0)
, m_parentScrollView(0) { }
~WidgetPrivate() {}
......@@ -69,6 +70,7 @@ struct WidgetPrivate
bool enabled;
bool suppressInvalidation;
bool isNPAPIPlugin;
IntRect m_geometry;
QWidget *m_widget; //for plugins
ScrollView *m_parentScrollView;
......@@ -142,6 +144,16 @@ void Widget::setNativeWidget(QWidget *widget)
data->m_widget = widget;
}
bool Widget::isNPAPIPlugin() const
{
return data->isNPAPIPlugin;
}
void Widget::setIsNPAPIPlugin(bool is)
{
data->isNPAPIPlugin = is;
}
void Widget::paint(GraphicsContext *, const IntRect &rect)
{
}
......
/*
* Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora, Ltd. All rights reserved.
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -27,16 +27,30 @@
#include "config.h"
#include "PluginPackage.h"
#include "CString.h"
#include "MIMETypeRegistry.h"
#include "PluginDatabase.h"
#include "PluginDebug.h"
#include "Timer.h"
#include "npruntime_impl.h"
#include <string.h>
#include <wtf/OwnArrayPtr.h>
namespace WebCore {
PluginPackage::~PluginPackage()
{
// This destructor gets called during refresh() if PluginDatabase's
// PluginSet hash is already populated, as it removes items from
// the hash table. Calling the destructor on a loaded plug-in of
// course would cause a crash, so we check to call unload before we
// ASSERT.
// FIXME: There is probably a better way to fix this.
if (m_loadCount == 0)
unloadWithoutShutdown();
else
unload();
ASSERT(!m_isLoaded);
}
......@@ -58,6 +72,31 @@ void PluginPackage::freeLibraryTimerFired(Timer<PluginPackage>*)
m_module = 0;
}
int PluginPackage::compare(const PluginPackage& compareTo) const
{
// Sort plug-ins that allow multiple instances first.
bool AallowsMultipleInstances = !quirks().contains(PluginQuirkDontAllowMultipleInstances);
bool BallowsMultipleInstances = !compareTo.quirks().contains(PluginQuirkDontAllowMultipleInstances);
if (AallowsMultipleInstances != BallowsMultipleInstances)
return AallowsMultipleInstances ? -1 : 1;
// Sort plug-ins in a preferred path first.
bool AisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(parentDirectory());
bool BisInPreferredDirectory = PluginDatabase::isPreferredPluginDirectory(compareTo.parentDirectory());
if (AisInPreferredDirectory != BisInPreferredDirectory)
return AisInPreferredDirectory ? -1 : 1;
int diff = strcmp(name().utf8().data(), compareTo.name().utf8().data());
if (diff)
return diff;
if (diff = compareFileVersion(compareTo.version()))
return diff;
return strcmp(parentDirectory().utf8().data(), compareTo.parentDirectory().utf8().data());
}
PluginPackage::PluginPackage(const String& path, const time_t& lastModified)
: m_path(path)
, m_moduleVersion(0)
......
......@@ -103,10 +103,10 @@ namespace WebCore {
};
struct PluginPackageHash {
static unsigned hash(const int key) { return reinterpret_cast<PluginPackage*>(key)->hash(); }
static unsigned hash(const uintptr_t key) { return reinterpret_cast<PluginPackage*>(key)->hash(); }
static unsigned hash(const RefPtr<PluginPackage>& key) { return key->hash(); }
static bool equal(const int a, const int b) { return equal(reinterpret_cast<PluginPackage*>(a), reinterpret_cast<PluginPackage*>(b)); }
static bool equal(const uintptr_t a, const uintptr_t b) { return equal(reinterpret_cast<PluginPackage*>(a), reinterpret_cast<PluginPackage*>(b)); }
static bool equal(const RefPtr<PluginPackage>& a, const RefPtr<PluginPackage>& b) { return PluginPackage::equal(*a.get(), *b.get()); }
static const bool safeToCompareToEmptyOrDeleted = false;
};
......
This diff is collapsed.
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Collabora, Ltd. All rights reserved.
* Copyright (C) 2008 Collabora Ltd. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -171,6 +171,8 @@ namespace WebCore {
static void setCurrentPluginView(PluginView*);
NPError load(const FrameLoadRequest&, bool sendNotification, void* notifyData);
NPError handlePost(const char* url, const char* target, uint32 len, const char* buf, bool file, void* notifyData, bool sendNotification, bool allowHeaders);
NPError handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf);
static void freeStringArray(char** stringArray, int length);
void setCallingPlugin(bool) const;
RefPtr<PluginPackage> m_plugin;
Element* m_element;
......@@ -221,6 +223,10 @@ namespace WebCore {
bool m_attachedToWindow;
bool m_haveInitialized;
#if PLATFORM(GTK) || defined(Q_WS_X11)
bool m_needsXEmbed;
#endif
#if PLATFORM(WIN)
OwnPtr<PluginMessageThrottlerWin> m_messageThrottler;
WNDPROC m_pluginWndProc;
......
/*
Copyright (C) 2008 Trolltech ASA
Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
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 <stdio.h>