avlee / npapi-sdk

Automatically exported from code.google.com/p/npapi-sdk
0 stars 0 forks source link

[patch] Can ndata be const void *? Is it used anywhere? #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've noticed that ndata is not used. At least on plugin side.
WebKit plugin implementation has a correspondence table between NPP_t* and 
PluginView*. So it is not used in WebKit. Not sure about Mozilla.
So I see no reason to change ndata. Could it be marked as deprecated?

If some browsers still use it, it shouldn't be changed on plugin side.
In that case I propose to define a macro NPAPI_SDK_PLUGIN_CONST if 
NPAPI_SDK_BROWSER is not set.

Similarly, browser should not modify pdata.

So the changes would be:

#ifndef NPAPI_SDK_BROWSER # define it if you're browser developer
#define NPAPI_SDK_PLUGIN_CONST const
#define NPAPI_SDK_BROWSER_CONST
#else
#define NPAPI_SDK_PLUGIN_CONST
#define NPAPI_SDK_PLUGIN_CONST const
#endif

typedef struct _NPP
{
  NPAPI_SDK_BROWSER_CONST void* pdata;      /* plug-in private data */
  NPAPI_SDK_PLUGIN_CONST void* ndata;      /* netscape private data */
} NPP_t;

Original issue reported on code.google.com by Van...@gmail.com on 24 Feb 2012 at 12:05

GoogleCodeExporter commented 9 years ago
Sorry, I was wrong. ndata is actually used in WebKit.

Original comment by Van...@gmail.com on 4 Mar 2012 at 10:00