Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(794)

Unified Diff: webkit/tools/npapi_pepper_test_plugin/main.cc

Issue 2819071: Changes to get npapi_pepper_test_plugin recognized on linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/tools/npapi_pepper_test_plugin/main.cc
===================================================================
--- webkit/tools/npapi_pepper_test_plugin/main.cc (revision 53977)
+++ webkit/tools/npapi_pepper_test_plugin/main.cc (working copy)
@@ -11,15 +11,54 @@
#include "webkit/glue/plugins/test/plugin_client.h"
extern "C" {
-EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* pFuncs) {
- return NPAPIClient::PluginClient::GetEntryPoints(pFuncs);
+EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* nppFuncs) {
+ return NPAPIClient::PluginClient::GetEntryPoints(nppFuncs);
}
-EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* pFuncs) {
- return NPAPIClient::PluginClient::Initialize(pFuncs);
-}
-
EXPORT NPError API_CALL NP_Shutdown() {
return NPAPIClient::PluginClient::Shutdown();
}
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+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 Pepper Test Plugin";
+ break;
+ case NPPVpluginDescriptionString:
+ *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin";
+ break;
+ case NPPVpluginNeedsXEmbed:
+ *(static_cast<NPBool*>(value)) = true;
+ break;
+ default:
+ err = NPERR_GENERIC_ERROR;
+ break;
+ }
+
+ return err;
+}
+
+EXPORT const char* API_CALL NP_GetMIMEDescription() {
+ return "pepper-application/x-pepper-test:pepper:NPAPI Pepper Test Plugin";
+}
+#else // OS_POSIX
+EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs) {
+ return NPAPIClient::PluginClient::Initialize(npnFuncs);
+}
+#endif // OS_POSIX
+
} // extern "C"
+
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698