Changeset 65703 in webkit
- Timestamp:
- Aug 19, 2010 2:22:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit2/ChangeLog
r65702 r65703 1 2010-08-19 Adam Roben <aroben@apple.com> 2 3 Call NP_GetEntryPoints before NP_Initialize on Windows 4 5 Doing otherwise will cause Flash and QuickTime to crash inside 6 NP_Initialize. 7 8 Fixes <http://webkit.org/b/44270> <rdar://problem/8330393> Crash in 9 NP_Initialize when loading QuickTime when running 10 plugins/embed-attributes-setting.html in WebKit2 on Windows 11 12 Reviewed by Sam Weinig. 13 14 * WebProcess/Plugins/Netscape/NetscapePluginModule.cpp: 15 (WebKit::NetscapePluginModule::tryLoad): On Windows, first call 16 NP_GetEntryPoints, then NP_Initialize. Do the reverse on Mac to 17 prevent Silverlight (e.g.) from crashing (see r38858). 18 1 19 2010-08-19 Adam Roben <aroben@apple.com> 2 20 -
trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePluginModule.cpp
r65465 r65703 130 130 return false; 131 131 132 if (initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR)133 return false;134 135 132 m_pluginFuncs.size = sizeof(NPPluginFuncs); 136 133 m_pluginFuncs.version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; 137 if (getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR) 134 135 // On Mac, NP_Initialize must be called first, then NP_GetEntryPoints. On Windows, the order is 136 // reversed. Failing to follow this order results in crashes (e.g., in Silverlight on Mac and 137 // in Flash and QuickTime on Windows). 138 #if PLATFORM(MAC) 139 if (initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR || getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR) 138 140 return false; 141 #elif PLATFORM(WIN) 142 if (getEntryPointsFuncPtr(&m_pluginFuncs) != NPERR_NO_ERROR || initializeFuncPtr(netscapeBrowserFuncs()) != NPERR_NO_ERROR) 143 return false; 144 #endif 139 145 140 146 return true; -
trunk/WebKitTools/ChangeLog
r65701 r65703 1 2010-08-19 Adam Roben <aroben@apple.com> 2 3 Test that NP_Initialize and NP_GetEntryPoints are called in the 4 correct order 5 6 The order differs between Mac and Windows (see r38858). 7 8 Fixes <http://webkit.org/b/44270> <rdar://problem/8330393> Crash in 9 NP_Initialize when loading QuickTime when running 10 plugins/embed-attributes-setting.html in WebKit2 on Windows 11 12 Reviewed by Sam Weinig. 13 14 * DumpRenderTree/TestNetscapePlugIn/main.cpp: Added a CRASH macro and 15 a boolean to record whether NP_GetEntryPoints has been called. 16 (NP_Initialize): Crash on Windows if NP_GetEntryPoints hasn't been 17 called yet. This matches Flash and QuickTime's behavior. Crash on Mac 18 if NP_GetEntryPoints has been called already. This matches 19 Silverlight's behavior. 20 1 21 2010-08-19 Adam Roben <aroben@apple.com> 2 22 -
trunk/WebKitTools/DumpRenderTree/TestNetscapePlugIn/main.cpp
r64359 r65703 32 32 using namespace std; 33 33 34 #define CRASH() do { \ 35 *(int *)(uintptr_t)0xbbadbeef = 0; \ 36 ((void(*)())0)(); /* More reliable, but doesn't say BBADBEEF */ \ 37 } while(false) 38 39 static bool getEntryPointsWasCalled; 40 34 41 #if XP_WIN 35 42 #define STDCALL __stdcall … … 48 55 NPError STDCALL NP_Initialize(NPNetscapeFuncs *browserFuncs) 49 56 { 57 #if XP_WIN 58 // Simulate Flash and QuickTime's behavior of crashing when NP_Initialize is called before NP_GetEntryPoints. 59 if (!getEntryPointsWasCalled) 60 CRASH(); 61 #elif XP_MACOSX 62 // Simulate Silverlight's behavior of crashing when NP_GetEntryPoints is called before NP_Initialize. 63 if (getEntryPointsWasCalled) 64 CRASH(); 65 #endif 66 50 67 browser = browserFuncs; 51 68 return NPERR_NO_ERROR; … … 55 72 NPError STDCALL NP_GetEntryPoints(NPPluginFuncs *pluginFuncs) 56 73 { 74 getEntryPointsWasCalled = true; 75 57 76 pluginFuncs->version = (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR; 58 77 pluginFuncs->size = sizeof(pluginFuncs);
Note: See TracChangeset
for help on using the changeset viewer.