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

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

Issue 150144: linux: make layout test plugin build and run in test_shell (Closed)
Patch Set: Created 11 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 unified diff | Download patch
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | 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 /* 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 browser->releaseobject(consoleObject); 83 browser->releaseobject(consoleObject);
84 browser->releaseobject(windowObject); 84 browser->releaseobject(windowObject);
85 return; 85 return;
86 } 86 }
87 87
88 browser->releasevariantvalue(&result); 88 browser->releasevariantvalue(&result);
89 browser->releaseobject(consoleObject); 89 browser->releaseobject(consoleObject);
90 browser->releaseobject(windowObject); 90 browser->releaseobject(windowObject);
91 } 91 }
92 92
93 // Mach-o entry points 93 // Plugin entry points
94 extern "C" { 94 extern "C" {
95 NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs); 95 NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
96 #if defined(OS_LINUX)
97 , NPPluginFuncs *pluginFuncs
98 #endif
99 );
96 NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); 100 NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
97 void NPAPI NP_Shutdown(void); 101 void NPAPI NP_Shutdown(void);
102
103 #if defined(OS_LINUX)
104 NPError NP_GetValue(NPP instance, NPPVariable variable, void *value);
105 const char* NP_GetMIMEDescription(void);
106 #endif
98 } 107 }
99 108
100 // Mach-o entry points 109 // Plugin entry points
101 NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs) 110 NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
111 #if defined(OS_LINUX)
112 , NPPluginFuncs *pluginFuncs
113 #endif
114 )
102 { 115 {
103 browser = browserFuncs; 116 browser = browserFuncs;
117 #if defined(OS_LINUX)
118 return NP_GetEntryPoints(pluginFuncs);
119 #else
104 return NPERR_NO_ERROR; 120 return NPERR_NO_ERROR;
121 #endif
105 } 122 }
106 123
107 NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) 124 NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
108 { 125 {
109 pluginFuncs->version = 11; 126 pluginFuncs->version = 11;
110 pluginFuncs->size = sizeof(pluginFuncs); 127 pluginFuncs->size = sizeof(pluginFuncs);
111 pluginFuncs->newp = NPP_New; 128 pluginFuncs->newp = NPP_New;
112 pluginFuncs->destroy = NPP_Destroy; 129 pluginFuncs->destroy = NPP_Destroy;
113 pluginFuncs->setwindow = NPP_SetWindow; 130 pluginFuncs->setwindow = NPP_SetWindow;
114 pluginFuncs->newstream = NPP_NewStream; 131 pluginFuncs->newstream = NPP_NewStream;
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 { 439 {
423 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 440 PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
424 if (obj->onURLNotify) 441 if (obj->onURLNotify)
425 executeScript(obj, obj->onURLNotify); 442 executeScript(obj, obj->onURLNotify);
426 443
427 handleCallback(obj, url, reason, notifyData); 444 handleCallback(obj, url, reason, notifyData);
428 } 445 }
429 446
430 NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) 447 NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
431 { 448 {
432 if (variable == NPPVpluginScriptableNPObject) { 449 NPError err = NPERR_NO_ERROR;
433 void **v = (void **)value; 450
434 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 451 switch (variable) {
435 // Return value is expected to be retained 452 #if defined(OS_LINUX)
436 browser->retainobject((NPObject *)obj); 453 case NPPVpluginNameString:
437 *v = obj; 454 *((const char **)value) = "WebKit Test PlugIn";
438 return NPERR_NO_ERROR; 455 break;
456 case NPPVpluginDescriptionString:
457 *((const char **)value) = "Simple Netscape plug-in that handles test content for WebKit";
458 break;
459 case NPPVpluginNeedsXEmbed:
460 *((NPBool *)value) = TRUE;
461 break;
462 #endif
463 case NPPVpluginScriptableNPObject: {
464 void **v = (void **)value;
465 PluginObject* obj = static_cast<PluginObject*>(instance->pdata);
466 // Return value is expected to be retained
467 browser->retainobject((NPObject *)obj);
468 *v = obj;
469 break;
470 }
471 default:
472 fprintf(stderr, "Unhandled variable to NPP_GetValue\n");
473 err = NPERR_GENERIC_ERROR;
474 break;
439 } 475 }
440 return NPERR_GENERIC_ERROR; 476
477 return err;
441 } 478 }
442 479
443 NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) 480 NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
444 { 481 {
445 return NPERR_GENERIC_ERROR; 482 return NPERR_GENERIC_ERROR;
446 } 483 }
484
485 #if defined(OS_LINUX)
486 NPError NP_GetValue(NPP instance, NPPVariable variable, void *value)
487 {
488 return NPP_GetValue(instance, variable, value);
489 }
490
491 const char* NP_GetMIMEDescription(void) {
492 return "application/x-webkit-test-netscape:testnetscape:test netscape conten t";
493 }
494 #endif
OLDNEW
« no previous file with comments | « webkit/tools/layout_tests/test_expectations.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698