Commit 0bee29b4 authored by andersca@apple.com's avatar andersca@apple.com

Make all NPN_ functions static.

Reviewed by Adam Roben.

* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 79ee1296
......@@ -33,6 +33,14 @@
* win/WebKit2.rc:
* win/resource.h: Copied from WebKit/win/WebKit.vcproj/resource.h.
2010-07-13 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
Make all NPN_ functions static.
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
2010-07-13 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
......
......@@ -29,128 +29,49 @@
#include "NotImplemented.h"
namespace WebKit {
static void initializeBrowserFuncs(NPNetscapeFuncs &netscapeFuncs)
{
netscapeFuncs.size = sizeof(NPNetscapeFuncs);
netscapeFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
netscapeFuncs.geturl = NPN_GetURL;
netscapeFuncs.posturl = NPN_PostURL;
netscapeFuncs.requestread = NPN_RequestRead;
netscapeFuncs.newstream = NPN_NewStream;
netscapeFuncs.write = NPN_Write;
netscapeFuncs.destroystream = NPN_DestroyStream;
netscapeFuncs.status = NPN_Status;
netscapeFuncs.uagent = NPN_UserAgent;
netscapeFuncs.memalloc = NPN_MemAlloc;
netscapeFuncs.memfree = NPN_MemFree;
netscapeFuncs.memflush = NPN_MemFlush;
netscapeFuncs.reloadplugins = NPN_ReloadPlugins;
netscapeFuncs.getJavaEnv = NPN_GetJavaEnv;
netscapeFuncs.getJavaPeer = NPN_GetJavaPeer;
netscapeFuncs.geturlnotify = NPN_GetURLNotify;
netscapeFuncs.posturlnotify = NPN_PostURLNotify;
netscapeFuncs.getvalue = NPN_GetValue;
netscapeFuncs.setvalue = NPN_SetValue;
netscapeFuncs.invalidaterect = NPN_InvalidateRect;
netscapeFuncs.invalidateregion = NPN_InvalidateRegion;
netscapeFuncs.forceredraw = NPN_ForceRedraw;
netscapeFuncs.getstringidentifier = NPN_GetStringIdentifier;
netscapeFuncs.getstringidentifiers = NPN_GetStringIdentifiers;
netscapeFuncs.getintidentifier = NPN_GetIntIdentifier;
netscapeFuncs.identifierisstring = NPN_IdentifierIsString;
netscapeFuncs.utf8fromidentifier = NPN_UTF8FromIdentifier;
netscapeFuncs.intfromidentifier = NPN_IntFromIdentifier;
netscapeFuncs.createobject = NPN_CreateObject;
netscapeFuncs.retainobject = NPN_RetainObject;
netscapeFuncs.releaseobject = NPN_ReleaseObject;
netscapeFuncs.invoke = NPN_Invoke;
netscapeFuncs.invokeDefault = NPN_InvokeDefault;
netscapeFuncs.evaluate = NPN_Evaluate;
netscapeFuncs.getproperty = NPN_GetProperty;
netscapeFuncs.setproperty = NPN_SetProperty;
netscapeFuncs.removeproperty = NPN_RemoveProperty;
netscapeFuncs.hasproperty = NPN_HasProperty;
netscapeFuncs.hasmethod = NPN_HasMethod;
netscapeFuncs.releasevariantvalue = NPN_ReleaseVariantValue;
netscapeFuncs.setexception = NPN_SetException;
netscapeFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
netscapeFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
netscapeFuncs.enumerate = NPN_Enumerate;
netscapeFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
netscapeFuncs.construct = NPN_Construct;
netscapeFuncs.getvalueforurl = NPN_GetValueForURL;
netscapeFuncs.setvalueforurl = NPN_SetValueForURL;
netscapeFuncs.getauthenticationinfo = NPN_GetAuthenticationInfo;
netscapeFuncs.scheduletimer = NPN_ScheduleTimer;
netscapeFuncs.unscheduletimer = NPN_UnscheduleTimer;
netscapeFuncs.popupcontextmenu = NPN_PopUpContextMenu;
netscapeFuncs.convertpoint = NPN_ConvertPoint;
}
NPNetscapeFuncs* netscapeBrowserFuncs()
{
static NPNetscapeFuncs netscapeFuncs;
static bool initialized = false;
if (!initialized) {
initializeBrowserFuncs(netscapeFuncs);
initialized = true;
}
return &netscapeFuncs;
}
} // namespace WebKit
using namespace WebKit;
extern "C" {
NPError NPN_GetURL(NPP instance, const char* url, const char* target)
static NPError NPN_GetURL(NPP instance, const char* url, const char* target)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
static NPError NPN_PostURL(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
static NPError NPN_RequestRead(NPStream* stream, NPByteRange* rangeList)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
static NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
static int32_t NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
{
notImplemented();
return -1;
}
NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
static NPError NPN_DestroyStream(NPP instance, NPStream* stream, NPReason reason)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
void NPN_Status(NPP instance, const char* message)
static void NPN_Status(NPP instance, const char* message)
{
notImplemented();
}
const char* NPN_UserAgent(NPP npp)
static const char* NPN_UserAgent(NPP npp)
{
if (!npp)
return 0;
......@@ -159,55 +80,55 @@ const char* NPN_UserAgent(NPP npp)
return plugin->userAgent();
}
void* NPN_MemAlloc(uint32_t size)
static void* NPN_MemAlloc(uint32_t size)
{
// We could use fastMalloc here, but there might be plug-ins that mix NPN_MemAlloc/NPN_MemFree with malloc and free,
// so having them be equivalent seems like a good idea.
return malloc(size);
}
void NPN_MemFree(void* ptr)
static void NPN_MemFree(void* ptr)
{
// We could use fastFree here, but there might be plug-ins that mix NPN_MemAlloc/NPN_MemFree with malloc and free,
// so having them be equivalent seems like a good idea.
free(ptr);
}
uint32_t NPN_MemFlush(uint32_t size)
static uint32_t NPN_MemFlush(uint32_t size)
{
return 0;
}
void NPN_ReloadPlugins(NPBool reloadPages)
static void NPN_ReloadPlugins(NPBool reloadPages)
{
notImplemented();
}
JRIEnv* NPN_GetJavaEnv(void)
static JRIEnv* NPN_GetJavaEnv(void)
{
notImplemented();
return 0;
}
jref NPN_GetJavaPeer(NPP instance)
static jref NPN_GetJavaPeer(NPP instance)
{
notImplemented();
return 0;
}
NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData)
static NPError NPN_GetURLNotify(NPP instance, const char* url, const char* target, void* notifyData)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
static NPError NPN_PostURLNotify(NPP instance, const char* url, const char* target, uint32_t len, const char* buf, NPBool file, void* notifyData)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
static NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
{
switch (variable) {
#if PLATFORM(MAC)
......@@ -229,7 +150,7 @@ NPError NPN_GetValue(NPP instance, NPNVariable variable, void *value)
return NPERR_NO_ERROR;
}
NPError NPN_SetValue(NPP npp, NPPVariable variable, void *value)
static NPError NPN_SetValue(NPP npp, NPPVariable variable, void *value)
{
switch (variable) {
#if PLATFORM(MAC)
......@@ -256,201 +177,274 @@ NPError NPN_SetValue(NPP npp, NPPVariable variable, void *value)
return NPERR_NO_ERROR;
}
void NPN_InvalidateRect(NPP npp, NPRect* invalidRect)
static void NPN_InvalidateRect(NPP npp, NPRect* invalidRect)
{
RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
plugin->invalidate(invalidRect);
}
void NPN_InvalidateRegion(NPP npp, NPRegion invalidRegion)
static void NPN_InvalidateRegion(NPP npp, NPRegion invalidRegion)
{
// FIXME: We could at least figure out the bounding rectangle of the invalid region.
RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp);
plugin->invalidate(0);
}
void NPN_ForceRedraw(NPP instance)
static void NPN_ForceRedraw(NPP instance)
{
notImplemented();
}
NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
static NPIdentifier NPN_GetStringIdentifier(const NPUTF8 *name)
{
notImplemented();
return 0;
}
void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers)
static void NPN_GetStringIdentifiers(const NPUTF8 **names, int32_t nameCount, NPIdentifier *identifiers)
{
notImplemented();
}
NPIdentifier NPN_GetIntIdentifier(int32_t intid)
static NPIdentifier NPN_GetIntIdentifier(int32_t intid)
{
notImplemented();
return 0;
}
bool NPN_IdentifierIsString(NPIdentifier identifier)
static bool NPN_IdentifierIsString(NPIdentifier identifier)
{
notImplemented();
return false;
}
NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
static NPUTF8 *NPN_UTF8FromIdentifier(NPIdentifier identifier)
{
notImplemented();
return 0;
}
int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
static int32_t NPN_IntFromIdentifier(NPIdentifier identifier)
{
notImplemented();
return 0;
}
NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
static NPObject *NPN_CreateObject(NPP npp, NPClass *aClass)
{
notImplemented();
return 0;
}
NPObject *NPN_RetainObject(NPObject *npobj)
static NPObject *NPN_RetainObject(NPObject *npobj)
{
notImplemented();
return 0;
}
void NPN_ReleaseObject(NPObject *npobj)
static void NPN_ReleaseObject(NPObject *npobj)
{
notImplemented();
}
bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result)
static bool NPN_Invoke(NPP npp, NPObject *npobj, NPIdentifier methodName, const NPVariant *args, uint32_t argCount, NPVariant *result)
{
notImplemented();
return false;
}
bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
static bool NPN_InvokeDefault(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
{
notImplemented();
return false;
}
bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result)
static bool NPN_Evaluate(NPP npp, NPObject *npobj, NPString *script, NPVariant *result)
{
notImplemented();
return false;
}
bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, NPVariant *result)
static bool NPN_GetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, NPVariant *result)
{
notImplemented();
return false;
}
bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value)
static bool NPN_SetProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName, const NPVariant *value)
{
notImplemented();
return false;
}
bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName)
static bool NPN_RemoveProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName)
{
notImplemented();
return false;
}
bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName)
static bool NPN_HasProperty(NPP npp, NPObject *npobj, NPIdentifier propertyName)
{
notImplemented();
return false;
}
bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName)
static bool NPN_HasMethod(NPP npp, NPObject *npobj, NPIdentifier methodName)
{
notImplemented();
return false;
}
void NPN_ReleaseVariantValue(NPVariant *variant)
static void NPN_ReleaseVariantValue(NPVariant *variant)
{
notImplemented();
}
void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
static void NPN_SetException(NPObject *npobj, const NPUTF8 *message)
{
notImplemented();
}
void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
static void NPN_PushPopupsEnabledState(NPP instance, NPBool enabled)
{
notImplemented();
}
void NPN_PopPopupsEnabledState(NPP instance)
static void NPN_PopPopupsEnabledState(NPP instance)
{
notImplemented();
}
bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count)
static bool NPN_Enumerate(NPP npp, NPObject *npobj, NPIdentifier **identifier, uint32_t *count)
{
notImplemented();
return false;
}
void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)
static void NPN_PluginThreadAsyncCall(NPP instance, void (*func) (void *), void *userData)
{
notImplemented();
}
bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
static bool NPN_Construct(NPP npp, NPObject *npobj, const NPVariant *args, uint32_t argCount, NPVariant *result)
{
notImplemented();
return false;
}
NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char *url, char **value, uint32_t *len)
static NPError NPN_GetValueForURL(NPP instance, NPNURLVariable variable, const char *url, char **value, uint32_t *len)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char *url, const char *value, uint32_t len)
static NPError NPN_SetValueForURL(NPP instance, NPNURLVariable variable, const char *url, const char *value, uint32_t len)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPError NPN_GetAuthenticationInfo(NPP instance, const char *protocol, const char *host, int32_t port, const char *scheme,
const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen)
static NPError NPN_GetAuthenticationInfo(NPP instance, const char *protocol, const char *host, int32_t port, const char *scheme,
const char *realm, char **username, uint32_t *ulen, char **password, uint32_t *plen)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
uint32_t NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID))
static uint32_t NPN_ScheduleTimer(NPP instance, uint32_t interval, NPBool repeat, void (*timerFunc)(NPP npp, uint32_t timerID))
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
void NPN_UnscheduleTimer(NPP instance, uint32_t timerID)
static void NPN_UnscheduleTimer(NPP instance, uint32_t timerID)
{
notImplemented();
}
NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu)
static NPError NPN_PopUpContextMenu(NPP instance, NPMenu* menu)
{
notImplemented();
return NPERR_GENERIC_ERROR;
}
NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace)
static NPBool NPN_ConvertPoint(NPP instance, double sourceX, double sourceY, NPCoordinateSpace sourceSpace, double *destX, double *destY, NPCoordinateSpace destSpace)
{
notImplemented();
return false;
}
} // extern "C"
static void initializeBrowserFuncs(NPNetscapeFuncs &netscapeFuncs)
{
netscapeFuncs.size = sizeof(NPNetscapeFuncs);
netscapeFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR;
netscapeFuncs.geturl = NPN_GetURL;
netscapeFuncs.posturl = NPN_PostURL;
netscapeFuncs.requestread = NPN_RequestRead;
netscapeFuncs.newstream = NPN_NewStream;
netscapeFuncs.write = NPN_Write;
netscapeFuncs.destroystream = NPN_DestroyStream;
netscapeFuncs.status = NPN_Status;
netscapeFuncs.uagent = NPN_UserAgent;
netscapeFuncs.memalloc = NPN_MemAlloc;
netscapeFuncs.memfree = NPN_MemFree;
netscapeFuncs.memflush = NPN_MemFlush;
netscapeFuncs.reloadplugins = NPN_ReloadPlugins;
netscapeFuncs.getJavaEnv = NPN_GetJavaEnv;
netscapeFuncs.getJavaPeer = NPN_GetJavaPeer;
netscapeFuncs.geturlnotify = NPN_GetURLNotify;
netscapeFuncs.posturlnotify = NPN_PostURLNotify;
netscapeFuncs.getvalue = NPN_GetValue;
netscapeFuncs.setvalue = NPN_SetValue;
netscapeFuncs.invalidaterect = NPN_InvalidateRect;
netscapeFuncs.invalidateregion = NPN_InvalidateRegion;
netscapeFuncs.forceredraw = NPN_ForceRedraw;
netscapeFuncs.getstringidentifier = NPN_GetStringIdentifier;
netscapeFuncs.getstringidentifiers = NPN_GetStringIdentifiers;
netscapeFuncs.getintidentifier = NPN_GetIntIdentifier;
netscapeFuncs.identifierisstring = NPN_IdentifierIsString;
netscapeFuncs.utf8fromidentifier = NPN_UTF8FromIdentifier;
netscapeFuncs.intfromidentifier = NPN_IntFromIdentifier;
netscapeFuncs.createobject = NPN_CreateObject;
netscapeFuncs.retainobject = NPN_RetainObject;
netscapeFuncs.releaseobject = NPN_ReleaseObject;
netscapeFuncs.invoke = NPN_Invoke;
netscapeFuncs.invokeDefault = NPN_InvokeDefault;
netscapeFuncs.evaluate = NPN_Evaluate;
netscapeFuncs.getproperty = NPN_GetProperty;
netscapeFuncs.setproperty = NPN_SetProperty;
netscapeFuncs.removeproperty = NPN_RemoveProperty;
netscapeFuncs.hasproperty = NPN_HasProperty;
netscapeFuncs.hasmethod = NPN_HasMethod;
netscapeFuncs.releasevariantvalue = NPN_ReleaseVariantValue;
netscapeFuncs.setexception = NPN_SetException;
netscapeFuncs.pushpopupsenabledstate = NPN_PushPopupsEnabledState;
netscapeFuncs.poppopupsenabledstate = NPN_PopPopupsEnabledState;
netscapeFuncs.enumerate = NPN_Enumerate;
netscapeFuncs.pluginthreadasynccall = NPN_PluginThreadAsyncCall;
netscapeFuncs.construct = NPN_Construct;
netscapeFuncs.getvalueforurl = NPN_GetValueForURL;
netscapeFuncs.setvalueforurl = NPN_SetValueForURL;
netscapeFuncs.getauthenticationinfo = NPN_GetAuthenticationInfo;
netscapeFuncs.scheduletimer = NPN_ScheduleTimer;
netscapeFuncs.unscheduletimer = NPN_UnscheduleTimer;
netscapeFuncs.popupcontextmenu = NPN_PopUpContextMenu;
netscapeFuncs.convertpoint = NPN_ConvertPoint;
}
NPNetscapeFuncs* netscapeBrowserFuncs()
{
static NPNetscapeFuncs netscapeFuncs;
static bool initialized = false;
if (!initialized) {
initializeBrowserFuncs(netscapeFuncs);
initialized = true;
}
return &netscapeFuncs;
}
} // namespace WebKit
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment