[Webkit-unassigned] [Bug 91844] [EFL][WK2] Plugin process implementation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 13 01:25:16 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=91844





--- Comment #26 from Mariusz Grzegorczyk <mariusz.g at samsung.com>  2012-09-13 01:25:40 PST ---
(In reply to comment #25)
> (From update of attachment 163648 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=163648&action=review
> 
> > Source/WebKit2/PluginProcess/efl/PluginProcessMainEfl.cpp:66
> > +int PluginProcessMainEfl(int argc, char* argv[])
> 
> This file as well is a 99% copy of PluginProcessMainGtk.cpp, with just the gtk_init() replaced with eine_init() and ecore_x_init(). Wouldn't it be better to share one file and have an #ifdef for the toolkit init in there instead of duplicating the entire file? Then you can also get rid of PluginMainEfl.cpp.
> 
> > Source/WebKit2/UIProcess/Plugins/efl/PluginProcessProxyEfl.cpp:86
> > +    CString binaryPath = fileSystemRepresentation(executablePathOfPluginProcess());
> > +    CString pluginPathCString = fileSystemRepresentation(pluginPath);
> > +    char* argv[4];
> > +    argv[0] = const_cast<char*>(binaryPath.data());
> > +    argv[1] = const_cast<char*>("-scanPlugin");
> > +    argv[2] = const_cast<char*>(pluginPathCString.data());
> > +    argv[3] = 0;
> > +
> > +    int status;
> > +    char* stdOut;
> > +
> > +    if (!g_spawn_sync(0, argv, 0, G_SPAWN_STDERR_TO_DEV_NULL, 0, 0, &stdOut, 0, &status, 0))
> > +        return false;
> > +
> > +    if (!WIFEXITED(status) || WEXITSTATUS(status) != EXIT_SUCCESS)
> > +        return false;
> > +
> > +    const unsigned kNumLinesExpected = 3;
> > +    String lines[kNumLinesExpected];
> > +    unsigned lineIndex = 0;
> > +    const UChar* current = reinterpret_cast<const UChar*>(stdOut);
> > +    while (lineIndex < kNumLinesExpected) {
> > +        const UChar* start = current;
> > +        while (*current++ != UChar('\n')) { }
> > +        lines[lineIndex++] = String(start, current - start - 1);
> > +    }
> > +
> > +    if (stdOut)
> > +        free(stdOut);
> > +
> > +    result.name.swap(lines[0]);
> > +    result.description.swap(lines[1]);
> > +    result.mimeDescription.swap(lines[2]);
> > +
> > +    return !result.mimeDescription.isEmpty();
> 
> This function along with the rest of the file is a 99% copy of PluginProcessProxyGtk.cpp, which btw is (C) Igalia. Is there any way that you can modify your build system to simply compile their version if you have GLIB_SUPPORT enabled and omit this file altogether when it just duplicates the code?

I thought about removing glib in the future, replacing it by some ecore functions, but sharing code is also reasonable. I'm wondering about name of common directory: sometimes it is unix, and sometimes x11. Both of them seems not exactly proper because efl have/will have windows, wayland support.

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


More information about the webkit-unassigned mailing list