Bug 98262 - [GTK] Build break when NETSCAPE_PLUGIN_API macro is off
Summary: [GTK] Build break when NETSCAPE_PLUGIN_API macro is off
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-03 07:03 PDT by Mariusz Grzegorczyk
Modified: 2020-08-17 06:51 PDT (History)
8 users (show)

See Also:


Attachments
Patch (7.19 KB, patch)
2015-01-06 19:12 PST, Philip Chimento
cgarcia: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mariusz Grzegorczyk 2012-10-03 07:03:07 PDT
When trying to build webkit gtk with plugin's support off build break occurs:

  CXX    Source/WebCore/plugins/libWebCore_la-PluginPackage.lo
../../Source/WebCore/plugins/npapi.cpp: In function ‘NPError NPN_GetURLNotify(NPP, const char*, const char*, void*)’:
../../Source/WebCore/plugins/npapi.cpp:74:45: error: ‘class WebCore::PluginView’ has no member named ‘getURLNotify’
../../Source/WebCore/plugins/npapi.cpp: In function ‘NPError NPN_GetURL(NPP, const char*, const char*)’:
../../Source/WebCore/plugins/npapi.cpp:79:45: error: ‘class WebCore::PluginView’ has no member named ‘getURL’


also --no-netscape-plugin-api option to build-webkit doesn't make any effect.
Comment 1 Mariusz Grzegorczyk 2012-10-05 03:28:18 PDT
Qt and ports that use cmake, don't compile npapi.cpp when NETSCAPE_PLUGIN_API is off(check in Target.pri and CMakeLists.txt). What policy should be applied to Gtk?
1. Have all files added to sources(like now) and make checks in them
2. Make check in GNUMakefile.list.am and don't take inappropriate files to build(e.g. in this case npapi.cpp)
Comment 2 Balazs Kelemen 2012-10-17 06:34:43 PDT
(In reply to comment #1)
> Qt and ports that use cmake, don't compile npapi.cpp when NETSCAPE_PLUGIN_API is off(check in Target.pri and CMakeLists.txt). What policy should be applied to Gtk?
> 1. Have all files added to sources(like now) and make checks in them
> 2. Make check in GNUMakefile.list.am and don't take inappropriate files to build(e.g. in this case npapi.cpp)

I think 1. is the more generally accepted.
Comment 3 Philip Chimento 2015-01-06 19:12:15 PST
Created attachment 244122 [details]
Patch
Comment 4 WebKit Commit Bot 2015-01-06 19:15:25 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Carlos Garcia Campos 2015-01-07 05:33:09 PST
Comment on attachment 244122 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=244122&action=review

> Source/WebKit2/PluginProcess/unix/PluginControllerProxyUnix.cpp:30
>  #if ENABLE(PLUGIN_PROCESS)
> +#if ENABLE(NETSCAPE_PLUGIN_API)

I don't think this is correct, why using NETSCAPE_PLUGIN_API here? ENABLE_PLUGIN_PROCESS is what it should be false, I guess.

> Source/WebKit2/PluginProcess/unix/PluginProcessMainUnix.cpp:32
>  #if ENABLE(PLUGIN_PROCESS)
> +#if ENABLE(NETSCAPE_PLUGIN_API)

Ditto.

> Source/WebKit2/PluginProcess/unix/PluginProcessUnix.cpp:30
>  #if ENABLE(PLUGIN_PROCESS)
> +#if ENABLE(NETSCAPE_PLUGIN_API)

Ditto.

> Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:690
> +#if ENABLE(NETSCAPE_PLUGIN_API)
>      Vector<PluginModuleInfo> plugins = WEBKIT_WEB_CONTEXT(object)->priv->context->pluginInfoStore().plugins();
>      GList* returnValue = 0;
>      for (size_t i = 0; i < plugins.size(); ++i)
>          returnValue = g_list_prepend(returnValue, webkitPluginCreate(plugins[i]));
>      g_task_return_pointer(task, returnValue, reinterpret_cast<GDestroyNotify>(destroyPluginList));
> +#else
> +    g_task_return_pointer(task, NULL, NULL);
> +#endif

Why doing this in the thread body? If NETSCAPE_PLUGIN_API is not enabled we should call g_task_return_pointer before spawning the thread.

> Source/WebKit2/UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:68
> +#if ENABLE(NETSCAPE_PLUGIN_API)

I guess this should be #if ENABLE(PLUGIN_PROCESS)

> Source/WebKit2/UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:32
>  #if ENABLE(PLUGIN_PROCESS)
> +#if ENABLE(NETSCAPE_PLUGIN_API)

Same here about duplicated if

> Source/WebKit2/WebProcess/Plugins/Netscape/unix/PluginProxyUnix.cpp:30
>  #if ENABLE(PLUGIN_PROCESS)
> +#if ENABLE(NETSCAPE_PLUGIN_API)

Ditto.
Comment 6 Philip Chimento 2015-01-08 00:05:10 PST
So what you're saying is that we should never compile with -DENABLE_NETSCAPE_PLUGIN_API=OFF and instead use -DENABLE_PLUGIN_PROCESS=OFF?

Or, in other words, having PLUGIN_PROCESS enabled without the NETSCAPE_PLUGIN_API doesn't make sense? In that case, can I just remove the extra cmake configuration parameter for the Netscape API?
Comment 7 Carlos Garcia Campos 2015-01-08 00:50:51 PST
(In reply to comment #6)
> So what you're saying is that we should never compile with
> -DENABLE_NETSCAPE_PLUGIN_API=OFF and instead use -DENABLE_PLUGIN_PROCESS=OFF?
> 
> Or, in other words, having PLUGIN_PROCESS enabled without the
> NETSCAPE_PLUGIN_API doesn't make sense? 

It doesn't make sense for us, because the only plugins supported by the GTK port are the NPAPI plugins.

> In that case, can I just remove the
> extra cmake configuration parameter for the Netscape API?

Yes, we could probably remove the cmake option, or ensure that it's OFF when the plugin process option is OFF
Comment 8 Carlos Garcia Campos 2020-08-17 06:51:25 PDT
Plugins are no longer supported.