diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-07 11:21:11 +0200 |
commit | 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch) | |
tree | 988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebCore/plugins | |
parent | dd91e772430dc294e3bf478c119ef8d43c0a3358 (diff) | |
download | qtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz |
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebCore/plugins')
-rw-r--r-- | Source/WebCore/plugins/PluginDatabase.cpp | 10 | ||||
-rw-r--r-- | Source/WebCore/plugins/PluginView.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/plugins/blackberry/PluginPackageBlackBerry.cpp | 3 | ||||
-rw-r--r-- | Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp | 25 | ||||
-rw-r--r-- | Source/WebCore/plugins/efl/PluginViewEfl.cpp | 4 | ||||
-rw-r--r-- | Source/WebCore/plugins/gtk/PluginDataGtk.cpp | 65 | ||||
-rw-r--r-- | Source/WebCore/plugins/gtk/PluginViewGtk.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/plugins/mac/PluginPackageMac.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/plugins/mac/PluginViewMac.mm | 2 | ||||
-rw-r--r-- | Source/WebCore/plugins/npapi.h | 10 | ||||
-rw-r--r-- | Source/WebCore/plugins/qt/PluginViewQt.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/plugins/win/PluginDatabaseWin.cpp | 2 |
12 files changed, 29 insertions, 101 deletions
diff --git a/Source/WebCore/plugins/PluginDatabase.cpp b/Source/WebCore/plugins/PluginDatabase.cpp index 3e598bab6..9508c5b8c 100644 --- a/Source/WebCore/plugins/PluginDatabase.cpp +++ b/Source/WebCore/plugins/PluginDatabase.cpp @@ -283,7 +283,7 @@ PluginPackage* PluginDatabase::findPlugin(const KURL& url, String& mimeType) return pluginForMIMEType(mimeType); String filename = url.lastPathComponent(); - if (filename.endsWith("/")) + if (filename.endsWith('/')) return 0; int extensionPos = filename.reverseFind('.'); @@ -323,7 +323,7 @@ bool PluginDatabase::add(PassRefPtr<PluginPackage> prpPackage) RefPtr<PluginPackage> package = prpPackage; - if (!m_plugins.add(package).second) + if (!m_plugins.add(package).isNewEntry) return false; m_pluginsByPath.add(package->path(), package); @@ -428,7 +428,9 @@ bool PluginDatabase::isPreferredPluginDirectory(const String& path) { String preferredPath = homeDirectoryPath(); -#if defined(XP_UNIX) +#if PLATFORM(BLACKBERRY) + preferredPath = BlackBerry::Platform::Client::get()->getApplicationPluginDirectory().c_str(); +#elif defined(XP_UNIX) preferredPath.append(String("/.mozilla/plugins")); #elif defined(XP_MACOSX) preferredPath.append(String("/Library/Internet Plug-Ins")); @@ -574,7 +576,7 @@ void PluginDatabase::loadPersistentMetadataCache() RefPtr<PluginPackage> package = PluginPackage::createPackageFromCache(path, lastModified, name, desc, mimeDesc); - if (package && cachedPlugins.add(package).second) { + if (package && cachedPlugins.add(package).isNewEntry) { cachedPluginPathsWithTimes.add(package->path(), package->lastModified()); cachedPluginsByPath.add(package->path(), package); } diff --git a/Source/WebCore/plugins/PluginView.cpp b/Source/WebCore/plugins/PluginView.cpp index 749f60979..9a5ffa8fc 100644 --- a/Source/WebCore/plugins/PluginView.cpp +++ b/Source/WebCore/plugins/PluginView.cpp @@ -366,8 +366,7 @@ void PluginView::stop() } #ifdef XP_UNIX - if (m_isWindowed && m_npWindow.ws_info) - delete (NPSetWindowCallbackStruct *)m_npWindow.ws_info; + delete static_cast<NPSetWindowCallbackStruct*>(m_npWindow.ws_info); m_npWindow.ws_info = 0; #endif diff --git a/Source/WebCore/plugins/blackberry/PluginPackageBlackBerry.cpp b/Source/WebCore/plugins/blackberry/PluginPackageBlackBerry.cpp index 33b5a7bb7..967c7d30c 100644 --- a/Source/WebCore/plugins/blackberry/PluginPackageBlackBerry.cpp +++ b/Source/WebCore/plugins/blackberry/PluginPackageBlackBerry.cpp @@ -192,7 +192,8 @@ unsigned PluginPackage::hash() const const unsigned hashCodes[] = { m_name.impl()->hash(), m_description.impl()->hash(), - m_mimeToExtensions.size() + m_mimeToExtensions.size(), + m_path.impl()->hash() }; return StringHasher::computeHash(reinterpret_cast<const UChar*>(hashCodes), sizeof(hashCodes) / sizeof(UChar)); diff --git a/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp b/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp index 6518025cb..b62933d31 100644 --- a/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp +++ b/Source/WebCore/plugins/blackberry/PluginViewBlackBerry.cpp @@ -473,10 +473,8 @@ void PluginView::handleWheelEvent(WheelEvent* event) npEvent.type = NP_WheelEvent; npEvent.data = &wheelEvent; - if (dispatchNPEvent(npEvent)) { + if (dispatchNPEvent(npEvent)) event->setDefaultHandled(); - event->setPluginHandled(); - } } void PluginView::handleTouchEvent(TouchEvent* event) @@ -537,17 +535,14 @@ void PluginView::handleTouchEvent(TouchEvent* event) npEvent.type = NP_TouchEvent; npEvent.data = &npTouchEvent; - if (dispatchNPEvent(npEvent)) { + if (dispatchNPEvent(npEvent)) event->setDefaultHandled(); - event->setPluginHandled(); - } else if (npTouchEvent.type == TOUCH_EVENT_DOUBLETAP) { + else if (npTouchEvent.type == TOUCH_EVENT_DOUBLETAP) { // Send Touch Up if double tap not consumed npTouchEvent.type = TOUCH_EVENT_END; npEvent.data = &npTouchEvent; - if (dispatchNPEvent(npEvent)) { + if (dispatchNPEvent(npEvent)) event->setDefaultHandled(); - event->setPluginHandled(); - } } } @@ -586,10 +581,8 @@ void PluginView::handleMouseEvent(MouseEvent* event) npEvent.type = NP_MouseEvent; npEvent.data = &mouseEvent; - if (dispatchNPEvent(npEvent)) { + if (dispatchNPEvent(npEvent)) event->setDefaultHandled(); - event->setPluginHandled(); - } } void PluginView::handleFocusInEvent() @@ -1300,14 +1293,6 @@ void PluginView::platformDestroy() m_private = 0; } -void PluginView::halt() -{ -} - -void PluginView::restart() -{ -} - void PluginView::getWindowInfo(Vector<PluginWindowInfo>& windowList) { if (!m_plugin->pluginFuncs()->getvalue) diff --git a/Source/WebCore/plugins/efl/PluginViewEfl.cpp b/Source/WebCore/plugins/efl/PluginViewEfl.cpp index 586802c93..86ea2009c 100644 --- a/Source/WebCore/plugins/efl/PluginViewEfl.cpp +++ b/Source/WebCore/plugins/efl/PluginViewEfl.cpp @@ -38,6 +38,7 @@ #include "HostWindow.h" #include "MouseEvent.h" #include "NotImplemented.h" +#include "PageClientEfl.h" #include "PluginPackage.h" #include "npruntime_impl.h" #include "runtime/JSLock.h" @@ -282,7 +283,8 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re } case NPNVnetscapeWindow: { - Evas_Object* widget = m_parentFrame->view()->hostWindow()->platformPageClient(); + PageClientEfl* pageClient = static_cast<PageClientEfl*>(m_parentFrame->view()->hostWindow()->platformPageClient()); + Evas_Object* widget = pageClient->view(); Evas* evas = evas_object_evas_get(widget); Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas); *static_cast<XID*>(value) = static_cast<Window>(ecore_evas_window_get(ecoreEvas)); diff --git a/Source/WebCore/plugins/gtk/PluginDataGtk.cpp b/Source/WebCore/plugins/gtk/PluginDataGtk.cpp deleted file mode 100644 index 705bf9a3a..000000000 --- a/Source/WebCore/plugins/gtk/PluginDataGtk.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) - 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> -namespace WebCore { - -void PluginData::initPlugins(const Page*) -{ - PluginDatabase *db = PluginDatabase::installedPlugins(); - const Vector<PluginPackage*> &plugins = db->plugins(); - - for (unsigned int i = 0; i < plugins.size(); ++i) { - PluginInfo info; - PluginPackage* package = plugins[i]; - - info.name = package->name(); - info.file = package->fileName(); - info.desc = package->description(); - - const MIMEToDescriptionsMap& mimeToDescriptions = package->mimeToDescriptions(); - MIMEToDescriptionsMap::const_iterator end = mimeToDescriptions.end(); - for (MIMEToDescriptionsMap::const_iterator it = mimeToDescriptions.begin(); it != end; ++it) { - MimeClassInfo mime; - - mime.type = it->first; - mime.desc = it->second; - mime.extensions = package->mimeToExtensions().get(mime.type); - - info.mimes.append(mime); - } - - m_plugins.append(info); - } -} - -void PluginData::refresh() -{ - PluginDatabase *db = PluginDatabase::installedPlugins(); - db->refresh(); -} - -}; diff --git a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp b/Source/WebCore/plugins/gtk/PluginViewGtk.cpp index c568a4b92..d8c742914 100644 --- a/Source/WebCore/plugins/gtk/PluginViewGtk.cpp +++ b/Source/WebCore/plugins/gtk/PluginViewGtk.cpp @@ -56,7 +56,7 @@ #include "PluginDebug.h" #include "PluginMainThreadScheduler.h" #include "PluginPackage.h" -#include "RenderLayer.h" +#include "RenderObject.h" #include "Settings.h" #include "SpatialNavigation.h" #include "JSDOMBinding.h" diff --git a/Source/WebCore/plugins/mac/PluginPackageMac.cpp b/Source/WebCore/plugins/mac/PluginPackageMac.cpp index 723e3c66a..103322731 100644 --- a/Source/WebCore/plugins/mac/PluginPackageMac.cpp +++ b/Source/WebCore/plugins/mac/PluginPackageMac.cpp @@ -139,7 +139,7 @@ bool PluginPackage::fetchInfo() if (mimeTypesFileName && CFGetTypeID(mimeTypesFileName.get()) == CFStringGetTypeID()) { WTF::RetainPtr<CFStringRef> fileName = (CFStringRef)mimeTypesFileName.get(); - WTF::RetainPtr<CFStringRef> homeDir = homeDirectoryPath().createCFString(); + WTF::RetainPtr<CFStringRef> homeDir = adoptCF(homeDirectoryPath().createCFString()); WTF::RetainPtr<CFStringRef> path(AdoptCF, CFStringCreateWithFormat(0, 0, CFSTR("%@/Library/Preferences/%@"), homeDir.get(), fileName.get())); WTF::RetainPtr<CFDictionaryRef> plist = readPListFile(path.get(), /*createFile*/ false, m_module); diff --git a/Source/WebCore/plugins/mac/PluginViewMac.mm b/Source/WebCore/plugins/mac/PluginViewMac.mm index 901a359b5..2d9d68699 100644 --- a/Source/WebCore/plugins/mac/PluginViewMac.mm +++ b/Source/WebCore/plugins/mac/PluginViewMac.mm @@ -55,7 +55,7 @@ #include "PluginDebug.h" #include "PluginPackage.h" #include "PluginMainThreadScheduler.h" -#include "RenderLayer.h" +#include "RenderObject.h" #include "ScriptController.h" #include "Settings.h" #include "npruntime_impl.h" diff --git a/Source/WebCore/plugins/npapi.h b/Source/WebCore/plugins/npapi.h index 1de47e866..305a1626c 100644 --- a/Source/WebCore/plugins/npapi.h +++ b/Source/WebCore/plugins/npapi.h @@ -90,9 +90,11 @@ #endif #if defined(XP_UNIX) +#include <stdio.h> +#if defined(MOZ_X11) #include <X11/Xlib.h> #include <X11/Xutil.h> -#include <stdio.h> +#endif #endif /*----------------------------------------------------------------------*/ @@ -266,10 +268,12 @@ typedef struct typedef struct { int32_t type; +#if defined(MOZ_X11) Display* display; Visual* visual; Colormap colormap; unsigned int depth; +#endif } NPSetWindowCallbackStruct; typedef struct @@ -535,7 +539,7 @@ typedef struct _NPEvent uint32_t wParam; uint32_t lParam; } NPEvent; -#elif defined(XP_UNIX) +#elif defined(XP_UNIX) && defined(MOZ_X11) typedef XEvent NPEvent; #else typedef void* NPEvent; @@ -549,7 +553,7 @@ typedef RgnHandle NPQDRegion; typedef CGPathRef NPCGRegion; #elif defined(XP_WIN) typedef HRGN NPRegion; -#elif defined(XP_UNIX) +#elif defined(XP_UNIX) && defined(MOZ_X11) typedef Region NPRegion; #else typedef void *NPRegion; diff --git a/Source/WebCore/plugins/qt/PluginViewQt.cpp b/Source/WebCore/plugins/qt/PluginViewQt.cpp index ff912db56..ac31cf002 100644 --- a/Source/WebCore/plugins/qt/PluginViewQt.cpp +++ b/Source/WebCore/plugins/qt/PluginViewQt.cpp @@ -63,7 +63,7 @@ #include "PluginPackage.h" #include "PluginMainThreadScheduler.h" #include "QWebPageClient.h" -#include "RenderLayer.h" +#include "RenderObject.h" #include "Settings.h" #include "npruntime_impl.h" #if USE(JSC) diff --git a/Source/WebCore/plugins/win/PluginDatabaseWin.cpp b/Source/WebCore/plugins/win/PluginDatabaseWin.cpp index 27121c664..ffb421a4c 100644 --- a/Source/WebCore/plugins/win/PluginDatabaseWin.cpp +++ b/Source/WebCore/plugins/win/PluginDatabaseWin.cpp @@ -142,7 +142,7 @@ void PluginDatabase::getPluginPathsInDirectories(HashSet<String>& paths) const continue; String fullPath = *it + "\\" + filename; - if (!uniqueFilenames.add(fullPath).second) + if (!uniqueFilenames.add(fullPath).isNewEntry) continue; paths.add(fullPath); |