[webkit-reviews] review granted: [Bug 49198] NPClass::construct and NPClass::invokeDefault never called with out-of-process plug-ins in WebKit2 : [Attachment 73264] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 8 12:12:54 PST 2010


Adam Roben (aroben) <aroben at apple.com> has granted Anders Carlsson
<andersca at apple.com>'s request for review:
Bug 49198: NPClass::construct and NPClass::invokeDefault never called with
out-of-process plug-ins in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=49198

Attachment 73264: Patch
https://bugs.webkit.org/attachment.cgi?id=73264&action=review

------- Additional Comments from Adam Roben (aroben) <aroben at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=73264&action=review

> WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp:108
> +    Vector<NPVariant> arguments;
> +    for (size_t i = 0; i < argumentsData.size(); ++i)
> +	  
arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i]
));

Maybe it would be better to give arguments an initial size?

> WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp:113
> +    if (!returnValue)
> +	   return;

Whoops! You just leaked the NPVariants in arguments!

> WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp:215
> +    Vector<NPVariant> arguments;
> +    for (size_t i = 0; i < argumentsData.size(); ++i)
> +	  
arguments.append(m_npRemoteObjectMap->npVariantDataToNPVariant(argumentsData[i]
));
> +
> +    NPVariant result;
> +    returnValue = m_npObject->_class->construct(m_npObject,
arguments.data(), arguments.size(), &result);
> +    if (!returnValue)
> +	   return;

Same comments here.


More information about the webkit-reviews mailing list