Source/WebKit2: Crash when making NPRuntime calls with a null NPP pointer
https://bugs.webkit.org/show_bug.cgi?id=100569
<rdar://problem/11726426>
<rdar://problem/12352836>
Reviewed by Darin Adler.
Finally bite the bullet and remove the assertion from NetscapePlugin::fromNPP. The WebKit1 equivalent of this
function used to return the plug-in currently being initialized in NPP_New, but we've never done that in WebKit2
and it has never been necessary. The crashes fixed here are not from calls underneath NPP_New so fixing it wouldn't
do us any good anyway.
Also, make the PluginDestructionProtector handle a null plug-in gracefully.
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::PluginDestructionProtector::PluginDestructionProtector):
(PluginDestructionProtector):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::fromNPP):
Tools: Crash when making NPRuntime calls with a null NPP pointer
https://bugs.webkit.org/show_bug.cgi?id=100569
Reviewed by Darin Adler.
Add new NPRuntimeCallsWithNullNPP plug-in test.
* DumpRenderTree/DumpRenderTree.gypi:
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
(PluginTest::NPN_ReleaseVariantValue):
(PluginTest::netscapeFuncs):
* DumpRenderTree/TestNetscapePlugIn/PluginTest.h:
(PluginTest):
* DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp: Added.
(NPRuntimeCallsWithNullNPP):
(NPRuntimeCallsWithNullNPP::NPRuntimeCallsWithNullNPP):
(NPRuntimeCallsWithNullNPP::NPP_New):
* DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj:
* DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro:
* GNUmakefile.am:
LayoutTests: Crash when making NPRuntime calls with a null NPP pointer
https://bugs.webkit.org/show_bug.cgi?id=100569
Reviewed by Darin Adler.
Add new tests.
* plugins/npruntime/npruntime-calls-with-null-npp-expected.txt: Added.
* plugins/npruntime/npruntime-calls-with-null-npp.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed