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

aroben at apple.com aroben at apple.com
Wed Dec 22 14:38:39 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 41fe0133982582d216bfa2b5338d03ba7cbe1311
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 14 19:22:08 2010 +0000

    Load plugins that are specified in the MozillaPlugins registry key
    
    Fixes <http://webkit.org/b/44271> <rdar://problem/8329750> WebKit2
    should load plugins specified in the MozillaPlugins registry key (like
    old WebKit does)
    
    I couldn't think of a good way to test this.
    
    Reviewed by Steve Falkenburg.
    
    * UIProcess/Plugins/PluginInfoStore.cpp:
    (WebKit::PluginInfoStore::loadPluginsIfNecessary): Also load plugins
    specified by individualPluginPaths.
    
    * UIProcess/Plugins/PluginInfoStore.h: Added individualPluginPaths and
    some comments.
    
    * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
    (WebKit::PluginInfoStore::individualPluginPaths):
    * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
    (WebKit::PluginInfoStore::individualPluginPaths):
    Stubbed out.
    
    * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
    (WebKit::addPluginPathsFromRegistry):
    (WebKit::PluginInfoStore::individualPluginPaths):
    Ported this code from WebCore's PluginDatabaseWin.cpp. I slightly
    cleaned it up and changed it to use a case-insensitive hash, since
    paths on Windows are case-insensitive.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69789 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6790223..8ddbf26 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,37 @@
 2010-10-14  Adam Roben  <aroben at apple.com>
 
+        Load plugins that are specified in the MozillaPlugins registry key
+
+        Fixes <http://webkit.org/b/44271> <rdar://problem/8329750> WebKit2
+        should load plugins specified in the MozillaPlugins registry key (like
+        old WebKit does)
+
+        I couldn't think of a good way to test this.
+
+        Reviewed by Steve Falkenburg.
+
+        * UIProcess/Plugins/PluginInfoStore.cpp:
+        (WebKit::PluginInfoStore::loadPluginsIfNecessary): Also load plugins
+        specified by individualPluginPaths.
+
+        * UIProcess/Plugins/PluginInfoStore.h: Added individualPluginPaths and
+        some comments.
+
+        * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
+        (WebKit::PluginInfoStore::individualPluginPaths):
+        * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp:
+        (WebKit::PluginInfoStore::individualPluginPaths):
+        Stubbed out.
+
+        * UIProcess/Plugins/win/PluginInfoStoreWin.cpp:
+        (WebKit::addPluginPathsFromRegistry):
+        (WebKit::PluginInfoStore::individualPluginPaths):
+        Ported this code from WebCore's PluginDatabaseWin.cpp. I slightly
+        cleaned it up and changed it to use a case-insensitive hash, since
+        paths on Windows are case-insensitive.
+
+2010-10-14  Adam Roben  <aroben at apple.com>
+
         Call ::DefWindowProcW for unhandled key events
 
         ::DefWindowProcW does important things for at least some key events
diff --git a/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp b/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
index 93d3c87..8faffa1 100644
--- a/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
+++ b/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
@@ -62,10 +62,16 @@ void PluginInfoStore::loadPluginsIfNecessary()
     for (size_t i = 0; i < m_additionalPluginsDirectories.size(); ++i)
         loadPluginsInDirectory(m_additionalPluginsDirectories[i]);
 
+    // Then load plug-ins from the standard plug-ins directories.
     Vector<String> directories = pluginsDirectories();
     for (size_t i = 0; i < directories.size(); ++i)
         loadPluginsInDirectory(directories[i]);
 
+    // Then load plug-ins that are not in the standard plug-ins directories.
+    Vector<String> paths = individualPluginPaths();
+    for (size_t i = 0; i < paths.size(); ++i)
+        loadPlugin(paths[i]);
+
     m_pluginListIsUpToDate = true;
 }
 
diff --git a/WebKit2/UIProcess/Plugins/PluginInfoStore.h b/WebKit2/UIProcess/Plugins/PluginInfoStore.h
index e28111a..179bacf 100644
--- a/WebKit2/UIProcess/Plugins/PluginInfoStore.h
+++ b/WebKit2/UIProcess/Plugins/PluginInfoStore.h
@@ -71,9 +71,14 @@ private:
     void loadPluginsInDirectory(const String& directory);
     void loadPlugin(const String& pluginPath);
     
-    // Platform specific member functions.
+    // Platform-specific member functions
+
+    // Returns paths to directories that should be searched for plug-ins (via pluginPathsInDirectory).
     static Vector<String> pluginsDirectories();
+    // Returns paths to all plug-ins in the specified directory.
     static Vector<String> pluginPathsInDirectory(const String& directory);
+    // Returns paths to individual plug-ins that won't be found via pluginsDirectories/pluginPathsInDirectory.
+    static Vector<String> individualPluginPaths();
     static bool getPluginInfo(const String& pluginPath, Plugin& plugin);
     static bool shouldUsePlugin(const Plugin& plugin, const Vector<Plugin>& loadedPlugins);
     static String getMIMETypeForExtension(const String& extension);
diff --git a/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm b/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
index 947226f..902d42f 100644
--- a/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
+++ b/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
@@ -64,6 +64,11 @@ Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory)
     return pluginPaths;
 }
 
+Vector<String> PluginInfoStore::individualPluginPaths()
+{
+    return Vector<String>();
+}
+
 static bool getPluginArchitecture(CFBundleRef bundle, cpu_type_t& pluginArchitecture)
 {
     RetainPtr<CFArrayRef> pluginArchitecturesArray(AdoptCF, CFBundleCopyExecutableArchitectures(bundle));
diff --git a/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp b/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
index f8ffeb0..3e50da0 100644
--- a/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
+++ b/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
@@ -52,6 +52,11 @@ Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory)
     return result;
 }
 
+Vector<String> PluginInfoStore::individualPluginPaths()
+{
+    return Vector<String>();
+}
+
 bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin)
 {
     // We are loading the plugin here since it does not seem to be a standardized way to
diff --git a/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp b/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
index e0c80a6..2829796 100644
--- a/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
+++ b/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
@@ -29,7 +29,9 @@
 #include "NotImplemented.h"
 #include <WebCore/FileSystem.h>
 #include <shlwapi.h>
+#include <wtf/HashSet.h>
 #include <wtf/OwnArrayPtr.h>
+#include <wtf/text/StringHash.h>
 
 using namespace WebCore;
 
@@ -303,6 +305,45 @@ Vector<String> PluginInfoStore::pluginPathsInDirectory(const String& directory)
     return paths;
 }
 
+static void addPluginPathsFromRegistry(HKEY rootKey, HashSet<String, CaseFoldingHash>& paths)
+{
+    HKEY key;
+    if (::RegOpenKeyExW(rootKey, L"Software\\MozillaPlugins", 0, KEY_ENUMERATE_SUB_KEYS, &key) != ERROR_SUCCESS)
+        return;
+
+    for (size_t i = 0; ; ++i) {
+        // MSDN says that key names have a maximum length of 255 characters.
+        wchar_t name[256];
+        DWORD nameLen = _countof(name);
+        if (::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, 0) != ERROR_SUCCESS)
+            break;
+
+        wchar_t path[MAX_PATH];
+        DWORD pathSizeInBytes = sizeof(path);
+        DWORD type;
+        if (::SHGetValueW(key, name, L"Path", &type, path, &pathSizeInBytes) != ERROR_SUCCESS)
+            continue;
+        if (type != REG_SZ)
+            continue;
+
+        paths.add(path);
+    }
+
+    ::RegCloseKey(key);
+}
+
+Vector<String> PluginInfoStore::individualPluginPaths()
+{
+    HashSet<String, CaseFoldingHash> paths;
+
+    addPluginPathsFromRegistry(HKEY_LOCAL_MACHINE, paths);
+    addPluginPathsFromRegistry(HKEY_CURRENT_USER, paths);
+
+    Vector<String> result;
+    copyToVector(paths, result);
+    return result;
+}
+
 static String getVersionInfo(const LPVOID versionInfoData, const String& info)
 {
     LPVOID buffer;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list