This source file includes following definitions.
- DllMain
- NP_GetEntryPoints
- NP_Shutdown
- NP_Initialize
- NP_Initialize
- NP_GetValue
- NP_GetMIMEDescription
- currentTextBreakLocaleID
#include "base/basictypes.h"
#if defined(OS_WIN)
#include <windows.h>
#endif
#if defined(__GNUC__) && __GNUC__ >= 4
#define EXPORT __attribute__((visibility ("default")))
#else
#define EXPORT
#endif
#include "content/test/plugin/plugin_client.h"
#if defined(OS_WIN)
BOOL API_CALL DllMain(HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) {
return TRUE;
}
#endif
extern "C" {
EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* pFuncs) {
return NPAPIClient::PluginClient::GetEntryPoints(pFuncs);
}
EXPORT NPError API_CALL NP_Shutdown() {
return NPAPIClient::PluginClient::Shutdown();
}
#if defined(OS_WIN) || defined(OS_MACOSX)
EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs) {
return NPAPIClient::PluginClient::Initialize(npnFuncs);
}
#elif defined(OS_POSIX)
EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs,
NPPluginFuncs* nppFuncs) {
NPError error = NPAPIClient::PluginClient::Initialize(npnFuncs);
if (error == NPERR_NO_ERROR) {
error = NP_GetEntryPoints(nppFuncs);
}
return error;
}
EXPORT NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable,
void* value) {
NPError err = NPERR_NO_ERROR;
switch (variable) {
case NPPVpluginNameString:
*(static_cast<const char**>(value)) = "NPAPI Test Plugin";
break;
case NPPVpluginDescriptionString:
*(static_cast<const char**>(value)) =
"Simple NPAPI plug-in for Chromium unit tests";
break;
case NPPVpluginNeedsXEmbed:
*(static_cast<NPBool*>(value)) = true;
break;
default:
err = NPERR_GENERIC_ERROR;
break;
}
return err;
}
EXPORT const char* API_CALL NP_GetMIMEDescription(void) {
return "application/vnd.npapi-test:npapitest:test npapi";
}
#endif
}
namespace WebCore {
const char* currentTextBreakLocaleID() { return "en_us"; }
}