Last Comment Bug 722671 - Components.utils.getWeakReference gets a weak ref to the JSObject, even when the underlying native supports weak references.
: Components.utils.getWeakReference gets a weak ref to the JSObject, even when ...
Status: RESOLVED FIXED
: dev-doc-needed
Product: Core
Classification: Components
Component: XPConnect (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla14
Assigned To: Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-31 05:23 PST by Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
Modified: 2012-04-01 19:25 PDT (History)
3 users (show)
khuey: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (5.49 KB, patch)
2012-01-31 06:01 PST, Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary)
mrbkap: review+
Details | Diff | Splinter Review

Description Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-01-31 05:23:36 PST
I think that the right behavior here is to get a weak ref to the underlying native if the object passed in is a wrapper and the native object supports weak references.  Blake, Bobby?
Comment 1 Blake Kaplan (:mrbkap) 2012-01-31 05:33:19 PST
Yeah, I think the current behavior is a bug. Please do fix it.
Comment 2 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-01-31 06:01:14 PST
Created attachment 593069 [details] [diff] [review]
Patch

There is one tricky bit here, which is that after doing weakref.get() you need to QI whatever interfaces you want again.  I don't know that there's an easy way to fix that.
Comment 3 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-04-01 19:25:54 PDT
http://hg.mozilla.org/mozilla-central/rev/447ede53509a

Note You need to log in before you can comment on or make changes to this bug.