Summary: | WebKit2 should load plugins from the same directories as old-WebKit | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Roben (:aroben) <aroben> | ||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | adachan, andersca, jhoneycutt, webkit.review.bot | ||||
Priority: | P2 | Keywords: | InRadar, PlatformOnly | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 43189 | ||||||
Attachments: |
|
Description
Adam Roben (:aroben)
2010-08-04 14:19:54 PDT
Created attachment 64863 [details]
Implement PluginInfoStore::pluginsDirectories
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.
Comment on attachment 64863 [details]
Implement PluginInfoStore::pluginsDirectories
r=me
> +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! (In reply to comment #5) I implemented all of your suggestions. Thanks! Committed r65704: <http://trac.webkit.org/changeset/65704> |