RESOLVED FIXED 43510
WebKit2 should load plugins from the same directories as old-WebKit
https://bugs.webkit.org/show_bug.cgi?id=43510
Summary WebKit2 should load plugins from the same directories as old-WebKit
Adam Roben (:aroben)
Reported 2010-08-04 14:19:54 PDT
Old WebKit (WebCore, really) has logic to load plugins from certain directories. WebKit2 should load plugins from those same directories.
Attachments
Implement PluginInfoStore::pluginsDirectories (10.03 KB, patch)
2010-08-19 09:27 PDT, Adam Roben (:aroben)
jhoneycutt: review+
Adam Roben (:aroben)
Comment 1 2010-08-04 15:03:12 PDT
Adam Roben (:aroben)
Comment 2 2010-08-19 09:27:57 PDT
Created attachment 64863 [details] Implement PluginInfoStore::pluginsDirectories
WebKit Review Bot
Comment 3 2010-08-19 09:31:21 PDT
Attachment 64863 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1 WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp:66: An else if statement should be written as an if statement when the prior "if" concludes with a return, break, continue or goto statement. [readability/control_flow] [4] WebKit2/UIProcess/Plugins/win/PluginInfoStoreWin.cpp:224: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 2 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jon Honeycutt
Comment 4 2010-08-19 13:46:44 PDT
Comment on attachment 64863 [details] Implement PluginInfoStore::pluginsDirectories r=me
Ada Chan
Comment 5 2010-08-19 13:47:53 PDT
> +static inline void addMozillaPluginDirectories(Vector<String>& directories) > +{ > + // Enumerate all Mozilla plugin directories in the registry > + HKEY key; > + LONG result = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Mozilla", 0, KEY_READ, &key); > + if (result == ERROR_SUCCESS) { Maybe we can return early if result != ERROR_SUCCESS? > + WCHAR name[128]; > + FILETIME lastModified; > + > + // Enumerate subkeys > + for (int i = 0;; i++) { > + DWORD nameLen = sizeof(name) / sizeof(WCHAR); I saw you used _countof in an earlier method. Can it be used above also? > +static inline void addAdobeAcrobatPluginDirectory(Vector<String>& directories) > +{ > + HKEY key; > + HRESULT result = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"Software\\Adobe\\Acrobat Reader", 0, KEY_READ, &key); > + if (result != ERROR_SUCCESS) > + return; > + > + WCHAR name[128]; > + FILETIME lastModified; > + > + Vector<int> latestAcrobatVersion; > + String latestAcrobatVersionString; > + > + // Enumerate subkeys > + for (int i = 0;; i++) { > + DWORD nameLen = sizeof(name) / sizeof(WCHAR); Ditto > +static inline void addMacromediaPluginDirectories(Vector<String>& directories) > +{ > +#if !OS(WINCE) > + WCHAR systemDirectoryStr[MAX_PATH]; > + > + if (::GetSystemDirectoryW(systemDirectoryStr, _countof(systemDirectoryStr)) == 0) > + return; Should we use ! instead of == 0? > + > + WCHAR macromediaDirectoryStr[MAX_PATH]; > + > + ::PathCombineW(macromediaDirectoryStr, systemDirectoryStr, L"macromed\\Flash"); Should we check the return value of PathCombine? > + directories.append(macromediaDirectoryStr); > + > + ::PathCombineW(macromediaDirectoryStr, systemDirectoryStr, L"macromed\\Shockwave 10"); Ditto. > + directories.append(macromediaDirectoryStr); > +#endif > +} r=me too!
Adam Roben (:aroben)
Comment 6 2010-08-19 14:06:51 PDT
(In reply to comment #5) I implemented all of your suggestions. Thanks!
Adam Roben (:aroben)
Comment 7 2010-08-19 14:27:17 PDT
Note You need to log in before you can comment on or make changes to this bug.