Closed Bug 533600 Opened 15 years ago Closed 14 years ago

Rewrite nsXPConnect::GetWrapperFor in terms of XPCWrappedNativeScopes.

Categories

(Core :: XPConnect, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.3a3

People

(Reporter: mrbkap, Assigned: mrbkap)

References

Details

Attachments

(1 file, 2 obsolete files)

      No description provided.
This is what I'm going to implement here. I hope the pseudo-code is readable to other interested people. There's a cheat sheet at the top of it that helped me tremendously in the making of this pseudo-code.

One thing to note here: there isn't anything here that's tremendously expensive or that requires the JS stack (just the current global object). There are some questions in here because it isn't clear to me what should happen in:

var o = {};
o.p = o;
var w = new XPCSafeJSObjectWrapper(o);
w = w.p // Should w still be a SJOW? It's totally pointless.
Attached patch wip (obsolete) — Splinter Review
There's still some work to do here: COWs & co need to learn about how to act like a SOW when asked to. But other than that, this should be complete. I should also be able to backport this patch to older branches and use it to fix some bugs on them.
Attachment #420777 - Attachment is obsolete: true
Attachment #421899 - Flags: review?(jst)
Blocks: 523994
Attached patch patch v1Splinter Review
Attachment #421899 - Attachment is obsolete: true
Attachment #423097 - Flags: review?(jst)
Attachment #421899 - Flags: review?(jst)
Attachment #423097 - Flags: review?(jst) → review+
Comment on attachment 423097 [details] [diff] [review]
patch v1

- In CreateWrapperFromType():

+  if (hint & SOW) {
+    if (OBJECT_TO_JSVAL(obj) == *vp) {
+      if (!SystemOnlyWrapper::WrapObject(cx, scope, *vp, vp)) {
+        return JS_FALSE;
+      }
+    } else {
+      // TODO Write me!

Do we need to write this to land this patch?

r=jst if not.
That TODO is filled in in another patch. I was going to land them at the same time.
http://hg.mozilla.org/mozilla-central/rev/563a0f2f93c1
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a3
Depends on: 553765
Depends on: 554448
Blocks: 520522
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: