Bug 48775

Summary: Both the WebProcessConnection and PluginProcessConnection should have NPRemoteObjectMaps
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: eric
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch aroben: review+

Description Anders Carlsson 2010-11-01 13:18:58 PDT
Both the WebProcessConnection and PluginProcessConnection should have NPRemoteObjectMaps
Comment 1 Anders Carlsson 2010-11-01 13:23:29 PDT
Created attachment 72545 [details]
Patch
Comment 2 Adam Roben (:aroben) 2010-11-01 13:29:51 PDT
Comment on attachment 72545 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=72545&action=review

> WebKit2/Shared/Plugins/NPRemoteObjectMap.cpp:57
> +uint64_t NPRemoteObjectMap::registerNPObject(NPObject* npObject)
> +{
> +    uint64_t npObjectID = generateNPObjectID();
> +
> +    OwnPtr<NPObjectMessageReceiver> npObjectMessageReceiver = NPObjectMessageReceiver::create(npObject);
> +    m_registeredNPObjects.set(npObjectID, npObjectMessageReceiver.leakPtr());

I'm not sure the local variable really helps here.

It doesn't seem like this function will do the right thing if the same npObject is passed in twice.

> WebKit2/Shared/Plugins/NPRemoteObjectMap.h:33
> +#include <wtf/HashMap.h>
>  #include <wtf/Noncopyable.h>
> +#include <WebCore/npruntime.h>

ASCII order please!

> WebKit2/Shared/Plugins/NPRemoteObjectMap.h:42
> +class NPObjectProxy;
> +class NPObjectMessageReceiver;

Here too!

> WebKit2/Shared/Plugins/NPRemoteObjectMap.h:53
> +    // Creates an NPObjectProxy wrapper for the remote object with the given remote object ID.
> +    NPObjectProxy* getOrCreateNPObjectProxy(uint64_t remoteObjectID);
> +
> +    uint64_t registerNPObject(NPObject*);

No comment here? This function seems at least as mysterious as getOrCreateNPObjectProxy.
Comment 3 Eric Seidel (no email) 2010-12-14 01:47:06 PST
Curious what the status is here?  I assume this was landed?
Comment 4 Anders Carlsson 2010-12-14 09:11:27 PST
Committed r71051: <http://trac.webkit.org/changeset/71051>