Bug 48775 - Both the WebProcessConnection and PluginProcessConnection should have NPRemoteObjectMaps
Summary: Both the WebProcessConnection and PluginProcessConnection should have NPRemot...
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-01 13:18 PDT by Anders Carlsson
Modified: 2010-12-14 09:11 PST (History)
1 user (show)

See Also:


Attachments
Patch (16.88 KB, patch)
2010-11-01 13:23 PDT, 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-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>