diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-09-18 08:35:59 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-09-18 08:38:07 (GMT) |
commit | ef310719ef42cd09e2542fce96c529b5657bf167 (patch) | |
tree | c691bab10518e479ce40d4cac6c79daa312fce87 /src/3rdparty/webkit/WebCore/plugins | |
parent | 5b828316abb0ad1a33cdc11ebac0999d9b79576a (diff) | |
download | Qt-ef310719ef42cd09e2542fce96c529b5657bf167.zip Qt-ef310719ef42cd09e2542fce96c529b5657bf167.tar.gz Qt-ef310719ef42cd09e2542fce96c529b5657bf167.tar.bz2 |
Updated WebKit from /home/joce/dev/qtwebkit/ to qtwebkit-4.6-snapshot-18092009 ( 15c07fb8d7fa5e93c939aa7eb21c06e19c754cee )
Changes in WebKit/qt since the last update:
++ b/WebKit/qt/ChangeLog
2009-09-17 Janne Koskinen <janne.p.koskinen@digia.com>
Reviewed by Simon Hausmann.
Symbian build fix.
Moved the #ifdefs around _q_cleanupLeakMessages() into the function
definition.
QMake is not being able to distinguish between release and debug builds
in Symbian build. This is a Symbian toolchain issue.
* Api/qwebpage.cpp:
(QWebPagePrivate::_q_cleanupLeakMessages):
* Api/qwebpage.h:
* Api/qwebpage_p.h:
2009-09-17 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
Small cosmetic documentation fixlet in the QWebInspector.
* Api/qwebinspector.cpp:
2009-09-16 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Reviewed by Eric Seidel.
Detect and add Windows7 properly to the user agent.
* Api/qwebpage.cpp:
(QWebPage::userAgentForUrl):
2009-09-16 Andras Becsi <andrewbecsi@yahoo.co.uk>
Rubberstamped by Kenneth Christiansen.
[Qt] Build fix for previous changes.
* QGVLauncher/main.cpp:
(MainView::flip):
2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
Unreviewed potential Qt < 4.6 build fix.
* QGVLauncher/main.cpp:
(MainView::flip):
2009-09-16 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Add a "Flip effect" to our GraphicsView based launcher.
* QGVLauncher/main.cpp:
(MainView::resizeEvent):
(MainView::flip):
(MainWindow::flip):
(MainWindow::buildUI):
2009-09-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
Rubber-stamped by Simon Hausmann.
[Qt] Typo fix. Pass the window object to the Format
menu. In this way Qt can free its internal graphical
objects during exit.
* QtLauncher/main.cpp:
(MainWindow::setupUI):
2009-09-16 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Tor Arne Vestbø.
[Qt] Build break fix on gcc ARM.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItemPrivate::_q_doLoadProgress):
2009-09-16 Warwick Allison <warwick.allison@nokia.com>
Reviewed by Simon Hausmann.
Fix a crash in QWebFrame::hasFocus() with a simple null pointer check
when the focused frame is null. We do the same check in other places
where we call kit().
* Api/qwebframe.cpp:
(QWebFrame::hasFocus):
2009-09-16 Jure Repinc <jlp@holodeck1.com>
Reviewed by Simon Hausmann.
Fixed a typo found during translation.
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::interruptForPolicyChangeError):
2009-09-14 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
[Qt] QWebGraphicsItem should check for null QWebPage.
https://bugs.webkit.org/show_bug.cgi?id=29185
Don't crash in QWebGraphicsItem when the page is still null, by
either checking if it's the case or constructing the default one.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItem::icon):
(QWebGraphicsItem::setZoomFactor):
(QWebGraphicsItem::zoomFactor):
(QWebGraphicsItem::setGeometry):
(QWebGraphicsItem::load):
(QWebGraphicsItem::setHtml):
(QWebGraphicsItem::toHtml):
(QWebGraphicsItem::setContent):
(QWebGraphicsItem::history):
(QWebGraphicsItem::settings):
2009-09-11 David Boddie <dboddie@trolltech.com>
Reviewed by Simon Hausmann.
Doc: Note that Netscape plugins are only available on desktop platforms.
* docs/qtwebkit.qdoc:
2009-09-11 Martin Smith <msmith@trolltech.com>
Reviewed by Simon Hausmann.
Adjust the name of the contentspage for the documentation
to the new name used in Qt 4.6.
* docs/qtwebkit.qdoc:
2009-09-11 Ariya Hidayat <ariya.hidayat@nokia.com>
Reviewed by Simon Hausmann.
Changed URLs from qtsoftware.com to qt.nokia.com, as part of a general
renaming.
* Api/qwebpluginfactory.cpp:
* docs/webkitsnippets/simple/main.cpp:
(main):
* docs/webkitsnippets/webpage/main.cpp:
(main):
2009-09-11 Volker Hilsheimer <volker.hilsheimer@nokia.com>
Reviewed by Simon Hausmann.
Restructure the documentation, both on a file and on a content level.
* Api/qwebdatabase.cpp:
* Api/qwebelement.cpp:
* Api/qwebframe.cpp:
* Api/qwebhistory.cpp:
* Api/qwebhistoryinterface.cpp:
* Api/qwebpage.cpp:
* Api/qwebpluginfactory.cpp:
* Api/qwebsecurityorigin.cpp:
* Api/qwebsettings.cpp:
* Api/qwebview.cpp:
* docs/qtwebkit.qdoc:
2009-09-11 Yongjun Zhang <yongjun.zhang@nokia.com>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=29136
[Qt] emit microFocusChanged() signal when no QWidget-based view is present.
emit microFocusChange() signal regardless of view.
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::setInputMethodState):
2009-09-11 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=28806
[Qt] Make the WebInspector available as a QWidget.
* Api/headers.pri:
* Api/qwebelement.cpp:
(QWebElement::enclosingElement):
* Api/qwebelement.h:
* Api/qwebinspector.cpp: Added.
* Api/qwebinspector.h: Added.
* Api/qwebinspector_p.h: Added.
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
(QWebPagePrivate::setInspector):
(QWebPagePrivate::getOrCreateInspector):
(QWebPagePrivate::inspectorController):
(QWebPage::~QWebPage):
(QWebPage::triggerAction):
* Api/qwebpage.h:
* Api/qwebpage_p.h:
* Api/qwebsettings.cpp:
* QtLauncher/main.cpp:
(MainWindow::MainWindow):
* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorClientWebPage::InspectorClientWebPage):
(WebCore::InspectorClientWebPage::createWindow):
(WebCore::InspectorClientQt::createPage):
(WebCore::InspectorClientQt::showWindow):
(WebCore::InspectorClientQt::closeWindow):
(WebCore::InspectorClientQt::attachWindow):
(WebCore::InspectorClientQt::detachWindow):
(WebCore::InspectorClientQt::updateWindowTitle):
* WebCoreSupport/InspectorClientQt.h:
* docs/webkitsnippets/qtwebkit_qwebinspector_snippet.cpp: Added.
2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Eric Seidel.
[Qt] Fix comparison between signed and unsigned integer warnings
https://bugs.webkit.org/show_bug.cgi?id=29162
No functional change.
* Api/qwebelement.cpp:
(QWebElement::findAll):
* Api/qwebhistory.cpp:
(QWebHistory::items):
(QWebHistory::backItems):
(QWebHistory::forwardItems):
(QWebHistory::saveState):
* Api/qwebplugindatabase.cpp:
(QWebPluginDatabase::setSearchPaths):
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::runOpenPanel):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::createPlugin):
2009-09-10 Simon Hausmann <hausmann@webkit.org>
Rubber-stamped by Ariya Hidayat.
Fix a bunch of qdoc warnings: Invalid references, non-standard
wording, etc.
* Api/qwebelement.cpp:
* Api/qwebgraphicsitem.cpp:
* Api/qwebsecurityorigin.cpp:
2009-09-10 Simon Hausmann <hausmann@webkit.org>
Reviewed by Ariya Hidayat.
Fix context menu event delivery with QWebGraphicsItem.
Re-implement the correct context menu virtual function using
a QGraphicsSceneContextMenuEvent and forward & handle it in
QWebPage.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItem::contextMenuEvent):
* Api/qwebgraphicsitem.h:
* Api/qwebpage.cpp:
(QWebPagePrivate::contextMenuEvent):
(QWebPage::event):
* Api/qwebpage_p.h:
2009-09-10 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Unreviewed.
Build fix for QtWebKit for Mac after r48219.
qevent and qstyleoption are QtGui interfaces.
* Api/qwebgraphicsitem.cpp:
* Api/qwebgraphicsitem.h:
2009-09-09 Simon Hausmann <hausmann@webkit.org>
Reviewed by Tor Arne Vestbø.
Call the right base class function QGraphicsWidget::event() instead
of skipping it and using QObject::event() instead.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItem::event):
2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
Unreviewed.
Fix comment at Tor Arne Vestbø's request.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItem::sceneEvent):
(QWebGraphicsItem::event):
2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Tor Arne Vestbø.
Implement some virtual event methods so that we can fix
event-related bugs in Qt patch releases.
* Api/qwebgraphicsitem.cpp:
(QWebGraphicsItem::sceneEvent):
(QWebGraphicsItem::event):
* Api/qwebgraphicsitem.h:
2009-09-09 Kenneth Rohde Christiansen <kenneth@webkit.org>, Antonio Gomes <antonio.gomes@openbossa.org>
Reviewed by Simon Hausmann.
Add a new QGraphicsWidget based version of the "QWebView"
under the name "QWebGraphicsItem".
https://bugs.webkit.org/show_bug.cgi?id=28862
Includes an alternative Qt launcher using the QGraphicsView.
* Api/headers.pri:
* Api/qwebgraphicsitem.cpp: Added.
* Api/qwebgraphicsitem.h: Added.
* Api/qwebpage.h:
* QGVLauncher/QGVLauncher.pro: Copied from WebKit/qt/QtLauncher/QtLauncher.pro.
* QGVLauncher/main.cpp: Added.
* WebCoreSupport/ChromeClientQt.cpp:
(WebCore::ChromeClientQt::repaint):
(WebCore::ChromeClientQt::scroll):
2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
Unreviewed build fix.
Potential build fix for Qt 4.5
* Api/qwebpage.cpp:
(QWebPagePrivate::mousePressEvent):
2009-09-08 Benjamin Poulain <benjamin.poulain@nokia.com>
Reviewed by Simon Hausmann.
https://bugs.webkit.org/show_bug.cgi?id=29007
Add a test for the signal QWebFrame::javaScriptWindowObjectCleared()
* tests/qwebframe/tst_qwebframe.cpp:
2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Fix unused variable warnings
https://bugs.webkit.org/show_bug.cgi?id=29018
* Api/qwebpage.cpp:
(QWebPagePrivate::keyPressEvent):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::startDownload):
(WebCore::FrameLoaderClientQt::createFrame):
2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Ariya Hidayat.
[Qt] Use the declaration order in initializer lists
https://bugs.webkit.org/show_bug.cgi?id=29017
* Api/qwebframe_p.h:
2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
Add support for handling QGraphicsScene events.
* Api/qwebpage.cpp:
(QWebPagePrivate::mouseMoveEvent):
(QWebPagePrivate::mousePressEvent):
(QWebPagePrivate::mouseDoubleClickEvent):
(QWebPagePrivate::mouseTripleClickEvent):
(QWebPagePrivate::handleClipboard):
(QWebPagePrivate::mouseReleaseEvent):
(QWebPagePrivate::wheelEvent):
(QWebPagePrivate::dragEnterEvent):
(QWebPagePrivate::dragLeaveEvent):
(QWebPagePrivate::dragMoveEvent):
(QWebPagePrivate::dropEvent):
(QWebPage::event):
* Api/qwebpage_p.h:
2009-09-08 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Simon Hausmann.
[Qt] Make cursor set cleaner in QtWebKit Api: eliminate SetCursorEvent hack.
https://bugs.webkit.org/show_bug.cgi?id=28865
Clean up the unserCursor hack to use the QCursor set
as a property of the QWidget by WebCore::WidgetQt.
Remove all code that are no longer necessary for getting
cursor change events.
Patch by Kenneth Rohde Christiansen <kenneth@webkit.org> and
Antonio Gomes <antonio.gomes@openbossa.org> on 2009-09-07
* Api/qwebpage.cpp:
* Api/qwebpage_p.h:
* Api/qwebview.cpp:
(QWebViewPrivate::QWebViewPrivate):
(QWebView::event):
2009-09-08 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Simon Hausmann.
[Qt] QtWebKit single API to enable persistency
https://bugs.webkit.org/show_bug.cgi?id=28682
Disable LocalStorage, ApplicationCache, HTML5 offline storage by
default.
If persistency is enabled the default directory for LocalStorage and
ApplicationCache is now based on QDesktopServices::DataLocation and not
QDesktopServices::CacheLocation (as it is expected to keep this data
around after a reboot).
If persistency is enabled initialize HTML5 offline storage as well - this
fixed offline Storage for QtLauncher.
* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate):
* Api/qwebsettings.cpp:
(QWebSettings::QWebSettings):
(QWebSettings::enablePersistentStorage):
* Api/qwebsettings.h: Add a new API called enablePersistentStorage
* QtLauncher/main.cpp: Use the new enablePersistentStorage API
(main):
2009-09-07 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
Speed up the QWebPluginInfo::supportsMimeType() function.
https://bugs.webkit.org/show_bug.cgi?id=27651
Instead of going through the MIME types list constructed with
mimeTypes() function, look up the internal mimeToDescriptions map.
* Api/qwebplugindatabase.cpp:
(QWebPluginInfo::supportsMimeType):
2009-09-07 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
Speed up the QWebPluginInfo::mimeTypes() function.
https://bugs.webkit.org/show_bug.cgi?id=27651
Instead of constructing a list of MIME types every time it is called,
do this only once.
* Api/qwebplugindatabase.cpp:
(QWebPluginInfo::mimeTypes):
(QWebPluginInfo::operator=):
* Api/qwebplugindatabase.h:
* tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
(tst_QWebPluginDatabase::operatorassign_data):
(tst_QWebPluginDatabase::operatorassign):
2009-09-07 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
Remove the private classes from QWebPluginDatabase.
https://bugs.webkit.org/show_bug.cgi?id=27651
Instead, hold the PluginDatabase and PluginPackage objects as class
members and take care of refcounting on our own instead of using RefPtr.
This way we not only made the code cleaner but also got rid of
redundant allocations when constructing null QWebPluginInfo objects.
The private classes have been forward-declared and the d-pointers left
to be on the safe side.
* Api/qwebplugindatabase.cpp:
(QWebPluginInfo::QWebPluginInfo):
(QWebPluginInfo::~QWebPluginInfo):
(QWebPluginInfo::name):
(QWebPluginInfo::description):
(QWebPluginInfo::mimeTypes):
(QWebPluginInfo::path):
(QWebPluginInfo::isNull):
(QWebPluginInfo::setEnabled):
(QWebPluginInfo::isEnabled):
(QWebPluginInfo::operator==):
(QWebPluginInfo::operator!=):
(QWebPluginInfo::operator=):
(QWebPluginDatabase::QWebPluginDatabase):
(QWebPluginDatabase::~QWebPluginDatabase):
(QWebPluginDatabase::plugins):
(QWebPluginDatabase::searchPaths):
(QWebPluginDatabase::setSearchPaths):
(QWebPluginDatabase::addSearchPath):
(QWebPluginDatabase::refresh):
(QWebPluginDatabase::pluginForMimeType):
(QWebPluginDatabase::setPreferredPluginForMimeType):
* Api/qwebplugindatabase.h:
* Api/qwebplugindatabase_p.h: Removed.
2009-09-05 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Eric Seidel.
[Qt] r47424 broke binary compatibility
https://bugs.webkit.org/show_bug.cgi?id=28996
Append the new DnsPrefetchEnabled attribute at the end of the enum.
* Api/qwebsettings.h:
2009-09-04 Mark Mentovai <mark@chromium.org>
Reviewed by Dave Hyatt.
https://bugs.webkit.org/show_bug.cgi?id=28614
Account for scrollbar state changes that occur during layout.
* Api/qwebframe.cpp:
(QWebFrame::setScrollBarPolicy):
Eliminate duplicated (and incorrect) scrollbar mode tracking between
FrameView and ScrollView.
2009-09-04 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Eric Seidel.
[Qt] Fix tst_QWebPage::database autotest failure
https://bugs.webkit.org/show_bug.cgi?id=28961
Make sure that the test case enables the feature before
the feature gets tested
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::database):
2009-09-04 Benjamin C Meyer <benjamin.meyer@torchmobile.com>
Reviewed by Eric Seidel.
Any QtWebKit application crashes on exit if the inspector is
used during the session rather then exiting.
If a QWebView has a QWebPage that is destroyed the QWebView
does not update its pointer and will crash the next time
it access the page pointers (such as in its destructor).
InspectorClientView should not call deleteLater when the page
is destroyed because it does not have a parent and is a top
level widget. close() needs to be called so that QApplication
can exit the application if quitOnLastWindowClosed is set
and a InspectorClientView is the last window, otherwise
the application will never exit.
* Api/qwebview.cpp:
(QWebViewPrivate::_q_pageDestroyed):
(QWebView::setPage):
* Api/qwebview.h:
* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorClientView::InspectorClientView):
2009-09-03 Adam Barth <abarth@webkit.org>
Reviewed by eric@webkit.org.
https://bugs.webkit.org/show_bug.cgi?id=24696
Stub implementations of mixed content methods of FrameLoaderClient.
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::didDisplayInsecureContent):
(WebCore::FrameLoaderClientQt::didRunInsecureContent):
* WebCoreSupport/FrameLoaderClientQt.h:
2009-09-03 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Eric Seidel.
[Qt] Add a setting to turn SessionStorage on/off
https://bugs.webkit.org/show_bug.cgi?id=28836
* Api/qwebsettings.cpp:
(QWebSettingsPrivate::apply):
(QWebSettings::QWebSettings):
* Api/qwebsettings.h:
* tests/qwebpage/tst_qwebpage.cpp:
(testFlag):
(tst_QWebPage::testOptionalJSObjects):
2009-09-02 Richard Moore <rich@kde.org>
Reviewed by Tor Arne Vestbø.
[Qt] Make sure we relayout the page after evaluating JS
https://bugs.webkit.org/show_bug.cgi?id=28235
QtWebKit does not always seem to reflow the page when evaluating
javascript. This patch changes the way evaluateJavaScript works to
use the frameloader which ensures that this is done properly.
* Api/qwebframe.cpp:
(QWebFrame::evaluateJavaScript):
* tests/qwebframe/tst_qwebframe.cpp:
2009-08-28 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Reviewed by Holger Freyther.
https://bugs.webkit.org/show_bug.cgi?id=25889
[GTK] scrollbar policy for main frame is not implementable
Add empty implementation for new ChromeClient method.
* WebCoreSupport/ChromeClientQt.h:
(WebCore::ChromeClientQt::scrollbarsModeDidChange):
2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed by Ariya Hidayat.
QWebHistory::clear() modifications.
Clear() method was changed. If QWebHistory is empty (there is no
elements even current) clear() do nothing. If there at least one
element clear() will delete everything apart of current.
New autotests in QWebHistory
New autotests were added to QWebHistory. They should check some crashes
in save and restore state process and clear() method and general
behavior on where QWebHistory::count() == 0 or QWebHistory::count() == 1
Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=28711
* Api/qwebhistory.cpp:
(QWebHistory::clear):
* tests/qwebhistory/tst_qwebhistory.cpp:
(tst_QWebHistory::back):
(tst_QWebHistory::forward):
(tst_QWebHistory::saveAndRestore_crash_1):
(tst_QWebHistory::saveAndRestore_crash_2):
(tst_QWebHistory::saveAndRestore_crash_3):
(tst_QWebHistory::clear):
2009-08-27 Jedrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed by Ariya Hidayat.
[Qt] Cleanup, old and commented part of source code was removed.
Fix some formatting problems.
https://bugs.webkit.org/show_bug.cgi?id=28712
* Api/qwebhistory_p.h:
(QWebHistoryPrivate::QWebHistoryPrivate):
2009-08-26 Adam Barth <abarth@webkit.org>
Reviewed by Oliver Hunt.
Don't let local files access web URLs
https://bugs.webkit.org/show_bug.cgi?id=28480
* Api/qwebsettings.cpp:
(QWebSettings::QWebSettings):
2009-08-25 Antonio Gomes <antonio.gomes@openbossa.org>
Reviewed by Ariya Hidayat.
Bug 28708 - Make possible to better use ResourceError in FrameLoaderClientQt class.
* Api/qwebframe.cpp:
(QWebFrame::requestedUrl):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::FrameLoaderClientQt):
(WebCore::FrameLoaderClientQt::dispatchDidFinishLoad):
(WebCore::FrameLoaderClientQt::postProgressFinishedNotification):
(WebCore::FrameLoaderClientQt::dispatchDidFailProvisionalLoad):
(WebCore::FrameLoaderClientQt::dispatchDidFailLoad):
* WebCoreSupport/FrameLoaderClientQt.h:
2009-08-22 Adam Barth <abarth@webkit.org>
Revert 47684. We're going to do this later once clients have had a
chance to opt into the setting they like.
* Api/qwebsettings.cpp:
(QWebSettings::QWebSettings):
2009-08-22 Adam Barth <abarth@webkit.org>
Reviewed by Eric Seidel.
Don't let local files access web URLs
https://bugs.webkit.org/show_bug.cgi?id=28480
* Api/qwebsettings.cpp:
(QWebSettings::QWebSettings):
2009-08-19 Aaron Boodman <aa@chromium.org>
Speculative build break fix for qt.
* Api/qwebsecurityorigin.cpp:
(QWebSecurityOrigin::whiteListAccessFromOrigin):
* Api/qwebsecurityorigin.h:
2009-08-19 Aaron Boodman <aa@chromium.org>
Reviewed by David Levin.
https://bugs.webkit.org/show_bug.cgi?id=24853: Provide a way for WebKit clients to
specify a more granular policy for cross-origin XHR access.
* Api/qwebsecurityorigin.cpp: Add API to manipulate origin access whitelists.
(QWebSecurityOrigin::whiteListAccessFromOrigin): Ditto.
(QWebSecurityOrigin::resetOriginAccessWhiteLists): Ditto.
* Api/qwebsecurityorigin.h: Ditto.
2009-08-18 Markus Goetz <Markus.Goetz@nokia.com>
Reviwed by Ariya Hidayat.
[Qt] For prefecthDNS, the pre-fetching has to be enabled in the
WebSettings.
* Api/qwebsettings.cpp:
(QWebSettings::QWebSettings):
* Api/qwebsettings.h:
2009-08-17 Darin Adler <darin@apple.com>
Try to fix Qt build again.
* WebCoreSupport/EditorClientQt.cpp: Move "using namespace".
2009-08-17 Darin Adler <darin@apple.com>
Try to fix Qt build.
* WebCoreSupport/EditorClientQt.cpp:
(WebCore::EditorClientQt::shouldShowDeleteInterface):
Use getAttribute(classAttr) instead of className() function.
2009-08-14 Yongjun Zhang <yongjun.zhang@nokia.com>
Reviewed by Simon Hausmann.
RVCT elftran fails to resolve QPainter::staticMetaObject coming with
QWebView::RenderHints property.
This is a temporary fix and will be revereted when the right symbols
exported from Qt lib in S60.
https://bugs.webkit.org/show_bug.cgi?id=28181
* Api/qwebview.h:
2009-08-14 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Public API to configure the storage path for HTML5 localStorage
https://bugs.webkit.org/show_bug.cgi?id=28036
Disables LocalStorage for QtWebKit by default by setting
QWebSettings::LocalStorageEnabled to false.
Sets up a default for the LocalStorage path so that clients would only
need to enable the LocalStorageEnabled setting to turn on LocalStoragre
support.
Turn on LocalStorage support for QtLauncher and the relevant test
since LocalStorage is now disabled by default for QtWebkit.
* Api/qwebpage.cpp:
(defaultCachePath):
(initializeApplicationCachePathIfNecessary):
(QWebPagePrivate::QWebPagePrivate):
* Api/qwebsettings.cpp:
(QWebSettingsPrivate::apply):
(QWebSettings::QWebSettings):
(QWebSettings::setLocalStoragePath):
(QWebSettings::localStoragePath):
* Api/qwebsettings.h:
* QtLauncher/main.cpp:
(main):
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::multiplePageGroupsAndLocalStorage):
2009-08-14 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Simon Hausmann.
[Qt] Allow applications to register their own local URL scheme.
https://bugs.webkit.org/show_bug.cgi?id=28240
* Api/qwebsecurityorigin.cpp:
(QWebSecurityOrigin::addLocalScheme):
(QWebSecurityOrigin::removeLocalScheme):
(QWebSecurityOrigin::localSchemes):
* Api/qwebsecurityorigin.h:
* tests/qwebpage/tst_qwebpage.cpp:
(tst_QWebPage::localURLSchemes):
2009-08-13 Mark Rowe <mrowe@apple.com>
Try and fix the Qt build.
* Api/qwebelement.cpp:
2009-08-13 Kavindra Devi Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
Doc - Some cleanup on the documentation of QWebElement
* Api/qwebelement.cpp:
2009-08-13 Norbert Leser <norbert.leser@nokia.com>
Reviewed by Simon Hausmann.
Symbian target components (library and executable files)
require Unique Identifiers (i.e., UID3).
These identifiers are defined in the respective project
files, conditionally for "symbian" platform.
* QtLauncher/QtLauncher.pro:
* tests/qwebelement/qwebelement.pro:
* tests/qwebframe/qwebframe.pro:
* tests/qwebhistory/qwebhistory.pro:
* tests/qwebhistoryinterface/qwebhistoryinterface.pro:
* tests/qwebpage/qwebpage.pro:
* tests/qwebview/qwebview.pro:
2009-08-12 George Wright <george.wright@torchmobile.com>
Reviewed by Adam Treat.
Initialise zoom levels independent of whether a URL is valid or not to
fix https://bugs.webkit.org/show_bug.cgi?id=28162
* QtLauncher/main.cpp:
(MainWindow::MainWindow):
2009-08-12 Joerg Bornemann <joerg.bornemann@trolltech.com>
Reviewed by Simon Hausmann.
QtWebKit compile fix for Windows CE
There's no getenv on Windows CE, use qgetenv instead.
* Api/qwebpage.cpp:
(qt_drt_overwritePluginDirectories):
2009-08-10 Kavindra Palaraja <kavindra.palaraja@nokia.com>
Reviewed by Simon Hausmann.
Various fixes and improvements to the QWebPluginInfo, QWebPluginDatabase and QWebSettings documentation.
* Api/qwebplugindatabase.cpp:
* Api/qwebsettings.cpp:
2009-08-08 Volker Hilsheimer <volker.hilsheimer@nokia.com>
Reviewed by Simon Hausmann.
Doc: there is no group of explicitly shared classes, only one class uses this.
Explain the implications in the QWebHistoryItem documentation, and get rid
of the "group".
* Api/qwebhistory.cpp:
2009-08-05 Csaba Osztrogonac <oszi@inf.u-szeged.hu>
Reviewed by Simon Hausmann.
[Qt] Fix build error caused by http://trac.webkit.org/changeset/46763
* Api/qwebpluginfactory.h: Export macro added.
2009-08-04 Antonio Gomes <antonio.gomes@openbossa.org>
Reviewed by Simon Hausmann.
[Qt] QWebFrame::requestedUrl method can mis-behave in case of unhandled sslErrors.
https://bugs.webkit.org/show_bug.cgi?id=27804
* Api/qwebframe.cpp:
(QWebFrame::requestedUrl):
* tests/qwebframe/tst_qwebframe.cpp:
2009-08-04 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Tor Arne Vestbø.
Rename QWebPlugin to QWebPluginInfo, as discussed on IRC.
* Api/qwebplugindatabase.cpp:
(QWebPluginInfoPrivate::QWebPluginInfoPrivate):
(QWebPluginInfo::QWebPluginInfo):
(QWebPluginInfo::~QWebPluginInfo):
(QWebPluginInfo::name):
(QWebPluginInfo::description):
(QWebPluginInfo::mimeTypes):
(QWebPluginInfo::supportsMimeType):
(QWebPluginInfo::path):
(QWebPluginInfo::isNull):
(QWebPluginInfo::setEnabled):
(QWebPluginInfo::isEnabled):
(QWebPluginInfo::operator==):
(QWebPluginInfo::operator!=):
(QWebPluginInfo::operator=):
(QWebPluginDatabase::plugins):
(QWebPluginDatabase::pluginForMimeType):
(QWebPluginDatabase::setPreferredPluginForMimeType):
* Api/qwebplugindatabase.h:
* Api/qwebplugindatabase_p.h:
* tests/qwebplugindatabase/tst_qwebplugindatabase.cpp:
(tst_QWebPluginDatabase::installedPlugins):
(tst_QWebPluginDatabase::searchPaths):
(tst_QWebPluginDatabase::null_data):
(tst_QWebPluginDatabase::null):
(tst_QWebPluginDatabase::pluginForMimeType):
(tst_QWebPluginDatabase::enabled):
(tst_QWebPluginDatabase::operatorequal_data):
(tst_QWebPluginDatabase::operatorequal):
(tst_QWebPluginDatabase::preferredPlugin):
2009-08-04 Simon Hausmann <simon.hausmann@nokia.com>
Reviewed by Adam Treat.
Replace QWebPlugin::MimeType with a typedef to
QWebPluginFactory::MimeType.
* Api/qwebplugindatabase.cpp:
* Api/qwebplugindatabase.h:
* Api/qwebpluginfactory.cpp:
(QWebPluginFactory::MimeType::operator==):
* Api/qwebpluginfactory.h:
2009-08-04 Jakub Wieczorek <faw217@gmail.com>
Reviewed by Simon Hausmann.
Add QWebPluginDatabase API to the Qt API.
https://bugs.webkit.org/show_bug.cgi?id=27651
* Api/headers.pri:
* Api/qwebplugindatabase.cpp: Added.
(QWebPluginPrivate::QWebPluginPrivate):
(QWebPluginDatabasePrivate::QWebPluginDatabasePrivate):
(QWebPlugin::MimeType::operator==):
(QWebPlugin::QWebPlugin):
(QWebPlugin::~QWebPlugin):
(QWebPlugin::name):
(QWebPlugin::description):
(QWebPlugin::mimeTypes):
(QWebPlugin::supportsMimeType):
(QWebPlugin::path):
(QWebPlugin::isNull):
(QWebPlugin::setEnabled):
(QWebPlugin::isEnabled):
(QWebPlugin::operator==):
(QWebPlugin::operator!=):
(QWebPlugin::operator=):
(QWebPluginDatabase::QWebPluginDatabase):
(QWebPluginDatabase::~QWebPluginDatabase):
(QWebPluginDatabase::plugins):
(QWebPluginDatabase::defaultSearchPaths):
(QWebPluginDatabase::searchPaths):
(QWebPluginDatabase::setSearchPaths):
(QWebPluginDatabase::addSearchPath):
(QWebPluginDatabase::refresh):
(QWebPluginDatabase::pluginForMimeType):
(QWebPluginDatabase::setPreferredPluginForMimeType):
* Api/qwebplugindatabase.h: Added.
* Api/qwebplugindatabase_p.h: Added.
* Api/qwebsettings.cpp:
(QWebSettings::pluginDatabase):
* Api/qwebsettings.h:
* tests/qwebplugindatabase/qwebplugindatabase.pro: Added.
* tests/qwebplugindatabase/tst_qwebplugindatabase.cpp: Added.
(tst_QWebPluginDatabase::installedPlugins):
(tst_QWebPluginDatabase::searchPaths):
(tst_QWebPluginDatabase::null_data):
(tst_QWebPluginDatabase::null):
(tst_QWebPluginDatabase::pluginForMimeType):
(tst_QWebPluginDatabase::enabled):
(tst_QWebPluginDatabase::operatorequal_data):
(tst_QWebPluginDatabase::operatorequal):
(tst_QWebPluginDatabase::preferredPlugin):
* tests/tests.pro:
2009-08-03 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
Reviewed by Simon Hausmann.
Do memory cleanup when running robotized QtLauncher in debug as well.
* QtLauncher/main.cpp:
(launcherMain):
(main):
2009-07-30 Laszlo Gombos <laszlo.1.gombos@nokia.com>
Reviewed by Tor Arne Vestbø.
[Qt] Initialize HTML5 Application Cache for QtWebKit to a sensible default
https://bugs.webkit.org/show_bug.cgi?id=27866
* Api/qwebpage.cpp:
(initializeApplicationCachePathIfNecessary):
(QWebPagePrivate::QWebPagePrivate):
2009-07-31 Jakob Petsovits <jakob.petsovits@torchmobile.com>
Reviewed by Adam Treat.
Build QtWebKit without benchmark tests for Qt < 4.5.
https://bugs.webkit.org/show_bug.cgi?id=27886
The QBENCHMARK macro is only available from 4.5 on,
so builds for Qt < 4.5 shouldn't try to build those.
* tests/tests.pro:
2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Adam Treat.
Fix warning by migrating use of QString.sprintf(...) to
QString.arg().arg()...
* WebCoreSupport/EditorClientQt.cpp:
(dumpRange):
2009-07-31 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Tor Arne Vestbø.
Expose the Offline Web Application Cache in the Qt API.
* Api/qwebsettings.cpp:
(QWebSettings::QWebSettings):
(QWebSettings::setOfflineWebApplicationCachePath):
(QWebSettings::offlineWebApplicationCachePath):
(QWebSettings::setOfflineWebApplicationCacheQuota):
(QWebSettings::offlineWebApplicationCacheQuota):
* Api/qwebsettings.h:
2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Adam Treat.
Add missing Q_OBJECT to class inheriting from QObject.
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-30 Kenneth Rohde Christiansen <kenneth@webkit.org>
Reviewed by Adam Treat.
Fix indentation.
* tests/qwebframe/tst_qwebframe.cpp:
2009-07-30 Volker Hilsheimer <volker.hilsheimer@nokia.com>
Reviewed by Simon Hausmann.
Fix documentation links to examples.
* Api/qwebview.cpp:
2009-07-30 Balazs Kelemen <kelemen.balazs.3@stud.u-szeged.hu>
Reviewed by Simon Hausmann.
Allocate MainWindow on heap in robotized QtLauncher as well.
* QtLauncher/main.cpp:
(main):
2009-07-29 Kevin McCullough <kmccullough@apple.com>
Reviewed by Darin Adler.
Added foundation work to allow a testing infrastructure for the Web
Inspector.
* WebCoreSupport/InspectorClientQt.cpp:
(WebCore::InspectorClientQt::inspectorWindowObjectCleared):
* WebCoreSupport/InspectorClientQt.h:
2009-07-29 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>
Reviewed by Simon Hausmann.
[Qt] In debug mode, this fix frees cached resources
and other unreferenced objects (by calling the
garbage collector) to remove the LEAK messages.
https://bugs.webkit.org/show_bug.cgi?id=27767
* Api/qwebframe.cpp:
(qt_drt_cache_clear):
* QtLauncher/main.cpp:
(main):
2009-07-28 Kenneth Rohde Christiansen <kenneth@webkit.org>
Fix the Qt build by adapting to the changes of ScriptObject.
* Api/qwebelement.cpp:
(setupScriptObject):
2009-07-28 Robert Hogan <robert@roberthogan.net>
Reviewed by Simon Hausmann.
Add WebKit version API to Qt.
Get the current version of WebKit from WebKit/mac/Configurations/Version.xcconfig
at compile time and make it available to Qt applications through
qWebKitVersion().
Also amend the User Agent string to place the Safari clause outside
the final bracket and to the end of the UA string.
https://bugs.webkit.org/show_bug.cgi?id=27158
Minor build tweak by Simon Hausmann (adding export macros to new functions).
* Api/headers.pri:
* Api/qwebkitversion.cpp: Added.
(webKitVersion):
(webKitMajorVersion):
(webKitMinorVersion):
* Api/qwebkitversion.h: Added.
* Api/qwebpage.cpp:
(QWebPage::userAgentForUrl):
* tests/qwebview/tst_qwebview.cpp:
(tst_QWebView::getWebKitVersion):
http://qt.nokia.com/developer/task-tracker/index_html?id=238391&method=entry
http://qt.nokia.com/developer/task-tracker/index_html?id=219344&method=entry
http://qt.nokia.com/developer/task-tracker/index_html?id=241144&method=entry
Diffstat (limited to 'src/3rdparty/webkit/WebCore/plugins')
17 files changed, 483 insertions, 394 deletions
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp index de1c298..f40ed95 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.cpp @@ -21,7 +21,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" @@ -29,11 +29,19 @@ #include "Frame.h" #include "KURL.h" +#include "PluginDatabaseClient.h" #include "PluginPackage.h" #include <stdlib.h> namespace WebCore { +typedef HashMap<String, RefPtr<PluginPackage> > PluginPackageByNameMap; + +PluginDatabase::PluginDatabase() + : m_client(0) +{ +} + PluginDatabase* PluginDatabase::installedPlugins(bool populate) { static PluginDatabase* plugins = 0; @@ -109,9 +117,11 @@ bool PluginDatabase::refresh() remove(oldPackage.get()); } - RefPtr<PluginPackage> package = PluginPackage::createPackage(*it, lastModified); - if (package && add(package.release())) - pluginSetChanged = true; + if (!m_client || m_client->shouldLoadPluginAtPath(*it)) { + RefPtr<PluginPackage> package = PluginPackage::createPackage(*it, lastModified); + if (package && (!m_client || m_client->shouldLoadPluginPackage(package.get())) && add(package.release())) + pluginSetChanged = true; + } } // Cache all the paths we found with their timestamps for next time. @@ -126,10 +136,10 @@ bool PluginDatabase::refresh() PluginSet::const_iterator end = m_plugins.end(); for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) { // Get MIME types + MIMEToDescriptionsMap::const_iterator map_it = (*it)->mimeToDescriptions().begin(); MIMEToDescriptionsMap::const_iterator map_end = (*it)->mimeToDescriptions().end(); - for (MIMEToDescriptionsMap::const_iterator map_it = (*it)->mimeToDescriptions().begin(); map_it != map_end; ++map_it) { + for (; map_it != map_end; ++map_it) m_registeredMIMETypes.add(map_it->first); - } } return true; @@ -161,12 +171,23 @@ PluginPackage* PluginDatabase::pluginForMIMEType(const String& mimeType) String key = mimeType.lower(); PluginSet::const_iterator end = m_plugins.end(); + PluginPackage* preferredPlugin = m_preferredPlugins.get(key).get(); + if (preferredPlugin + && preferredPlugin->isEnabled() + && preferredPlugin->mimeToDescriptions().contains(key)) { + return preferredPlugin; + } Vector<PluginPackage*, 2> pluginChoices; for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) { - if ((*it)->mimeToDescriptions().contains(key)) - pluginChoices.append((*it).get()); + PluginPackage* plugin = (*it).get(); + + if (!plugin->isEnabled()) + continue; + + if (plugin->mimeToDescriptions().contains(key)) + pluginChoices.append(plugin); } if (pluginChoices.isEmpty()) @@ -188,16 +209,25 @@ String PluginDatabase::MIMETypeForExtension(const String& extension) const HashMap<PluginPackage*, String> mimeTypeForPlugin; for (PluginSet::const_iterator it = m_plugins.begin(); it != end; ++it) { + if (!(*it)->isEnabled()) + continue; + MIMEToExtensionsMap::const_iterator mime_end = (*it)->mimeToExtensions().end(); for (MIMEToExtensionsMap::const_iterator mime_it = (*it)->mimeToExtensions().begin(); mime_it != mime_end; ++mime_it) { + mimeType = mime_it->first; + PluginPackage* preferredPlugin = m_preferredPlugins.get(mimeType).get(); const Vector<String>& extensions = mime_it->second; bool foundMapping = false; for (unsigned i = 0; i < extensions.size(); i++) { if (equalIgnoringCase(extensions[i], extension)) { PluginPackage* plugin = (*it).get(); + + if (preferredPlugin && PluginPackage::equal(*plugin, *preferredPlugin)) + return mimeType; + pluginChoices.append(plugin); - mimeTypeForPlugin.add(plugin, mime_it->first); + mimeTypeForPlugin.add(plugin, mimeType); foundMapping = true; break; } @@ -219,7 +249,7 @@ PluginPackage* PluginDatabase::findPlugin(const KURL& url, String& mimeType) { PluginPackage* plugin = pluginForMIMEType(mimeType); String filename = url.string(); - + if (!plugin) { String filename = url.lastPathComponent(); if (!filename.endsWith("/")) { @@ -233,12 +263,18 @@ PluginPackage* PluginDatabase::findPlugin(const KURL& url, String& mimeType) } } - // FIXME: if no plugin could be found, query Windows for the mime type + // FIXME: if no plugin could be found, query Windows for the mime type // corresponding to the extension. return plugin; } +void PluginDatabase::setPreferredPluginForMIMEType(const String& mimeType, PluginPackage* plugin) +{ + if (!plugin || plugin->mimeToExtensions().contains(mimeType)) + m_preferredPlugins.set(mimeType.lower(), plugin); +} + void PluginDatabase::getDeletedPlugins(PluginSet& plugins) const { PluginSet::const_iterator end = m_plugins.end(); @@ -263,6 +299,14 @@ bool PluginDatabase::add(PassRefPtr<PluginPackage> prpPackage) void PluginDatabase::remove(PluginPackage* package) { + MIMEToExtensionsMap::const_iterator it = package->mimeToExtensions().begin(); + MIMEToExtensionsMap::const_iterator end = package->mimeToExtensions().end(); + for ( ; it != end; ++it) { + PluginPackageByNameMap::iterator packageInMap = m_preferredPlugins.find(it->first); + if (packageInMap != m_preferredPlugins.end() && packageInMap->second == package) + m_preferredPlugins.remove(packageInMap); + } + m_plugins.remove(package); m_pluginsByPath.remove(package->path()); } @@ -273,6 +317,7 @@ void PluginDatabase::clear() m_pluginsByPath.clear(); m_pluginPathsWithTimes.clear(); m_registeredMIMETypes.clear(); + m_preferredPlugins.clear(); } #if !PLATFORM(WIN_OS) || PLATFORM(WX) diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.h b/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.h index b8d2bfe..fdc9330 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.h +++ b/src/3rdparty/webkit/WebCore/plugins/PluginDatabase.h @@ -22,7 +22,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PluginDatabase_H @@ -32,20 +32,23 @@ #include "PluginPackage.h" #include "StringHash.h" -#include <wtf/Vector.h> #include <wtf/HashSet.h> +#include <wtf/Vector.h> namespace WebCore { class Element; class Frame; class IntSize; class KURL; + class PluginDatabaseClient; class PluginPackage; typedef HashSet<RefPtr<PluginPackage>, PluginPackageHash> PluginSet; class PluginDatabase { public: + PluginDatabase(); + // The first call to installedPlugins creates the plugin database // and by default populates it with the plugins installed on the system. // For testing purposes, it is possible to not populate the database @@ -63,6 +66,8 @@ namespace WebCore { static int preferredPluginCompare(const void*, const void*); PluginPackage* findPlugin(const KURL&, String& mimeType); + PluginPackage* pluginForMIMEType(const String& mimeType); + void setPreferredPluginForMIMEType(const String& mimeType, PluginPackage* plugin); void setPluginDirectories(const Vector<String>& directories) { @@ -70,6 +75,14 @@ namespace WebCore { m_pluginDirectories = directories; } + void setClient(PluginDatabaseClient* client) + { + m_client = client; + } + + static Vector<String> defaultPluginDirectories(); + Vector<String> pluginDirectories() const { return m_pluginDirectories; } + private: void getPluginPathsInDirectories(HashSet<String>&) const; void getDeletedPlugins(PluginSet&) const; @@ -78,16 +91,15 @@ namespace WebCore { bool add(PassRefPtr<PluginPackage>); void remove(PluginPackage*); - PluginPackage* pluginForMIMEType(const String& mimeType); String MIMETypeForExtension(const String& extension) const; - static Vector<String> defaultPluginDirectories(); - Vector<String> m_pluginDirectories; HashSet<String> m_registeredMIMETypes; PluginSet m_plugins; HashMap<String, RefPtr<PluginPackage> > m_pluginsByPath; HashMap<String, time_t> m_pluginPathsWithTimes; + HashMap<String, RefPtr<PluginPackage> > m_preferredPlugins; + PluginDatabaseClient* m_client; }; } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginDatabaseClient.h b/src/3rdparty/webkit/WebCore/plugins/PluginDatabaseClient.h new file mode 100644 index 0000000..b19ab83 --- /dev/null +++ b/src/3rdparty/webkit/WebCore/plugins/PluginDatabaseClient.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2007 Marius Renn <damarvy@gmail.com> All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef PluginDatabaseClient_h +#define PluginDatabaseClient_h + +namespace WebCore { + + class PluginPackage; + class String; + + class PluginDatabaseClient { + public: + virtual ~PluginDatabaseClient() { } + virtual bool shouldLoadPluginAtPath(const String&) = 0; + virtual bool shouldLoadPluginPackage(const PluginPackage*) = 0; + }; + +} // namespace WebCore + +#endif // PluginDatabaseClient_h diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp index 8adba98..612a9d7 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/PluginPackage.cpp @@ -22,7 +22,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" @@ -47,7 +47,7 @@ PluginPackage::~PluginPackage() // 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) + if (!m_loadCount) unloadWithoutShutdown(); else unload(); @@ -59,7 +59,7 @@ void PluginPackage::freeLibrarySoon() { ASSERT(!m_freeLibraryTimer.isActive()); ASSERT(m_module); - ASSERT(m_loadCount == 0); + ASSERT(!m_loadCount); m_freeLibraryTimer.startOneShot(0); } @@ -67,7 +67,7 @@ void PluginPackage::freeLibrarySoon() void PluginPackage::freeLibraryTimerFired(Timer<PluginPackage>*) { ASSERT(m_module); - ASSERT(m_loadCount == 0); + ASSERT(!m_loadCount); unloadModule(m_module); m_module = 0; @@ -100,7 +100,8 @@ int PluginPackage::compare(const PluginPackage& compareTo) const } PluginPackage::PluginPackage(const String& path, const time_t& lastModified) - : m_isLoaded(false) + : m_isEnabled(true) + , m_isLoaded(false) , m_loadCount(0) , m_path(path) , m_moduleVersion(0) @@ -130,7 +131,7 @@ void PluginPackage::unloadWithoutShutdown() if (!m_isLoaded) return; - ASSERT(m_loadCount == 0); + ASSERT(!m_loadCount); ASSERT(m_module); // <rdar://5530519>: Crash when closing tab with pdf file (Reader 7 only) @@ -144,6 +145,11 @@ void PluginPackage::unloadWithoutShutdown() m_isLoaded = false; } +void PluginPackage::setEnabled(bool enabled) +{ + m_isEnabled = enabled; +} + PassRefPtr<PluginPackage> PluginPackage::createPackage(const String& path, const time_t& lastModified) { RefPtr<PluginPackage> package = adoptRef(new PluginPackage(path, lastModified)); @@ -243,7 +249,7 @@ void PluginPackage::determineModuleVersionFromDescription() void PluginPackage::initializeBrowserFuncs() { memset(&m_browserFuncs, 0, sizeof(m_browserFuncs)); - m_browserFuncs.size = sizeof (m_browserFuncs); + m_browserFuncs.size = sizeof(m_browserFuncs); m_browserFuncs.version = NP_VERSION_MINOR; m_browserFuncs.geturl = NPN_GetURL; diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginPackage.h b/src/3rdparty/webkit/WebCore/plugins/PluginPackage.h index 02d0dfc..3afc57f 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginPackage.h +++ b/src/3rdparty/webkit/WebCore/plugins/PluginPackage.h @@ -21,7 +21,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef PluginPackage_H @@ -44,7 +44,7 @@ namespace WebCore { public: ~PluginPackage(); static PassRefPtr<PluginPackage> createPackage(const String& path, const time_t& lastModified); - + const String& name() const { return m_name; } const String& description() const { return m_description; } const String& path() const { return m_path; } @@ -62,6 +62,9 @@ namespace WebCore { void unload(); void unloadWithoutShutdown(); + bool isEnabled() const { return m_isEnabled; } + void setEnabled(bool); + const NPPluginFuncs* pluginFuncs() const { return &m_pluginFuncs; } int compareFileVersion(const PlatformModuleVersion&) const; int compare(const PluginPackage&) const; @@ -77,6 +80,7 @@ namespace WebCore { void determineModuleVersionFromDescription(); void initializeBrowserFuncs(); + bool m_isEnabled; bool m_isLoaded; int m_loadCount; diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h b/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h index 8183050..b652c6e 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h +++ b/src/3rdparty/webkit/WebCore/plugins/PluginQuirkSet.h @@ -45,7 +45,7 @@ namespace WebCore { PluginQuirkDontClipToZeroRectWhenScrolling = 1 << 9, PluginQuirkDontSetNullWindowHandleOnDestroy = 1 << 10, PluginQuirkDontAllowMultipleInstances = 1 << 11, - PluginQuirkRequiresGtkToolKit = 1 << 12 + PluginQuirkRequiresGtkToolKit = 1 << 12, }; class PluginQuirkSet { diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp index d2d5d3c..cd9f83d 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp @@ -248,6 +248,11 @@ void PluginStream::destroyStream() bool newStreamCalled = m_stream.ndata; + // Protect from destruction if: + // NPN_DestroyStream is called from NPP_NewStream or + // PluginStreamClient::streamDidFinishLoading() removes the last reference + RefPtr<PluginStream> protect(this); + if (newStreamCalled) { if (m_reason == NPRES_DONE && (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) { ASSERT(!m_path.isNull()); @@ -281,9 +286,6 @@ void PluginStream::destroyStream() m_loader->setDefersLoading(true); if (!newStreamCalled && m_quirks.contains(PluginQuirkFlashURLNotifyBug) && equalIgnoringCase(m_resourceRequest.httpMethod(), "POST")) { - // Protect the stream if NPN_DestroyStream is called from NPP_NewStream - RefPtr<PluginStream> protect(this); - m_transferMode = NP_NORMAL; m_stream.url = ""; m_stream.notifyData = m_notifyData; @@ -303,8 +305,6 @@ void PluginStream::destroyStream() m_streamState = StreamStopped; - // streamDidFinishLoading can cause us to be deleted. - RefPtr<PluginStream> protect(this); if (!m_loadManually) m_client->streamDidFinishLoading(this); diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp index 2cecdc4..c28e586 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp @@ -149,11 +149,55 @@ void PluginView::handleEvent(Event* event) handleKeyboardEvent(static_cast<KeyboardEvent*>(event)); } +void PluginView::init() +{ + if (m_haveInitialized) + return; + + m_haveInitialized = true; + + if (!m_plugin) { + ASSERT(m_status == PluginStatusCanNotFindPlugin); + return; + } + + LOG(Plugins, "PluginView::init(): Initializing plug-in '%s'", m_plugin->name().utf8().data()); + + if (!m_plugin->load()) { + m_plugin = 0; + m_status = PluginStatusCanNotLoadPlugin; + return; + } + + if (!startOrAddToUnstartedList()) { + m_status = PluginStatusCanNotLoadPlugin; + return; + } + + m_status = PluginStatusLoadedSuccessfully; +} + +bool PluginView::startOrAddToUnstartedList() +{ + if (!m_parentFrame->page()) + return false; + + if (!m_parentFrame->page()->canStartPlugins()) { + m_parentFrame->page()->addUnstartedPlugin(this); + m_isWaitingToStart = true; + return true; + } + + return start(); +} + bool PluginView::start() { if (m_isStarted) return false; + m_isWaitingToStart = false; + PluginMainThreadScheduler::scheduler().registerPlugin(m_instance); ASSERT(m_plugin); @@ -164,14 +208,17 @@ bool PluginView::start() PluginView::setCurrentPluginView(this); JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); setCallingPlugin(true); - npErr = m_plugin->pluginFuncs()->newp((NPMIMEType)m_mimeType.data(), m_instance, m_mode, m_paramCount, m_paramNames, m_paramValues, NULL); + npErr = m_plugin->pluginFuncs()->newp((NPMIMEType)m_mimeType.utf8().data(), m_instance, m_mode, m_paramCount, m_paramNames, m_paramValues, NULL); setCallingPlugin(false); LOG_NPERROR(npErr); PluginView::setCurrentPluginView(0); } - if (npErr != NPERR_NO_ERROR) + if (npErr != NPERR_NO_ERROR) { + m_status = PluginStatusCanNotLoadPlugin; + PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance); return false; + } m_isStarted = true; @@ -182,7 +229,125 @@ bool PluginView::start() load(frameLoadRequest, false, 0); } - return true; + m_status = PluginStatusLoadedSuccessfully; + + if (!platformStart()) + m_status = PluginStatusCanNotLoadPlugin; + + return (m_status == PluginStatusLoadedSuccessfully); +} + +PluginView::~PluginView() +{ + LOG(Plugins, "PluginView::~PluginView()"); + + removeFromUnstartedListIfNecessary(); + + stop(); + + deleteAllValues(m_requests); + + freeStringArray(m_paramNames, m_paramCount); + freeStringArray(m_paramValues, m_paramCount); + + platformDestroy(); + + m_parentFrame->script()->cleanupScriptObjectsForPlugin(this); + + if (m_plugin && !(m_plugin->quirks().contains(PluginQuirkDontUnloadPlugin))) + m_plugin->unload(); +} + +void PluginView::removeFromUnstartedListIfNecessary() +{ + if (!m_isWaitingToStart) + return; + + if (!m_parentFrame->page()) + return; + + m_parentFrame->page()->removeUnstartedPlugin(this); +} + +void PluginView::stop() +{ + if (!m_isStarted) + return; + + LOG(Plugins, "PluginView::stop(): Stopping plug-in '%s'", m_plugin->name().utf8().data()); + + HashSet<RefPtr<PluginStream> > streams = m_streams; + HashSet<RefPtr<PluginStream> >::iterator end = streams.end(); + for (HashSet<RefPtr<PluginStream> >::iterator it = streams.begin(); it != end; ++it) { + (*it)->stop(); + disconnectStream((*it).get()); + } + + ASSERT(m_streams.isEmpty()); + + m_isStarted = false; + + JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); + +#if !PLATFORM(WX) // FIXME: Revisit this when implementing plugins for wx +#ifdef XP_WIN + // Unsubclass the window + if (m_isWindowed) { +#if PLATFORM(WINCE) + WNDPROC currentWndProc = (WNDPROC)GetWindowLong(platformPluginWidget(), GWL_WNDPROC); + + if (currentWndProc == PluginViewWndProc) + SetWindowLong(platformPluginWidget(), GWL_WNDPROC, (LONG)m_pluginWndProc); +#else + WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC); + + if (currentWndProc == PluginViewWndProc) + SetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC, (LONG)m_pluginWndProc); +#endif + } +#endif // XP_WIN +#endif // !PLATFORM(WX) + +#if !defined(XP_MACOSX) + // Clear the window + m_npWindow.window = 0; + + if (m_plugin->pluginFuncs()->setwindow && !m_plugin->quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) { + PluginView::setCurrentPluginView(this); + setCallingPlugin(true); + m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow); + setCallingPlugin(false); + PluginView::setCurrentPluginView(0); + } + +#ifdef XP_UNIX + if (m_isWindowed && m_npWindow.ws_info) + delete (NPSetWindowCallbackStruct *)m_npWindow.ws_info; + m_npWindow.ws_info = 0; +#endif + +#endif // !defined(XP_MACOSX) + + PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance); + + NPSavedData* savedData = 0; + PluginView::setCurrentPluginView(this); + setCallingPlugin(true); + NPError npErr = m_plugin->pluginFuncs()->destroy(m_instance, &savedData); + setCallingPlugin(false); + LOG_NPERROR(npErr); + PluginView::setCurrentPluginView(0); + +#if ENABLE(NETSCAPE_PLUGIN_API) + if (savedData) { + // TODO: Actually save this data instead of just discarding it + if (savedData->buf) + NPN_MemFree(savedData->buf); + NPN_MemFree(savedData); + } +#endif + + m_instance->pdata = 0; } void PluginView::setCurrentPluginView(PluginView* pluginView) @@ -221,6 +386,9 @@ static bool getString(ScriptController* proxy, JSValue result, String& string) void PluginView::performRequest(PluginRequest* request) { + if (!m_isStarted) + return; + // don't let a plugin start any loads if it is no longer part of a document that is being // displayed unless the loads are in the same frame as the plugin. const String& targetFrameName = request->frameLoadRequest().frameName(); @@ -522,7 +690,7 @@ PassRefPtr<JSC::Bindings::Instance> PluginView::bindingInstance() #if ENABLE(NETSCAPE_PLUGIN_API) NPObject* object = 0; - if (!m_plugin || !m_plugin->pluginFuncs()->getvalue) + if (!m_isStarted || !m_plugin || !m_plugin->pluginFuncs()->getvalue) return 0; // On Windows, calling Java's NPN_GetValue can allow the message loop to @@ -582,6 +750,9 @@ void PluginView::setParameters(const Vector<String>& paramNames, const Vector<St if (m_plugin->quirks().contains(PluginQuirkRemoveWindowlessVideoParam) && equalIgnoringCase(paramNames[i], "windowlessvideo")) continue; + if (paramNames[i] == "pluginspage") + m_pluginsPage = paramValues[i]; + m_paramNames[paramCount] = createUTF8String(paramNames[i]); m_paramValues[paramCount] = createUTF8String(paramValues[i]); @@ -604,7 +775,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p , m_popPopupsStateTimer(this, &PluginView::popPopupsStateTimerFired) , m_paramNames(0) , m_paramValues(0) - , m_instance(0) + , m_mimeType(mimeType) #if defined(XP_MACOSX) , m_isWindowed(false) #else @@ -612,7 +783,8 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p #endif , m_isTransparent(false) , m_haveInitialized(false) -#if PLATFORM(GTK) || defined(Q_WS_X11) + , m_isWaitingToStart(false) +#if defined(XP_UNIX) || defined(Q_WS_X11) , m_needsXEmbed(false) #endif #if PLATFORM(WIN_OS) && !PLATFORM(WX) && ENABLE(NETSCAPE_PLUGIN_API) @@ -620,6 +792,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p , m_lastMessage(0) , m_isCallingPluginWndProc(false) , m_wmPrintHDC(0) + , m_haveUpdatedPluginWidget(false) #endif #if (PLATFORM(QT) && PLATFORM(WIN_OS)) || defined(XP_MACOSX) , m_window(0) @@ -628,6 +801,9 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p , m_drawingModel(NPDrawingModel(-1)) , m_eventModel(NPEventModel(-1)) #endif +#if defined(Q_WS_X11) + , m_hasPendingGeometryChange(false) +#endif , m_loadManually(loadManually) , m_manualStream(0) , m_isJavaScriptPaused(false) @@ -641,8 +817,6 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p m_instance->ndata = this; m_instance->pdata = 0; - m_mimeType = mimeType.utf8(); - setParameters(paramNames, paramValues); memset(&m_npWindow, 0, sizeof(m_npWindow)); @@ -1005,4 +1179,37 @@ void PluginView::paintMissingPluginIcon(GraphicsContext* context, const IntRect& context->restore(); } +static const char* MozillaUserAgent = "Mozilla/5.0 (" +#if defined(XP_MACOSX) + "Macintosh; U; Intel Mac OS X;" +#elif defined(XP_WIN) + "Windows; U; Windows NT 5.1;" +#elif defined(XP_UNIX) +// The Gtk port uses X11 plugins in Mac. +#if PLATFORM(DARWIN) && PLATFORM(GTK) + "X11; U; Intel Mac OS X;" +#else + "X11; U; Linux i686;" +#endif +#endif + " en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"; + +const char* PluginView::userAgent() +{ + if (m_plugin->quirks().contains(PluginQuirkWantsMozillaUserAgent)) + return MozillaUserAgent; + + if (m_userAgent.isNull()) + m_userAgent = m_parentFrame->loader()->userAgent(m_url).utf8(); + + return m_userAgent.data(); +} + +#if ENABLE(NETSCAPE_PLUGIN_API) +const char* PluginView::userAgentStatic() +{ + return MozillaUserAgent; +} +#endif + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.h b/src/3rdparty/webkit/WebCore/plugins/PluginView.h index 95d73db..54c1065 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginView.h +++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.h @@ -177,6 +177,10 @@ namespace WebCore { void focusPluginElement(); + const String& pluginsPage() const { return m_pluginsPage; } + const String& mimeType() const { return m_mimeType; } + const KURL& url() const { return m_url; } + #if PLATFORM(WIN_OS) && !PLATFORM(WX) && ENABLE(NETSCAPE_PLUGIN_API) static LRESULT CALLBACK PluginViewWndProc(HWND, UINT, WPARAM, LPARAM); LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); @@ -191,13 +195,18 @@ namespace WebCore { static bool isCallingPlugin(); + bool start(); + private: PluginView(Frame* parentFrame, const IntSize&, PluginPackage*, Element*, const KURL&, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually); void setParameters(const Vector<String>& paramNames, const Vector<String>& paramValues); + bool startOrAddToUnstartedList(); + void removeFromUnstartedListIfNecessary(); void init(); - bool start(); + bool platformStart(); void stop(); + void platformDestroy(); 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); @@ -245,8 +254,9 @@ namespace WebCore { int m_paramCount; char** m_paramNames; char** m_paramValues; + String m_pluginsPage; - CString m_mimeType; + String m_mimeType; CString m_userAgent; NPP m_instance; @@ -261,8 +271,9 @@ namespace WebCore { bool m_isWindowed; bool m_isTransparent; bool m_haveInitialized; + bool m_isWaitingToStart; -#if PLATFORM(GTK) || defined(Q_WS_X11) +#if defined(XP_UNIX) || defined(Q_WS_X11) bool m_needsXEmbed; #endif @@ -272,6 +283,7 @@ namespace WebCore { unsigned m_lastMessage; bool m_isCallingPluginWndProc; HDC m_wmPrintHDC; + bool m_haveUpdatedPluginWidget; #endif #if (PLATFORM(QT) && PLATFORM(WIN_OS)) || defined(XP_MACOSX) @@ -288,7 +300,7 @@ public: private: -#if PLATFORM(GTK) || defined(Q_WS_X11) +#if defined(XP_UNIX) || defined(Q_WS_X11) void setNPWindowIfNeeded(); #elif defined(XP_MACOSX) NP_CGContext m_npCgContext; diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginViewNone.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginViewNone.cpp index a3b6a17..b694214 100644 --- a/src/3rdparty/webkit/WebCore/plugins/PluginViewNone.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/PluginViewNone.cpp @@ -73,25 +73,6 @@ void PluginView::setNPWindowRect(const IntRect&) notImplemented(); } -void PluginView::stop() -{ - notImplemented(); -} - -const char* PluginView::userAgent() -{ - notImplemented(); - return 0; -} - -#if ENABLE(NETSCAPE_PLUGIN_API) -const char* PluginView::userAgentStatic() -{ - notImplemented(); - return 0; -} -#endif - NPError PluginView::handlePostReadFile(Vector<char>&, uint32, const char*) { notImplemented(); @@ -133,12 +114,14 @@ void PluginView::forceRedraw() notImplemented(); } -PluginView::~PluginView() +bool PluginView::platformStart() { notImplemented(); + + return true; } -void PluginView::init() +void PluginView::platformDestroy() { notImplemented(); } diff --git a/src/3rdparty/webkit/WebCore/plugins/mac/PluginPackageMac.cpp b/src/3rdparty/webkit/WebCore/plugins/mac/PluginPackageMac.cpp index bf6a81b..d242fb8 100644 --- a/src/3rdparty/webkit/WebCore/plugins/mac/PluginPackageMac.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/mac/PluginPackageMac.cpp @@ -246,9 +246,6 @@ bool PluginPackage::fetchInfo() bool PluginPackage::isPluginBlacklisted() { - if (name() == "Silverlight Plug-In" || name().startsWith("QuickTime Plug-in")) - return true; - return false; } diff --git a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp index 721ec29..d0a3288 100644 --- a/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/mac/PluginViewMac.cpp @@ -125,30 +125,10 @@ static inline IntPoint topLevelOffsetFor(PlatformWidget widget) // --------------- Lifetime management ----------------- -void PluginView::init() +bool PluginView::platformStart() { - LOG(Plugins, "PluginView::init(): Initializing plug-in '%s'", m_plugin->name().utf8().data()); - - if (m_haveInitialized) - return; - m_haveInitialized = true; - - if (!m_plugin) { - ASSERT(m_status == PluginStatusCanNotFindPlugin); - return; - } - - if (!m_plugin->load()) { - m_plugin = 0; - m_status = PluginStatusCanNotLoadPlugin; - return; - } - - if (!start()) { - m_status = PluginStatusCanNotLoadPlugin; - stop(); // Make sure we unregister the plugin - return; - } + ASSERT(m_isStarted); + ASSERT(m_status == PluginStatusLoadedSuccessfully); if (m_drawingModel == NPDrawingModel(-1)) { // We default to QuickDraw, even though we don't support it, @@ -180,8 +160,7 @@ void PluginView::init() m_status = PluginStatusCanNotLoadPlugin; LOG(Plugins, "Plug-in '%s' uses unsupported event model %s", m_plugin->name().utf8().data(), prettyNameForEventModel(m_eventModel)); - stop(); - return; + return false; } if (getValueStatic(NPNVariable(NPNVsupportsQuickDrawBool + m_drawingModel), &drawingModelSupported) != NPERR_NO_ERROR @@ -189,70 +168,24 @@ void PluginView::init() m_status = PluginStatusCanNotLoadPlugin; LOG(Plugins, "Plug-in '%s' uses unsupported drawing model %s", m_plugin->name().utf8().data(), prettyNameForDrawingModel(m_drawingModel)); - stop(); - return; + return false; } setPlatformPluginWidget(m_parentFrame->view()->hostWindow()->platformWindow()); show(); - m_status = PluginStatusLoadedSuccessfully; - // TODO: Implement null timer throttling depending on plugin activation m_nullEventTimer.set(new Timer<PluginView>(this, &PluginView::nullEventTimerFired)); m_nullEventTimer->startRepeating(0.02); -} - -PluginView::~PluginView() -{ - LOG(Plugins, "PluginView::~PluginView()"); - stop(); - - deleteAllValues(m_requests); - - freeStringArray(m_paramNames, m_paramCount); - freeStringArray(m_paramValues, m_paramCount); - - m_parentFrame->script()->cleanupScriptObjectsForPlugin(this); - - if (m_plugin && !(m_plugin->quirks().contains(PluginQuirkDontUnloadPlugin))) - m_plugin->unload(); - - m_window = 0; + return true; } -void PluginView::stop() +void PluginView::platformDestroy() { - if (!m_isStarted) - return; - - LOG(Plugins, "PluginView::stop(): Stopping plug-in '%s'", m_plugin->name().utf8().data()); - - HashSet<RefPtr<PluginStream> > streams = m_streams; - HashSet<RefPtr<PluginStream> >::iterator end = streams.end(); - for (HashSet<RefPtr<PluginStream> >::iterator it = streams.begin(); it != end; ++it) { - (*it)->stop(); - disconnectStream((*it).get()); - } - - ASSERT(m_streams.isEmpty()); - - m_isStarted = false; - - JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); - - PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance); - - // Destroy the plugin - PluginView::setCurrentPluginView(this); - setCallingPlugin(true); - m_plugin->pluginFuncs()->destroy(m_instance, 0); - setCallingPlugin(false); - PluginView::setCurrentPluginView(0); - - m_instance->pdata = 0; + if (platformPluginWidget()) + setPlatformPluginWidget(0); } // Used before the plugin view has been initialized properly, and as a @@ -724,24 +657,6 @@ bool PluginView::dispatchNPEvent(NPEvent& event) // ------------------- Miscellaneous ------------------ -static const char* MozillaUserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"; - -const char* PluginView::userAgent() -{ - if (m_plugin->quirks().contains(PluginQuirkWantsMozillaUserAgent)) - return MozillaUserAgent; - - if (m_userAgent.isNull()) - m_userAgent = m_parentFrame->loader()->userAgent(m_url).utf8(); - - return m_userAgent.data(); -} - -const char* PluginView::userAgentStatic() -{ - return MozillaUserAgent; -} - NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf) { String filename(buf, len); diff --git a/src/3rdparty/webkit/WebCore/plugins/npapi.cpp b/src/3rdparty/webkit/WebCore/plugins/npapi.cpp index d275a39..4135b64 100644 --- a/src/3rdparty/webkit/WebCore/plugins/npapi.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/npapi.cpp @@ -171,9 +171,7 @@ void NPN_PopPopupsEnabledState(NPP instance) pluginViewForInstance(instance)->popPopupsEnabledState(); } -extern "C" { void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData) { PluginMainThreadScheduler::scheduler().scheduleCall(instance, func, userData); } -} diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp index b9c1656..7f5a7b9 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp @@ -63,7 +63,7 @@ bool PluginPackage::fetchInfo() String s = gm(); Vector<String> types; s.split(UChar(';'), false, types); - for (int i = 0; i < types.size(); ++i) { + for (unsigned i = 0; i < types.size(); ++i) { Vector<String> mime; types[i].split(UChar(':'), true, mime); if (mime.size() > 0) { diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp index 883c9aa..fdeac2f 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginViewQt.cpp @@ -45,6 +45,7 @@ #include "NotImplemented.h" #include "Page.h" #include "PlatformMouseEvent.h" +#include "PlatformKeyboardEvent.h" #include "PluginContainerQt.h" #include "PluginDebug.h" #include "PluginPackage.h" @@ -55,10 +56,12 @@ #include "npruntime_impl.h" #include "runtime.h" #include "runtime_root.h" +#include <QKeyEvent> #include <QWidget> #include <QX11Info> #include <runtime/JSLock.h> #include <runtime/JSValue.h> +#include <X11/X.h> using JSC::ExecState; using JSC::Interpreter; @@ -150,14 +153,76 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect) setNPWindowIfNeeded(); } +// TODO: Unify across ports. +bool PluginView::dispatchNPEvent(NPEvent& event) +{ + if (!m_plugin->pluginFuncs()->event) + return false; + + PluginView::setCurrentPluginView(this); + JSC::JSLock::DropAllLocks dropAllLocks(false); + + setCallingPlugin(true); + bool accepted = m_plugin->pluginFuncs(); + setCallingPlugin(false); + + return accepted; +} + +void setSharedXEventFields(XEvent& xEvent, QWidget* hostWindow) +{ + xEvent.xany.serial = 0; // we are unaware of the last request processed by X Server + xEvent.xany.send_event = false; + xEvent.xany.display = hostWindow->x11Info().display(); + // NOTE: event.xany.window doesn't always respond to the .window property of other XEvent's + // but does in the case of KeyPress, KeyRelease, ButtonPress, ButtonRelease, and MotionNotify + // events; thus, this is right: + xEvent.xany.window = hostWindow->window()->handle(); +} + +void setXKeyEventSpecificFields(XEvent& xEvent, KeyboardEvent* event) +{ + QKeyEvent* qKeyEvent = event->keyEvent()->qtEvent(); + + xEvent.xkey.root = QX11Info::appRootWindow(); + xEvent.xkey.subwindow = 0; // we have no child window + xEvent.xkey.time = event->timeStamp(); + xEvent.xkey.state = qKeyEvent->nativeModifiers(); + xEvent.xkey.keycode = qKeyEvent->nativeScanCode(); + xEvent.xkey.same_screen = true; + + // NOTE: As the XEvents sent to the plug-in are synthesized and there is not a native window + // corresponding to the plug-in rectangle, some of the members of the XEvent structures are not + // set to their normal Xserver values. e.g. Key events don't have a position. + // source: https://developer.mozilla.org/en/NPEvent + xEvent.xkey.x = 0; + xEvent.xkey.y = 0; + xEvent.xkey.x_root = 0; + xEvent.xkey.y_root = 0; +} + void PluginView::handleKeyboardEvent(KeyboardEvent* event) { - notImplemented(); + if (m_isWindowed) + return; + + if (event->type() != "keydown" && event->type() != "keyup") + return; + + XEvent npEvent; // On UNIX NPEvent is a typedef for XEvent. + + npEvent.type = (event->type() == "keydown") ? 2 : 3; // ints as Qt unsets KeyPress and KeyRelease + setSharedXEventFields(npEvent, m_parentFrame->view()->hostWindow()->platformWindow()); + setXKeyEventSpecificFields(npEvent, event); + + if (!dispatchNPEvent(npEvent)) + event->setDefaultHandled(); } void PluginView::handleMouseEvent(MouseEvent* event) { - notImplemented(); + if (m_isWindowed) + return; } void PluginView::setParent(ScrollView* parent) @@ -227,70 +292,6 @@ void PluginView::setParentVisible(bool visible) platformPluginWidget()->setVisible(visible); } -void PluginView::stop() -{ - if (!m_isStarted) - return; - - HashSet<RefPtr<PluginStream> > streams = m_streams; - HashSet<RefPtr<PluginStream> >::iterator end = streams.end(); - for (HashSet<RefPtr<PluginStream> >::iterator it = streams.begin(); it != end; ++it) { - (*it)->stop(); - disconnectStream((*it).get()); - } - - ASSERT(m_streams.isEmpty()); - - m_isStarted = false; - - JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); - - PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance); - - // Clear the window - m_npWindow.window = 0; - if (m_plugin->pluginFuncs()->setwindow && !m_plugin->quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) { - PluginView::setCurrentPluginView(this); - setCallingPlugin(true); - m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow); - setCallingPlugin(false); - PluginView::setCurrentPluginView(0); - } - - delete (NPSetWindowCallbackStruct *)m_npWindow.ws_info; - m_npWindow.ws_info = 0; - - // Destroy the plugin - { - PluginView::setCurrentPluginView(this); - setCallingPlugin(true); - m_plugin->pluginFuncs()->destroy(m_instance, 0); - setCallingPlugin(false); - PluginView::setCurrentPluginView(0); - } - - m_instance->pdata = 0; -} - -static const char* MozillaUserAgent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"; - -const char* PluginView::userAgent() -{ - if (m_plugin->quirks().contains(PluginQuirkWantsMozillaUserAgent)) - return MozillaUserAgent; - - if (m_userAgent.isNull()) - m_userAgent = m_parentFrame->loader()->userAgent(m_url).utf8(); - - return m_userAgent.data(); -} - -const char* PluginView::userAgentStatic() -{ - // FIXME - Just say we are Mozilla - return MozillaUserAgent; -} - NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf) { String filename(buf, len); @@ -435,46 +436,10 @@ void PluginView::forceRedraw() notImplemented(); } -PluginView::~PluginView() -{ - stop(); - - deleteAllValues(m_requests); - - freeStringArray(m_paramNames, m_paramCount); - freeStringArray(m_paramValues, m_paramCount); - - m_parentFrame->script()->cleanupScriptObjectsForPlugin(this); - - if (m_plugin && !(m_plugin->quirks().contains(PluginQuirkDontUnloadPlugin))) - m_plugin->unload(); - - delete platformPluginWidget(); -} - -void PluginView::init() +bool PluginView::platformStart() { - if (m_haveInitialized) - return; - m_haveInitialized = true; - - m_hasPendingGeometryChange = false; - - if (!m_plugin) { - ASSERT(m_status == PluginStatusCanNotFindPlugin); - return; - } - - if (!m_plugin->load()) { - m_plugin = 0; - m_status = PluginStatusCanNotLoadPlugin; - return; - } - - if (!start()) { - m_status = PluginStatusCanNotLoadPlugin; - return; - } + ASSERT(m_isStarted); + ASSERT(m_status == PluginStatusLoadedSuccessfully); if (m_plugin->pluginFuncs()->getvalue) { PluginView::setCurrentPluginView(this); @@ -489,9 +454,9 @@ void PluginView::init() setPlatformWidget(new PluginContainerQt(this, m_parentFrame->view()->hostWindow()->platformWindow())); } else { notImplemented(); - m_status = PluginStatusCanNotLoadPlugin; - return; + return false; } + show(); NPSetWindowCallbackStruct *wsi = new NPSetWindowCallbackStruct(); @@ -514,7 +479,13 @@ void PluginView::init() setNPWindowIfNeeded(); } - m_status = PluginStatusLoadedSuccessfully; + return true; +} + +void PluginView::platformDestroy() +{ + if (platformPluginWidget()) + delete platformPluginWidget(); } } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginPackageWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginPackageWin.cpp index 9e38925..e6fb9d5 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PluginPackageWin.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginPackageWin.cpp @@ -245,7 +245,9 @@ bool PluginPackage::load() m_loadCount++; return true; } else { -#if !PLATFORM(WINCE) +#if PLATFORM(WINCE) + m_module = ::LoadLibraryW(m_path.charactersWithNullTermination()); +#else WCHAR currentPath[MAX_PATH]; if (!::GetCurrentDirectoryW(MAX_PATH, currentPath)) @@ -255,12 +257,10 @@ bool PluginPackage::load() if (!::SetCurrentDirectoryW(path.charactersWithNullTermination())) return false; -#endif // Load the library m_module = ::LoadLibraryExW(m_path.charactersWithNullTermination(), 0, LOAD_WITH_ALTERED_SEARCH_PATH); -#if !PLATFORM(WINCE) if (!::SetCurrentDirectoryW(currentPath)) { if (m_module) ::FreeLibrary(m_module); diff --git a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp index 2687186..9ee8ee6 100644 --- a/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/win/PluginViewWin.cpp @@ -104,8 +104,6 @@ using namespace HTMLNames; const LPCWSTR kWebPluginViewdowClassName = L"WebPluginView"; const LPCWSTR kWebPluginViewProperty = L"WebPluginViewProperty"; -static const char* MozillaUserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"; - #if !PLATFORM(WINCE) // The code used to hook BeginPaint/EndPaint originally came from // <http://www.fengyuan.com/article/wmprint.html>. @@ -411,7 +409,7 @@ void PluginView::updatePluginWidget() m_clipRect = windowClipRect(); m_clipRect.move(-m_windowRect.x(), -m_windowRect.y()); - if (platformPluginWidget() && (m_windowRect != oldWindowRect || m_clipRect != oldClipRect)) { + if (platformPluginWidget() && (!m_haveUpdatedPluginWidget || m_windowRect != oldWindowRect || m_clipRect != oldClipRect)) { HRGN rgn; setCallingPlugin(true); @@ -429,7 +427,7 @@ void PluginView::updatePluginWidget() ::SetWindowRgn(platformPluginWidget(), rgn, TRUE); } - if (m_windowRect != oldWindowRect) + if (!m_haveUpdatedPluginWidget || m_windowRect != oldWindowRect) ::MoveWindow(platformPluginWidget(), m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE); if (clipToZeroRect) { @@ -438,6 +436,8 @@ void PluginView::updatePluginWidget() } setCallingPlugin(false); + + m_haveUpdatedPluginWidget = true; } } @@ -795,80 +795,6 @@ void PluginView::setNPWindowRect(const IntRect& rect) } } -void PluginView::stop() -{ - if (!m_isStarted) - return; - - HashSet<RefPtr<PluginStream> > streams = m_streams; - HashSet<RefPtr<PluginStream> >::iterator end = streams.end(); - for (HashSet<RefPtr<PluginStream> >::iterator it = streams.begin(); it != end; ++it) { - (*it)->stop(); - disconnectStream((*it).get()); - } - - ASSERT(m_streams.isEmpty()); - - m_isStarted = false; - - // Unsubclass the window - if (m_isWindowed) { -#if PLATFORM(WINCE) - WNDPROC currentWndProc = (WNDPROC)GetWindowLong(platformPluginWidget(), GWL_WNDPROC); - - if (currentWndProc == PluginViewWndProc) - SetWindowLong(platformPluginWidget(), GWL_WNDPROC, (LONG)m_pluginWndProc); -#else - WNDPROC currentWndProc = (WNDPROC)GetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC); - - if (currentWndProc == PluginViewWndProc) - SetWindowLongPtr(platformPluginWidget(), GWLP_WNDPROC, (LONG)m_pluginWndProc); -#endif - } - - JSC::JSLock::DropAllLocks dropAllLocks(JSC::SilenceAssertionsOnly); - - // Clear the window - m_npWindow.window = 0; - if (m_plugin->pluginFuncs()->setwindow && !m_plugin->quirks().contains(PluginQuirkDontSetNullWindowHandleOnDestroy)) { - setCallingPlugin(true); - m_plugin->pluginFuncs()->setwindow(m_instance, &m_npWindow); - setCallingPlugin(false); - } - - PluginMainThreadScheduler::scheduler().unregisterPlugin(m_instance); - - // Destroy the plugin - NPSavedData* savedData = 0; - setCallingPlugin(true); - NPError npErr = m_plugin->pluginFuncs()->destroy(m_instance, &savedData); - setCallingPlugin(false); - LOG_NPERROR(npErr); - - if (savedData) { - if (savedData->buf) - NPN_MemFree(savedData->buf); - NPN_MemFree(savedData); - } - - m_instance->pdata = 0; -} - -const char* PluginView::userAgentStatic() -{ - return 0; -} - -const char* PluginView::userAgent() -{ - if (m_plugin->quirks().contains(PluginQuirkWantsMozillaUserAgent)) - return MozillaUserAgent; - - if (m_userAgent.isNull()) - m_userAgent = m_parentFrame->loader()->userAgent(m_url).utf8(); - return m_userAgent.data(); -} - NPError PluginView::handlePostReadFile(Vector<char>& buffer, uint32 len, const char* buf) { String filename(buf, len); @@ -1029,47 +955,10 @@ void PluginView::forceRedraw() ::UpdateWindow(windowHandleForPlatformWidget(parent() ? parent()->hostWindow()->platformWindow() : 0)); } -PluginView::~PluginView() +bool PluginView::platformStart() { - if (m_instance) - m_instance->ndata = 0; - stop(); - - deleteAllValues(m_requests); - - freeStringArray(m_paramNames, m_paramCount); - freeStringArray(m_paramValues, m_paramCount); - - if (platformPluginWidget()) - DestroyWindow(platformPluginWidget()); - - m_parentFrame->script()->cleanupScriptObjectsForPlugin(this); - - if (m_plugin && !m_plugin->quirks().contains(PluginQuirkDontUnloadPlugin)) - m_plugin->unload(); -} - -void PluginView::init() -{ - if (m_haveInitialized) - return; - m_haveInitialized = true; - - if (!m_plugin) { - ASSERT(m_status == PluginStatusCanNotFindPlugin); - return; - } - - if (!m_plugin->load()) { - m_plugin = 0; - m_status = PluginStatusCanNotLoadPlugin; - return; - } - - if (!start()) { - m_status = PluginStatusCanNotLoadPlugin; - return; - } + ASSERT(m_isStarted); + ASSERT(m_status == PluginStatusLoadedSuccessfully); if (m_isWindowed) { registerPluginView(); @@ -1109,10 +998,18 @@ void PluginView::init() m_npWindow.window = 0; } + updatePluginWidget(); + if (!m_plugin->quirks().contains(PluginQuirkDeferFirstSetWindowCall)) setNPWindowRect(frameRect()); - m_status = PluginStatusLoadedSuccessfully; + return true; +} + +void PluginView::platformDestroy() +{ + if (platformPluginWidget()) + DestroyWindow(platformPluginWidget()); } } // namespace WebCore |