[Webkit-unassigned] [Bug 17825] PluginDatabase implementation for GTK+

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 14 09:30:14 PDT 2008


aroben at apple.com changed:

           What    |Removed                     |Added
  Attachment #19727|review?                     |review+
               Flag|                            |

------- Comment #2 from aroben at apple.com  2008-03-14 09:30 PDT -------
(From update of attachment 19727)
 42     for (Vector<String>::const_iterator it = m_pluginPaths.begin(); it !=
end; ++it) {
 43         GDir* dir = g_dir_open((it->utf8()).data(), 0, NULL);
 44         if (dir) {

You could reverse this and do

if (!dir)

That would remove a level of nesting.

 45             const char* name;
 46             while ((name = g_dir_read_name(dir))) {

I think you can declare name right in the assignment:

while (const char* name = g_dir_read_name(dir)) {

 47                 if (g_str_has_suffix(name, "." G_MODULE_SUFFIX)) {

You could reverse this as well:

if (!g_str_has_suffix(...))

 48                     gchar* filename = g_build_filename((it->utf8()).data(),
name, NULL);
 49                     PluginPackage* pluginPackage =
PluginPackage::createPackage(filename, time(NULL));

Our code style guidelines say we should be using 0 instead of NULL in C++
source files (even for calling C functions).

 71 #elif defined(GDK_WINDOWING_WIN32)
 72     path = g_build_filename(g_get_home_dir(), "Application Data",
"Mozilla", "plugins", NULL);
 73     paths.append(path);
 74     g_free(path);
 75 #endif

Should you be looking at the MozillaPlugins registry key as well?

 77     const gchar* mozPath = g_getenv("MOZ_PLUGIN_PATH");
 78     if (mozPath) {
 79         gchar** pluginPaths = g_strsplit(mozPath, ":", -1);

This doesn't seem quite right to do on Windows. Does Gecko really use a
colon-separated MOZ_PLUGIN_PATH environment variable on Windows?

r=me even if the above issues are not addressed, but it would be nice to fix
them since it'd be so easy!

Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list