Bug 19055 - Most plugin dirs should be added based on platform, not port
Summary: Most plugin dirs should be added based on platform, not port
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, Qt, Wx
Depends on:
Blocks:
 
Reported: 2008-05-14 12:39 PDT by Kevin Ollivier
Modified: 2010-03-17 11:51 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Ollivier 2008-05-14 12:39:19 PDT
While the wx port hasn't yet delved into plugins support, we recently came across an issue while working on build fixes. Basically, we need to add stubs for PluginDatabase::defualtPluginDirectories and PluginDatabase::isPreferredPluginDatabase. We can stub them for now, but looking at the code, the wx port would like to read plugins from most, if not all, of the dirs defined by other ports. However, this would require us to add PLATFORM(WX) defines to files which are already starting to get lots of defines, such as PLATFORM(GTK) || (PLATFORM(QT) && defined(Q_WS_X11)) and defined(GDK_WINDOWING_X11). I think instead of further complicating the defines, these paths should be controlled by OS defines, perhaps with a set of functions like so:

static void addMozillaPluginDirectoriesWin(Vector<String>& paths) {
#if PLATFORM(WIN_OS)
// ... add Windows Mozilla plugin dirs
#endif
}

static void addMozillaPluginDirectoriesMac(Vector<String>& paths) {
#if PLATFORM(DARWIN)
// ... add Windows Mozilla plugin dirs
#endif
}

etc. 

Then have something like: 

Vector<String> PluginDatabase::defaultPluginDirectories()
{
    addMozillaPluginDirectoriesWin(paths);
    addMozillaPluginDirectoriesMac(paths);
    addMozillaPluginDirectoriesUnix(paths);
    addPortDirectories(paths);
}

(Or maybe just use addMozillaPluginDirectories and have the implementation be based on PLATFORM define.)

Thoughts? I could hack on this, but given that wx hasn't touched plugins yet, I would be flying blind and don't feel comfortable writing a patch that affects most other ports and which I have no way of testing myself.
Comment 1 Jocelyn Turcotte 2010-03-17 11:51:48 PDT
I'm resolving this issue as fixed since I believe that this has been taken care of since then.

Here is a snippet of the current PluginDatabase::defaultPluginDirectories method:
// Add paths specific to each platform
#if defined(XP_UNIX)
...
#elif defined(XP_MACOSX)
...
#elif defined(XP_WIN)
...
#endif

// Add paths specific to each port
#if PLATFORM(QT)
...
#endif


Just re-open it if you still need it.