Changeset 62700 in webkit
- Timestamp:
- Jul 7, 2010 2:36:37 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r62695 r62700 1 2010-07-07 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Simon Fraser. 4 5 Unify Mac and Windows TestNetscapePlugin main.cpp files 6 https://bugs.webkit.org/show_bug.cgi?id=41798 7 8 * DumpRenderTree/DumpRenderTree.sln: 9 * DumpRenderTree/TestNetscapePlugIn/main.cpp: 10 (strcasecmp): 11 (NP_Initialize): 12 (NP_GetEntryPoints): 13 (NP_Shutdown): 14 (NPP_New): 15 (NPP_Destroy): 16 (NPP_HandleEvent): 17 * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: 18 * DumpRenderTree/win/TestNetscapePlugin/main.cpp: Removed. 19 1 20 2010-07-07 Kevin Ollivier <kevino@theolliviers.com> 2 21 -
trunk/WebKitTools/DumpRenderTree/DumpRenderTree.sln
r49705 r62700 4 4 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DumpRenderTree", "win\DumpRenderTree.vcproj", "{6567DFD4-D6DE-4CD5-825D-17E353D160E1}" 5 5 EndProject 6 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestNetscapePlugin", " win\TestNetscapePlugin\TestNetscapePlugin.vcproj", "{C0737398-3565-439E-A2B8-AB2BE4D5430C}"6 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TestNetscapePlugin", "TestNetscapePlugin\win\TestNetscapePlugin.vcproj", "{C0737398-3565-439E-A2B8-AB2BE4D5430C}" 7 7 EndProject 8 8 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindSafari", "..\FindSafari\FindSafari.vcproj", "{DA31DA52-6675-48D4-89E0-333A7144397C}" -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
r62685 r62700 24 24 */ 25 25 26 #import "PluginObject.h" 27 28 // Mach-o entry points 29 extern "C" { 30 NPError NP_Initialize(NPNetscapeFuncs *browserFuncs); 31 NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs); 32 void NP_Shutdown(void); 33 } 34 35 // Mach-o entry points 36 NPError NP_Initialize(NPNetscapeFuncs *browserFuncs) 26 #include "PluginObject.h" 27 28 #if XP_WIN 29 #define STDCALL __stdcall 30 31 static inline int strcasecmp(const char* s1, const char* s2) 32 { 33 return _stricmp(s1, s2); 34 } 35 36 #else 37 #define STDCALL 38 #endif 39 40 // Entry points 41 extern "C" 42 NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs) 37 43 { 38 44 browser = browserFuncs; … … 40 46 } 41 47 42 NPError NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) 43 { 44 pluginFuncs->version = 11; 48 extern "C" 49 NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) 50 { 51 pluginFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; 45 52 pluginFuncs->size = sizeof(pluginFuncs); 46 53 pluginFuncs->newp = NPP_New; … … 61 68 } 62 69 63 void NP_Shutdown(void) 70 extern "C" 71 void STDCALL NP_Shutdown(void) 64 72 { 65 73 } … … 71 79 bool forceCarbon = false; 72 80 81 #if XP_MAC 73 82 // Always turn on the CG model 74 83 NPBool supportsCoreGraphics; … … 78 87 if (!supportsCoreGraphics) 79 88 return NPERR_INCOMPATIBLE_VERSION_ERROR; 80 89 81 90 browser->setvalue(instance, NPPVpluginDrawingModel, (void *)NPDrawingModelCoreGraphics); 91 92 #ifndef NP_NO_CARBON 93 NPBool supportsCarbon = false; 94 #endif 95 NPBool supportsCocoa = false; 96 97 #ifndef NP_NO_CARBON 98 // A browser that doesn't know about NPNVsupportsCarbonBool is one that only supports Carbon event model. 99 if (browser->getvalue(instance, NPNVsupportsCarbonBool, &supportsCarbon) != NPERR_NO_ERROR) 100 supportsCarbon = true; 101 #endif 102 103 if (browser->getvalue(instance, NPNVsupportsCocoaBool, &supportsCocoa) != NPERR_NO_ERROR) 104 supportsCocoa = false; 105 106 if (supportsCocoa && !forceCarbon) { 107 obj->eventModel = NPEventModelCocoa; 108 #ifndef NP_NO_CARBON 109 } else if (supportsCarbon) { 110 obj->eventModel = NPEventModelCarbon; 111 #endif 112 } else { 113 return NPERR_INCOMPATIBLE_VERSION_ERROR; 114 } 115 116 browser->setvalue(instance, NPPVpluginEventModel, (void *)obj->eventModel); 117 #endif // XP_MAC 82 118 83 119 PluginObject* obj = (PluginObject*)browser->createobject(instance, getPluginClass()); … … 114 150 else if (strcasecmp(argn[i], "testwindowopen") == 0) 115 151 obj->testWindowOpen = TRUE; 152 else if (strcasecmp(argn[i], "testGetURLOnDestroy") == 0) 153 obj->testGetURLOnDestroy = TRUE; 116 154 else if (strcasecmp(argn[i], "src") == 0 && strstr(argv[i], "plugin-document-has-focus.pl")) 117 155 obj->testKeyboardFocusForPlugins = TRUE; 118 156 } 157 158 browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode); 119 159 120 #ifndef NP_NO_CARBON121 NPBool supportsCarbon = false;122 #endif123 NPBool supportsCocoa = false;124 125 #ifndef NP_NO_CARBON126 // A browser that doesn't know about NPNVsupportsCarbonBool is one that only supports Carbon event model.127 if (browser->getvalue(instance, NPNVsupportsCarbonBool, &supportsCarbon) != NPERR_NO_ERROR)128 supportsCarbon = true;129 #endif130 131 if (browser->getvalue(instance, NPNVsupportsCocoaBool, &supportsCocoa) != NPERR_NO_ERROR)132 supportsCocoa = false;133 134 if (supportsCocoa && !forceCarbon) {135 obj->eventModel = NPEventModelCocoa;136 #ifndef NP_NO_CARBON137 } else if (supportsCarbon) {138 obj->eventModel = NPEventModelCarbon;139 #endif140 } else {141 return NPERR_INCOMPATIBLE_VERSION_ERROR;142 }143 144 browser->getvalue(instance, NPNVprivateModeBool, (void *)&obj->cachedPrivateBrowsingMode);145 browser->setvalue(instance, NPPVpluginEventModel, (void *)obj->eventModel);146 147 160 return NPERR_NO_ERROR; 148 161 } … … 152 165 PluginObject* obj = static_cast<PluginObject*>(instance->pdata); 153 166 if (obj) { 167 if (obj->testGetURLOnDestroy) 168 browser->geturlnotify(obj->npp, "about:blank", "", 0); 169 154 170 if (obj->onDestroy) { 155 171 executeScript(obj, obj->onDestroy); … … 271 287 } 272 288 289 #if XP_MAC 273 290 #ifndef NP_NO_CARBON 274 291 static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* event) … … 402 419 } 403 420 421 #endif // XP_MAC 422 404 423 int16_t NPP_HandleEvent(NPP instance, void *event) 405 424 { … … 408 427 return 0; 409 428 429 #if XP_MAC 410 430 #ifndef NP_NO_CARBON 411 431 if (obj->eventModel == NPEventModelCarbon) … … 415 435 assert(obj->eventModel == NPEventModelCocoa); 416 436 return handleEventCocoa(instance, obj, static_cast<NPCocoaEvent*>(event)); 437 #else 438 // FIXME: Implement for other platforms. 439 return 0; 440 #endif // XP_MAC 417 441 } 418 442 -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj
r62685 r62700 373 373 </File> 374 374 <File 375 RelativePath="..\main.cpp" 376 > 377 <FileConfiguration 378 Name="Debug|Win32" 379 > 380 <Tool 381 Name="VCCLCompilerTool" 382 ObjectFile="$(IntDir)\$(InputName)1.obj" 383 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" 384 /> 385 </FileConfiguration> 386 <FileConfiguration 387 Name="Release|Win32" 388 > 389 <Tool 390 Name="VCCLCompilerTool" 391 ObjectFile="$(IntDir)\$(InputName)1.obj" 392 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" 393 /> 394 </FileConfiguration> 395 <FileConfiguration 396 Name="Debug_Internal|Win32" 397 > 398 <Tool 399 Name="VCCLCompilerTool" 400 ObjectFile="$(IntDir)\$(InputName)1.obj" 401 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" 402 /> 403 </FileConfiguration> 404 <FileConfiguration 405 Name="Debug_Cairo|Win32" 406 > 407 <Tool 408 Name="VCCLCompilerTool" 409 ObjectFile="$(IntDir)\$(InputName)1.obj" 410 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" 411 /> 412 </FileConfiguration> 413 <FileConfiguration 414 Name="Debug_All|Win32" 415 > 416 <Tool 417 Name="VCCLCompilerTool" 418 ObjectFile="$(IntDir)\$(InputName)1.obj" 419 XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc" 420 /> 421 </FileConfiguration> 422 </File> 423 <File 375 424 RelativePath="..\PluginObject.cpp" 376 425 >
Note: See TracChangeset
for help on using the changeset viewer.