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

Side by Side Diff: webkit/tools/pepper_test_plugin/main.cpp

Issue 269087: Add a skeleton "Pepper" NPAPI plugin. This is basically a copy of the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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
OLDNEW
1 /* 1 /*
2 IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Ap ple") in 2 IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Ap ple") in
3 consideration of your agreement to the following terms, and your use, installat ion, 3 consideration of your agreement to the following terms, and your use, installat ion,
4 modification or redistribution of this Apple software constitutes acceptance of these 4 modification or redistribution of this Apple software constitutes acceptance of these
5 terms. If you do not agree with these terms, please do not use, install, modif y or 5 terms. If you do not agree with these terms, please do not use, install, modif y or
6 redistribute this Apple software. 6 redistribute this Apple software.
7 7
8 In consideration of your agreement to abide by the following terms, and subject to these 8 In consideration of your agreement to abide by the following terms, and subject to these
9 terms, Apple grants you a personal, non-exclusive license, under Apple’s copyri ghts in 9 terms, Apple grants you a personal, non-exclusive license, under Apple’s copyri ghts in
10 this original Apple software (the "Apple Software"), to use, reproduce, modify and 10 this original Apple software (the "Apple Software"), to use, reproduce, modify and
(...skipping 15 matching lines...) Expand all
26 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONS EQUENTIAL 26 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONS EQUENTIAL
27 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERV ICES; LOSS 27 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERV ICES; LOSS
28 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, 28 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE,
29 REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER C AUSED AND 29 REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER C AUSED AND
30 WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR 30 WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR
31 OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34 #include <stdlib.h> 34 #include <stdlib.h>
35 #include <stdio.h> 35 #include <stdio.h>
36 #include <wtf/Platform.h>
37 #include "PluginObject.h" 36 #include "PluginObject.h"
38 37
39 #ifdef WIN32 38 #ifdef WIN32
40 #define strcasecmp _stricmp 39 #define strcasecmp _stricmp
41 #define NPAPI WINAPI 40 #define NPAPI WINAPI
42 #else 41 #else
43 #define NPAPI 42 #define NPAPI
44 #endif 43 #endif
45 44
46 #if defined(OS_LINUX) 45 #if defined(OS_LINUX)
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 handleCallback(obj, url, reason, notifyData); 458 handleCallback(obj, url, reason, notifyData);
460 } 459 }
461 460
462 NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) 461 NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
463 { 462 {
464 NPError err = NPERR_NO_ERROR; 463 NPError err = NPERR_NO_ERROR;
465 464
466 switch (variable) { 465 switch (variable) {
467 #if defined(OS_LINUX) 466 #if defined(OS_LINUX)
468 case NPPVpluginNameString: 467 case NPPVpluginNameString:
469 *((const char **)value) = "WebKit Test PlugIn"; 468 *((const char **)value) = "Pepper Test PlugIn";
470 break; 469 break;
471 case NPPVpluginDescriptionString: 470 case NPPVpluginDescriptionString:
472 *((const char **)value) = "Simple Netscape plug-in that handles test content for WebKit"; 471 *((const char **)value) = "Simple Pepper plug-in for manual testing. ";
473 break; 472 break;
474 case NPPVpluginNeedsXEmbed: 473 case NPPVpluginNeedsXEmbed:
475 *((NPBool *)value) = TRUE; 474 *((NPBool *)value) = TRUE;
476 break; 475 break;
477 #endif 476 #endif
478 case NPPVpluginScriptableNPObject: { 477 case NPPVpluginScriptableNPObject: {
479 void **v = (void **)value; 478 void **v = (void **)value;
480 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 479 PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
481 // Return value is expected to be retained 480 // Return value is expected to be retained
482 browser->retainobject((NPObject *)obj); 481 browser->retainobject((NPObject *)obj);
(...skipping 19 matching lines...) Expand all
502 { 501 {
503 return NPP_GetValue(instance, variable, value); 502 return NPP_GetValue(instance, variable, value);
504 } 503 }
505 504
506 const char* NP_GetMIMEDescription(void) { 505 const char* NP_GetMIMEDescription(void) {
507 // The layout test LayoutTests/fast/js/navigator-mimeTypes-length.html 506 // The layout test LayoutTests/fast/js/navigator-mimeTypes-length.html
508 // asserts that the number of mimetypes handled by plugins should be 507 // asserts that the number of mimetypes handled by plugins should be
509 // greater than the number of plugins. This isn't true if we're 508 // greater than the number of plugins. This isn't true if we're
510 // the only plugin and we only handle one mimetype, so specify 509 // the only plugin and we only handle one mimetype, so specify
511 // multiple mimetypes here. 510 // multiple mimetypes here.
512 return "application/x-webkit-test-netscape:testnetscape:test netscape conten t;" 511 return "pepper-application/x-pepper-test-plugin pepper test;";
513 "application/x-webkit-test-netscape2:testnetscape2:test netscape cont ent2";
514 } 512 }
515 #endif 513 #endif
OLDNEW
« no previous file with comments | « webkit/tools/pepper_test_plugin/README ('k') | webkit/tools/pepper_test_plugin/pepper_test_plugin.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698