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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(__GNUC__) && __GNUC__ >= 4 5 #if defined(__GNUC__) && __GNUC__ >= 4
6 #define EXPORT __attribute__((visibility ("default"))) 6 #define EXPORT __attribute__((visibility ("default")))
7 #else 7 #else
8 #define EXPORT 8 #define EXPORT
9 #endif 9 #endif
10 10
11 #include "webkit/glue/plugins/test/plugin_client.h" 11 #include "webkit/glue/plugins/test/plugin_client.h"
12 12
13 extern "C" { 13 extern "C" {
14 EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* pFuncs) { 14 EXPORT NPError API_CALL NP_GetEntryPoints(NPPluginFuncs* nppFuncs) {
15 return NPAPIClient::PluginClient::GetEntryPoints(pFuncs); 15 return NPAPIClient::PluginClient::GetEntryPoints(nppFuncs);
16 }
17
18 EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* pFuncs) {
19 return NPAPIClient::PluginClient::Initialize(pFuncs);
20 } 16 }
21 17
22 EXPORT NPError API_CALL NP_Shutdown() { 18 EXPORT NPError API_CALL NP_Shutdown() {
23 return NPAPIClient::PluginClient::Shutdown(); 19 return NPAPIClient::PluginClient::Shutdown();
24 } 20 }
21
22 #if defined(OS_POSIX) && !defined(OS_MACOSX)
23 EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs,
24 NPPluginFuncs* nppFuncs) {
25 NPError error = NPAPIClient::PluginClient::Initialize(npnFuncs);
26 if (error == NPERR_NO_ERROR) {
27 error = NP_GetEntryPoints(nppFuncs);
28 }
29 return error;
30 }
31
32 EXPORT NPError API_CALL NP_GetValue(NPP instance, NPPVariable variable,
33 void* value) {
34 NPError err = NPERR_NO_ERROR;
35
36 switch (variable) {
37 case NPPVpluginNameString:
38 *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin";
39 break;
40 case NPPVpluginDescriptionString:
41 *(static_cast<const char**>(value)) = "NPAPI Pepper Test Plugin";
42 break;
43 case NPPVpluginNeedsXEmbed:
44 *(static_cast<NPBool*>(value)) = true;
45 break;
46 default:
47 err = NPERR_GENERIC_ERROR;
48 break;
49 }
50
51 return err;
52 }
53
54 EXPORT const char* API_CALL NP_GetMIMEDescription() {
55 return "pepper-application/x-pepper-test:pepper:NPAPI Pepper Test Plugin";
56 }
57 #else // OS_POSIX
58 EXPORT NPError API_CALL NP_Initialize(NPNetscapeFuncs* npnFuncs) {
59 return NPAPIClient::PluginClient::Initialize(npnFuncs);
60 }
61 #endif // OS_POSIX
62
25 } // extern "C" 63 } // extern "C"
64
OLDNEW
« 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