Bug 43510 - WebKit2 should load plugins from the same directories as old-WebKit
Summary: WebKit2 should load plugins from the same directories as old-WebKit
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks: 43189
  Show dependency treegraph
 
Reported: 2010-08-04 14:19 PDT by Adam Roben (:aroben)
Modified: 2010-08-19 14:27 PDT (History)
4 users (show)

See Also:


Attachments
Implement PluginInfoStore::pluginsDirectories (10.03 KB, patch)
2010-08-19 09:27 PDT, Adam Roben (:aroben)
jhoneycutt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 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.
Comment 1 Adam Roben (:aroben) 2010-08-04 15:03:12 PDT
<rdar://problem/8273827>
Comment 2 Adam Roben (:aroben) 2010-08-19 09:27:57 PDT
Created attachment 64863 [details]
Implement PluginInfoStore::pluginsDirectories
Comment 3 WebKit Review Bot 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.
Comment 4 Jon Honeycutt 2010-08-19 13:46:44 PDT
Comment on attachment 64863 [details]
Implement PluginInfoStore::pluginsDirectories

r=me
Comment 5 Ada Chan 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!
Comment 6 Adam Roben (:aroben) 2010-08-19 14:06:51 PDT
(In reply to comment #5)
I implemented all of your suggestions. Thanks!
Comment 7 Adam Roben (:aroben) 2010-08-19 14:27:17 PDT
Committed r65704: <http://trac.webkit.org/changeset/65704>