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
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Restricted
  • Only users with Commit permission may comment.



Sign in to add a comment
link

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

Reported by littlema...@gmail.com, Sep 22 2009

Issue description

Chrome Version       : 4.0.204.0
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
JavaScript.


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
possible.
 

Comment 1 by phajdan.jr@chromium.org, Dec 28 2009

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

Comment 2 by jat@google.com, 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 stuartmorgan@chromium.org, Aug 31 2010

Comment 4 by stuartmorgan@chromium.org, Dec 15 2010

Labels: -Internals-Plugins Feature-Plugins

Comment 5 by bugdroid1@chromium.org, May 26 2011

Project Member
The following revision refers to this bug:
    http://src.chromium.org/viewvc/chrome?view=rev&revision=86893

------------------------------------------------------------------------
r86893 | jam@chromium.org | Thu May 26 13:56:50 PDT 2011

Changed paths:
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/plugin/plugin_channel_base.h?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/plugin/npobject_stub.cc?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/ui/npapi_uitest.cc?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/npapi/test/plugin_test_factory.cc?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/webkit/tools/test_shell/test_shell.gypi?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/plugin/plugin_channel_base.cc?r1=86893&r2=86892&pathrev=86893
 A http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/npapi/test/plugin_npobject_identity_test.cc?r1=86893&r2=86892&pathrev=86893
 A http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/npapi/npobject_identity.html?r1=86893&r2=86892&pathrev=86893
 A http://src.chromium.org/viewvc/chrome/trunk/src/webkit/plugins/npapi/test/plugin_npobject_identity_test.h?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/plugin/npobject_proxy.cc?r1=86893&r2=86892&pathrev=86893
 M http://src.chromium.org/viewvc/chrome/trunk/src/content/plugin/npobject_util.cc?r1=86893&r2=86892&pathrev=86893

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 (knorton@google.com), original review: http://codereview.chromium.org/7037027/
------------------------------------------------------------------------

Comment 6 by bugdroid1@chromium.org, 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 bugdroid1@chromium.org, 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 bugdroid1@chromium.org, Mar 10 2013

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

Comment 9 by bugdroid1@chromium.org, Apr 6 2013

Project Member
Labels: Cr-Blink

Comment 10 by bugdroid1@chromium.org, Apr 6 2013

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

Sign in to add a comment