Bug 49198 - NPClass::construct and NPClass::invokeDefault never called with out-of-process plug-ins in WebKit2
Summary: NPClass::construct and NPClass::invokeDefault never called with out-of-proces...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Anders Carlsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-08 12:07 PST by Anders Carlsson
Modified: 2010-11-08 12:35 PST (History)
1 user (show)

See Also:


Attachments
Patch (13.41 KB, patch)
2010-11-08 12:09 PST, Anders Carlsson
aroben: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Carlsson 2010-11-08 12:07:31 PST
NPClass::construct and NPClass::invokeDefault never called with out-of-process plug-ins in WebKit2
Comment 1 Anders Carlsson 2010-11-08 12:09:17 PST
Created attachment 73264 [details]
Patch
Comment 2 WebKit Review Bot 2010-11-08 12:12:22 PST
Attachment 73264 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/platform/mac-snowleopard/Skipped', u'LayoutTests/platform/mac-wk2/Skipped', u'WebKit2/ChangeLog', u'WebKit2/Shared/Plugins/NPObjectMessageReceiver.cpp', u'WebKit2/Shared/Plugins/NPObjectMessageReceiver.h', u'WebKit2/Shared/Plugins/NPObjectMessageReceiver.messages.in', u'WebKit2/Shared/Plugins/NPObjectProxy.cpp', u'WebKit2/Shared/Plugins/NPObjectProxy.h']" exit_code: 1
WebKit2/Shared/Plugins/NPObjectProxy.cpp:303:  NPObjectProxy::NP_InvokeDefault is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
WebKit2/Shared/Plugins/NPObjectProxy.cpp:333:  NPObjectProxy::NP_Construct is incorrectly named. Don't use underscores in your identifier names.  [readability/naming] [4]
Total errors found: 2 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Adam Roben (:aroben) 2010-11-08 12:12:54 PST
Comment on attachment 73264 [details]
Patch

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.
Comment 4 Anders Carlsson 2010-11-08 12:35:33 PST
Committed r71559: <http://trac.webkit.org/changeset/71559>