_NPN_IntFromIdentifier is wrong int32_t _NPN_IntFromIdentifier(NPIdentifier identifier) { PrivateIdentifier* i = (PrivateIdentifier*)identifier; if (!i->isString) return 0; return i->value.number; } The check should be if (i->isString) instead of !i->isString This is a one line fix. The test case is the PITA.
Created attachment 19773 [details] First pass at identifier -> int fix and test case .../netscape-identifier-conversion-expected.txt | 10 ++++ .../plugins/netscape-identifier-conversion.html | 13 +++++ LayoutTests/plugins/resources/TEMPLATE.html | 13 +++++ .../resources/netscape-identifier-conversion.js | 33 +++++++++++ WebCore/bridge/npruntime.cpp | 2 +- .../TestNetscapePlugIn.subproj/PluginObject.cpp | 58 +++++++++++++++++++- 6 files changed, 126 insertions(+), 3 deletions(-)
I don't think I got the test case quite right, debugging now. I'm posting this now to make sure it doesn't get forgotten.
Created attachment 19847 [details] Cleanup PluginObject.cpp and fix test methods .../TestNetscapePlugIn.subproj/PluginObject.cpp | 473 +++++++++++--------- 1 files changed, 270 insertions(+), 203 deletions(-)
Created attachment 19848 [details] Fix NPAPI implementation and plugin test .../netscape-identifier-conversion-expected.txt | 13 ++++- .../resources/netscape-identifier-conversion.js | 36 ++++------- WebCore/WebCore.NPAPI.exp | 1 + WebKit/mac/Plugins/WebNetscapePluginPackage.m | 2 + .../TestNetscapePlugIn.subproj/PluginObject.cpp | 66 ++++++++++++-------- 5 files changed, 68 insertions(+), 50 deletions(-)
Created attachment 19849 [details] First pass at identifier -> int fix and test case Cleanup PluginObject.cpp and fix test methods Fix NPAPI implementation and plugin test --- .../netscape-identifier-conversion-expected.txt | 21 + .../plugins/netscape-identifier-conversion.html | 13 + LayoutTests/plugins/resources/TEMPLATE.html | 13 + .../resources/netscape-identifier-conversion.js | 23 + WebCore/WebCore.NPAPI.exp | 1 + WebCore/bridge/npruntime.cpp | 2 +- WebKit/mac/Plugins/WebNetscapePluginPackage.m | 2 + .../TestNetscapePlugIn.subproj/PluginObject.cpp | 547 ++++++++++++-------- 8 files changed, 415 insertions(+), 207 deletions(-)
In order to maintain my sanity, I had to clean up PluginObject a little as well. I did not make any attempt to further validate our NPNetscapeFuncs struct, it's possible we're still missing other function pointers.
Comment on attachment 19849 [details] First pass at identifier -> int fix and test case r=me, all good except for lack of ChangeLog
Added changelog and landed as r31112