Changeset 69789 in webkit
- Timestamp:
- Oct 14, 2010 12:22:08 PM (13 years ago)
- Location:
- trunk/WebKit2
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r69788 r69789 1 2010-10-14 Adam Roben <aroben@apple.com> 2 3 Load plugins that are specified in the MozillaPlugins registry key 4 5 Fixes <http://webkit.org/b/44271> <rdar://problem/8329750> WebKit2 6 should load plugins specified in the MozillaPlugins registry key (like 7 old WebKit does) 8 9 I couldn't think of a good way to test this. 10 11 Reviewed by Steve Falkenburg. 12 13 * UIProcess/Plugins/PluginInfoStore.cpp: 14 (WebKit::PluginInfoStore::loadPluginsIfNecessary): Also load plugins 15 specified by individualPluginPaths. 16 17 * UIProcess/Plugins/PluginInfoStore.h: Added individualPluginPaths and 18 some comments. 19 20 * UIProcess/Plugins/mac/PluginInfoStoreMac.mm: 21 (WebKit::PluginInfoStore::individualPluginPaths): 22 * UIProcess/Plugins/qt/PluginInfoStoreQt.cpp: 23 (WebKit::PluginInfoStore::individualPluginPaths): 24 Stubbed out. 25 26 * UIProcess/Plugins/win/PluginInfoStoreWin.cpp: 27 (WebKit::addPluginPathsFromRegistry): 28 (WebKit::PluginInfoStore::individualPluginPaths): 29 Ported this code from WebCore's PluginDatabaseWin.cpp. I slightly 30 cleaned it up and changed it to use a case-insensitive hash, since 31 paths on Windows are case-insensitive. 32 1 33 2010-10-14 Adam Roben <aroben@apple.com> 2 34 -
trunk/WebKit2/UIProcess/Plugins/PluginInfoStore.cpp
r68170 r69789 63 63 loadPluginsInDirectory(m_additionalPluginsDirectories[i]); 64 64 65 // Then load plug-ins from the standard plug-ins directories. 65 66 Vector<String> directories = pluginsDirectories(); 66 67 for (size_t i = 0; i < directories.size(); ++i) 67 68 loadPluginsInDirectory(directories[i]); 69 70 // Then load plug-ins that are not in the standard plug-ins directories. 71 Vector<String> paths = individualPluginPaths(); 72 for (size_t i = 0; i < paths.size(); ++i) 73 loadPlugin(paths[i]); 68 74 69 75 m_pluginListIsUpToDate = true; -
trunk/WebKit2/UIProcess/Plugins/PluginInfoStore.h
r68170 r69789 72 72 void loadPlugin(const String& pluginPath); 73 73 74 // Platform specific member functions. 74 // Platform-specific member functions 75 76 // Returns paths to directories that should be searched for plug-ins (via pluginPathsInDirectory). 75 77 static Vector<String> pluginsDirectories(); 78 // Returns paths to all plug-ins in the specified directory. 76 79 static Vector<String> pluginPathsInDirectory(const String& directory); 80 // Returns paths to individual plug-ins that won't be found via pluginsDirectories/pluginPathsInDirectory. 81 static Vector<String> individualPluginPaths(); 77 82 static bool getPluginInfo(const String& pluginPath, Plugin& plugin); 78 83 static bool shouldUsePlugin(const Plugin& plugin, const Vector<Plugin>& loadedPlugins); -
trunk/WebKit2/UIProcess/Plugins/mac/PluginInfoStoreMac.mm
r67775 r69789 65 65 } 66 66 67 Vector<String> PluginInfoStore::individualPluginPaths() 68 { 69 return Vector<String>(); 70 } 71 67 72 static bool getPluginArchitecture(CFBundleRef bundle, cpu_type_t& pluginArchitecture) 68 73 { -
trunk/WebKit2/UIProcess/Plugins/qt/PluginInfoStoreQt.cpp
r66636 r69789 53 53 } 54 54 55 Vector<String> PluginInfoStore::individualPluginPaths() 56 { 57 return Vector<String>(); 58 } 59 55 60 bool PluginInfoStore::getPluginInfo(const String& pluginPath, Plugin& plugin) 56 61 { -
trunk/WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp
r65704 r69789 30 30 #include <WebCore/FileSystem.h> 31 31 #include <shlwapi.h> 32 #include <wtf/HashSet.h> 32 33 #include <wtf/OwnArrayPtr.h> 34 #include <wtf/text/StringHash.h> 33 35 34 36 using namespace WebCore; … … 302 304 303 305 return paths; 306 } 307 308 static void addPluginPathsFromRegistry(HKEY rootKey, HashSet<String, CaseFoldingHash>& paths) 309 { 310 HKEY key; 311 if (::RegOpenKeyExW(rootKey, L"Software\\MozillaPlugins", 0, KEY_ENUMERATE_SUB_KEYS, &key) != ERROR_SUCCESS) 312 return; 313 314 for (size_t i = 0; ; ++i) { 315 // MSDN says that key names have a maximum length of 255 characters. 316 wchar_t name[256]; 317 DWORD nameLen = _countof(name); 318 if (::RegEnumKeyExW(key, i, name, &nameLen, 0, 0, 0, 0) != ERROR_SUCCESS) 319 break; 320 321 wchar_t path[MAX_PATH]; 322 DWORD pathSizeInBytes = sizeof(path); 323 DWORD type; 324 if (::SHGetValueW(key, name, L"Path", &type, path, &pathSizeInBytes) != ERROR_SUCCESS) 325 continue; 326 if (type != REG_SZ) 327 continue; 328 329 paths.add(path); 330 } 331 332 ::RegCloseKey(key); 333 } 334 335 Vector<String> PluginInfoStore::individualPluginPaths() 336 { 337 HashSet<String, CaseFoldingHash> paths; 338 339 addPluginPathsFromRegistry(HKEY_LOCAL_MACHINE, paths); 340 addPluginPathsFromRegistry(HKEY_CURRENT_USER, paths); 341 342 Vector<String> result; 343 copyToVector(paths, result); 344 return result; 304 345 } 305 346
Note: See TracChangeset
for help on using the changeset viewer.