New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.
Starred by 5 users

Issue metadata

Status: IceBox
Owner: ----
Closed: Aug 2012
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

  • Only users with Commit permission may comment.

Sign in to add a comment

Issue 22631: NPObject identity is not preserved when passed from the plugin to the browser

Reported by, Sep 22 2009

Issue description

Chrome Version       :
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: FAIL
  Firefox 3.x: OK
         IE 7: OK
         IE 8: OK

Object identity is not preserved for NPObjects passed from the plugin to

What steps will reproduce the problem?
1. Have a plugin that implements npruntime scripting interface
2. Implement a function on the plugin that returns the same NPObject
always, say getNPObject.
3. Get an instance of that plugin in JavaScript
4. Call twice the function and check for object identity

obj1 = plugin.getNPObject();
obj2 = plugin.getNPObject();
alert(obj1 === obj2);
alert(obj1 == obj2);

What is the expected result?

obj1 === obj2 && obj1 == obj2 should return true

What happens instead?

obj1 === obj2 && obj1 == obj2 returns false

Please provide any additional information below. Attach a screenshot if

Comment 1 by, Dec 28 2009

Labels: -Area-Misc Area-Internals Internals-Plugins

Comment 2 by, Feb 27 2010

This bug affects the GWT Developer plugin as well.  We worked around the problem of 
the same JS object showing up as separate NPObjects by adding an id field in an 
expando on every JS object ever passed to Java (which is slow and has its own 
problems), but we can't work around the problem in the reverse direction (where the 
same NPObject is passed to JS as two separate objects).

Comment 3 by, Aug 31 2010

Comment 4 by, Dec 15 2010

Labels: -Internals-Plugins Feature-Plugins

Comment 5 by, May 26 2011

Project Member
The following revision refers to this bug:

r86893 | | Thu May 26 13:56:50 PDT 2011

Changed paths:

Preserves NPObject identity for objects created in a plugin and passed to JavaScript. 

BUG= 5751 ,  22631 
TEST=ui_tests w/ the addition of newly added NPObjectIdentityTest.

Patch contributed by Kelly Norton (, original review:

Comment 6 by, Aug 10 2012

Project Member
Status: IceBox
Closing old bug as obsolete. Please file a new bug (with details) if this problem is still occurring for you.

Comment 7 by, Oct 13 2012

Project Member
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.

Comment 8 by, Mar 10 2013

Project Member
Labels: -Area-Internals -Feature-Plugins Cr-Internals Cr-Content-Plugins

Comment 9 by, Apr 6 2013

Project Member
Labels: Cr-Blink

Comment 10 by, Apr 6 2013

Project Member
Labels: -Cr-Content-Plugins Cr-Internals-Plugins

Sign in to add a comment