[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 12:55:43 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fae190d2be5363ee63845991983c0f3eb594e570
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 2 03:14:51 2010 +0000

    2010-09-01  Balazs Kelemen  <kb at inf.u-szeged.hu>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Implement PluginInfoStore for UNIX
            https://bugs.webkit.org/show_bug.cgi?id=45038
    
            This implementation is generally just reusing the logic in WebCore since
            there is no way to get informations from a UNIX plugin without loading it
            - in contrast to mac bundles and windows dll-s.
            * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
            (WebKit::PluginInfoStore::pluginsDirectories):
            (WebKit::PluginInfoStore::pluginPathsInDirectory):
            (WebKit::PluginInfoStore::getPluginInfo):
            (WebKit::PluginInfoStore::shouldUsePlugin):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66636 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 649032a..6a88791 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-01  Balazs Kelemen  <kb at inf.u-szeged.hu>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Implement PluginInfoStore for UNIX
+        https://bugs.webkit.org/show_bug.cgi?id=45038
+
+        This implementation is generally just reusing the logic in WebCore since
+        there is no way to get informations from a UNIX plugin without loading it
+        - in contrast to mac bundles and windows dll-s.
+        * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
+        (WebKit::PluginInfoStore::pluginsDirectories):
+        (WebKit::PluginInfoStore::pluginPathsInDirectory):
+        (WebKit::PluginInfoStore::getPluginInfo):
+        (WebKit::PluginInfoStore::shouldUsePlugin):
+
 2010-09-01  Mark Rowe  <mrowe at apple.com>
 
         Reviewed by Sam Weinig.
diff --git a/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp b/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
index 2b10123..f8ffeb0 100644
--- a/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
+++ b/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
@@ -23,9 +23,12 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+// Note: this file is only for UNIX. On other platforms we can reuse the native implementation.
+
 #include "PluginInfoStore.h"
 
-#include "NotImplemented.h"
+#include "PluginDatabase.h"
+#include "PluginPackage.h"
 
 using namespace WebCore;
 
@@ -33,26 +36,57 @@ namespace WebKit {
 
 Vector<String> PluginInfoStore::pluginsDirectories()
 {
-    notImplemented();
-    return Vector<String>();
+    return PluginDatabase::defaultPluginDirectories();
 }
 
 Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory)
 {
-    notImplemented();
-    return Vector<String>();
+    Vector<String> result;
+    Vector<String> pluginPaths = listDirectory(directory, String("*.so"));
+    Vector<String>::const_iterator end = pluginPaths.end();
+    for (Vector<String>::const_iterator it = pluginPaths.begin(); it != end; ++it) {
+        if (fileExists(*it))
+            result.append(*it);
+    }
+
+    return result;
 }
 
 bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
 {
-    notImplemented();
-    return false;
+    // We are loading the plugin here since it does not seem to be a standardized way to
+    // get the needed informations from a UNIX plugin without loading it.
+
+    RefPtr<PluginPackage> package = PluginPackage::createPackage(pluginPath, 0 /*lastModified*/);
+    if (!package)
+        return false;
+
+    plugin.path = pluginPath;
+    plugin.info.desc = package->description();
+    plugin.info.file = package->fileName();
+
+    const MIMEToDescriptionsMap& descriptions = package->mimeToDescriptions();
+    const MIMEToExtensionsMap& extensions = package->mimeToExtensions();
+    Vector<MimeClassInfo> mimes(descriptions.size());
+    MIMEToDescriptionsMap::const_iterator descEnd = descriptions.end();
+    unsigned i = 0;
+    for (MIMEToDescriptionsMap::const_iterator it = descriptions.begin(); it != descEnd; ++it) {
+        MimeClassInfo& mime = mimes[i++];
+        mime.type = it->first;
+        mime.desc = it->second;
+        MIMEToExtensionsMap::const_iterator extensionIt = extensions.find(it->first);
+        ASSERT(extensionIt != extensions.end());
+        mime.extensions = extensionIt->second;
+    }
+
+    package->unload();
+    return true;
 }
 
 bool PluginInfoStore::shouldUsePlugin(const Plugin& plugin, const Vector<Plugin>& loadedPlugins)
 {
-    notImplemented();
-    return false;
+    // We do not do any black-listing presently.
+    return true;
 }
 
 } // namespace WebKit

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list