summaryrefslogtreecommitdiffstats
path: root/webkit/tools/pepper_test_plugin/main.cc
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 22:14:53 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-06 22:14:53 +0000
commitf1002ee286ad56e2b80736661e89989b650aad6e (patch)
treee7f82831f9bccd51fa10ba0c6b28501a5ad83aaa /webkit/tools/pepper_test_plugin/main.cc
parent3ccfe535658c8852c1cc1df01372ecc602f376cd (diff)
downloadchromium_src-f1002ee286ad56e2b80736661e89989b650aad6e.zip
chromium_src-f1002ee286ad56e2b80736661e89989b650aad6e.tar.gz
chromium_src-f1002ee286ad56e2b80736661e89989b650aad6e.tar.bz2
Revert 35649 - Make Pepper plugins work on Linux.
fix pepper_test_plugin so that it is loaded on Linux remove skia & base dependency in test plugin so that it can be compiled with fPIC remove ifdef WIN in pepper code Patch by neb@chromium.org Original review: http://codereview.chromium.org/501124/show BUG=none TEST=none TBR=brettw@chromium.org Review URL: http://codereview.chromium.org/524051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/tools/pepper_test_plugin/main.cc')
-rw-r--r--webkit/tools/pepper_test_plugin/main.cc50
1 files changed, 23 insertions, 27 deletions
diff --git a/webkit/tools/pepper_test_plugin/main.cc b/webkit/tools/pepper_test_plugin/main.cc
index 8e46ecd..ef9a64b 100644
--- a/webkit/tools/pepper_test_plugin/main.cc
+++ b/webkit/tools/pepper_test_plugin/main.cc
@@ -34,21 +34,15 @@
#include <stdlib.h>
#include <stdio.h>
-#if defined(INDEPENDENT_PLUGIN)
-#include <iostream>
-#define LOG(x) std::cerr
-#else
#include "base/logging.h"
#include "base/string_util.h"
-#endif
-#include "webkit/glue/plugins/nphostapi.h"
#include "webkit/tools/pepper_test_plugin/plugin_object.h"
#include "webkit/tools/pepper_test_plugin/event_handler.h"
-#if __GNUC__ >= 4
-#define EXPORT __attribute__ ((visibility("default")))
-#elif defined(_MSC_VER)
-#define EXPORT __declspec(dllexport)
+#ifdef WIN32
+#define NPAPI WINAPI
+#else
+#define NPAPI
#endif
namespace {
@@ -57,14 +51,7 @@ void Log(NPP instance, const char* format, ...) {
va_list args;
va_start(args, format);
std::string message("PLUGIN: ");
-#if defined(INDEPENDENT_PLUGIN)
- {
- char msgbuf[100];
- vsnprintf(msgbuf, 100, format, args);
- }
-#else
StringAppendV(&message, format, args);
-#endif
va_end(args);
NPObject* window_object = 0;
@@ -112,25 +99,34 @@ void Log(NPP instance, const char* format, ...) {
// Plugin entry points
extern "C" {
-EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
+#if defined(OS_WIN)
+//__declspec(dllexport)
+#endif
+NPError NPAPI NP_Initialize(NPNetscapeFuncs* browser_funcs
#if defined(OS_LINUX)
, NPPluginFuncs* plugin_funcs
#endif
);
-EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* plugin_funcs);
+#if defined(OS_WIN)
+//__declspec(dllexport)
+#endif
+NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs);
-EXPORT void API_CALL NP_Shutdown() {
+#if defined(OS_WIN)
+//__declspec(dllexport)
+#endif
+void NPAPI NP_Shutdown() {
}
#if defined(OS_LINUX)
-EXPORT NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable, void* value);
-EXPORT const char* API_CALL NP_GetMIMEDescription();
+NPError NP_GetValue(NPP instance, NPPVariable variable, void* value);
+const char* NP_GetMIMEDescription();
#endif
} // extern "C"
// Plugin entry points
-EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
+NPError NPAPI NP_Initialize(NPNetscapeFuncs* browser_funcs
#if defined(OS_LINUX)
, NPPluginFuncs* plugin_funcs
#endif
@@ -145,7 +141,7 @@ EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* browser_funcs
// Entrypoints -----------------------------------------------------------------
-NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* plugin_funcs) {
+NPError NPAPI NP_GetEntryPoints(NPPluginFuncs* plugin_funcs) {
plugin_funcs->version = 11;
plugin_funcs->size = sizeof(plugin_funcs);
plugin_funcs->newp = NPP_New;
@@ -275,11 +271,11 @@ NPError NPP_SetValue(NPP instance, NPNVariable variable, void* value) {
}
#if defined(OS_LINUX)
-NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable, void* value) {
+NPError NP_GetValue(NPP instance, NPPVariable variable, void* value) {
return NPP_GetValue(instance, variable, value);
}
-const char* API_CALL NP_GetMIMEDescription() {
- return "pepper-application/x-pepper-test-plugin::Pepper Test";
+const char* NP_GetMIMEDescription() {
+ return "pepper-application/x-pepper-test-plugin pepper test;";
}
#endif