Closed Bug 855411 Opened 13 years ago Closed 13 years ago

GC: Rooting in xbl

Categories

(Core :: XBL, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: evilpies, Assigned: evilpies)

References

Details

Attachments

(13 files, 5 obsolete files)

2.75 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
2.68 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
9.55 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
3.08 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
4.04 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
5.48 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
4.04 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
10.39 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
4.49 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
6.88 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
12.05 KB, patch
terrence
: review+
bzbarsky
: review+
Details | Diff | Splinter Review
1.60 KB, patch
bzbarsky
: review+
Details | Diff | Splinter Review
11.86 KB, patch
bzbarsky
: review+
Details | Diff | Splinter Review
This should fix all rooting issues in xbl. There are something with Finalize that I didn't touch, because we shouldn't GC there.
Fun times, just redid all of the patch piece by piece, because the browser was crashing on startup. All because I wrote JS_DATA_TO_FUNC_PTR(JSPropertyOp, get.address()) instead of JS_DATA_TO_FUNC_PTR(JSPropertyOp, get.get()). I hope we can get rid of this soon.
Attached patch changedocument (obsolete) — Splinter Review
Attached patch Init[Js]Clas (obsolete) — Splinter Review
Attached patch Lookup*Splinter Review
Attached patch checkAccessSplinter Review
Attached patch InstallMember (obsolete) — Splinter Review
Attached patch read (obsolete) — Splinter Review
Attached patch executeSplinter Review
Attached patch InstallXBLFieldSplinter Review
Flags: needinfo?
Attached patch InstallAccessorSplinter Review
Flags: needinfo?
Attached patch SerializeSplinter Review
Status: NEW → ASSIGNED
QA Contact: evilpies
Assignee: nobody → evilpies
QA Contact: evilpies
Attachment #730444 - Attachment is patch: true
I dropped a method call that produced test failures. Fixed that now.
Attachment #730443 - Attachment is obsolete: true
Attached patch Init[Js]Clas v2Splinter Review
I am not sure why this was making problems before, probably something else that I fixed during the rewrite.
Attachment #730444 - Attachment is obsolete: true
Attachment #730445 - Flags: review?(terrence)
Attachment #730445 - Flags: review?(bzbarsky)
Attachment #730446 - Flags: review?(terrence)
Attachment #730446 - Flags: review?(bzbarsky)
Attachment #730447 - Flags: review?(terrence)
Attachment #730447 - Flags: review?(bzbarsky)
Attachment #730449 - Flags: review?(terrence)
Attachment #730449 - Flags: review?(bzbarsky)
Attachment #730450 - Flags: review?(terrence)
Attachment #730450 - Flags: review?(bzbarsky)
Attachment #730451 - Flags: review?(terrence)
Attachment #730451 - Flags: review?(bzbarsky)
Attachment #730453 - Flags: review?(terrence)
Attachment #730453 - Flags: review?(bzbarsky)
Attachment #730454 - Flags: review?(terrence)
Attachment #730454 - Flags: review?(bzbarsky)
Attachment #730455 - Flags: review?(terrence)
Attachment #730455 - Flags: review?(bzbarsky)
Attachment #730456 - Flags: review?(terrence)
Attachment #730456 - Flags: review?(bzbarsky)
Attachment #730457 - Flags: review?(terrence)
Attachment #730457 - Flags: review?(bzbarsky)
Attachment #730707 - Flags: review?(terrence)
Attachment #730707 - Flags: review?(bzbarsky)
Attachment #730708 - Flags: review?(terrence)
Attachment #730708 - Flags: review?(bzbarsky)
Comment on attachment 730445 [details] [diff] [review] Lookup* r=me
Attachment #730445 - Flags: review?(bzbarsky) → review+
Comment on attachment 730446 [details] [diff] [review] checkAccess r=me
Attachment #730446 - Flags: review?(bzbarsky) → review+
Comment on attachment 730447 [details] [diff] [review] InstallMember Why did you move the AutoPushJSContext? It's not exactly clear to me why this is safe. If you just need the JSContext before that, just get it instead of pushing, which has security-related side-effects and whatnot.
Attachment #730447 - Flags: review?(bzbarsky) → review-
Comment on attachment 730447 [details] [diff] [review] InstallMember Review of attachment 730447 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/xbl/src/nsXBLProtoImpl.cpp @@ +68,5 @@ > // class object in the bound document that represents the concrete version of this implementation. > // This function also has the side effect of building up the prototype implementation if it has > // not been built already. > nsCOMPtr<nsIXPConnectJSObjectHolder> holder; > + JS::Rooted<JSObject*> targetClassObject(cx, nullptr); We need the context root this here.
Comment on attachment 730445 [details] [diff] [review] Lookup* Review of attachment 730445 [details] [diff] [review]: ----------------------------------------------------------------- ::: content/xbl/src/nsXBLBinding.h @@ +87,5 @@ > > /* > * Internal version. Requires that aCx is in appropriate xbl scope. > */ > bool LookupMemberInternal(JSContext* aCx, nsString& aName, JS::HandleId aNameAsId, While you are here, might as well change this to JS::Handle<jsid>.
Attachment #730445 - Flags: review?(terrence) → review+
Comment on attachment 730449 [details] [diff] [review] CompileMember >- nsresult rv = curr->CompileMember(context, mClassName, mClassObject); >+ nsresult rv = curr->CompileMember(context, mClassName, classObject); Why is this needed? If mClassObject is already rooted, seems like it should be usable here. Or is it not rooted yet? In that case, is it coming up? r=me either way, I guess
Attachment #730449 - Flags: review?(bzbarsky) → review+
> We need the context root this here. Yes, I understand that. The point is you need the context, but do you need the modified JSContext stack and all that jazz?
Attachment #730446 - Flags: review?(terrence) → review+
Attachment #730449 - Flags: review?(terrence) → review+
Comment on attachment 730450 [details] [diff] [review] read Review of attachment 730450 [details] [diff] [review]: ----------------------------------------------------------------- I don't know what the security implications of pushing a new context are, so I'll defer to :bz for that. The rooting looks fine, assuming that change is good.
Comment on attachment 730450 [details] [diff] [review] read Review of attachment 730450 [details] [diff] [review]: ----------------------------------------------------------------- I don't know what the security implications of pushing a new context are, so I'll defer to :bz for that. The rooting looks fine, assuming that change is good.
Attachment #730450 - Flags: review?(terrence) → review+
Attachment #730451 - Flags: review?(terrence) → review+
Attachment #730453 - Flags: review?(terrence) → review+
Comment on attachment 730450 [details] [diff] [review] read Don't push the cx. Just store it in a JSContext*.
Attachment #730450 - Flags: review?(bzbarsky) → review-
Attachment #730454 - Flags: review?(terrence) → review+
Attachment #730455 - Flags: review?(terrence) → review+
Attachment #730456 - Flags: review?(terrence) → review+
Attachment #730457 - Flags: review?(terrence) → review+
Comment on attachment 730451 [details] [diff] [review] execute r=me
Attachment #730451 - Flags: review?(bzbarsky) → review+
Comment on attachment 730453 [details] [diff] [review] InstallXBLField r=me
Attachment #730453 - Flags: review?(bzbarsky) → review+
Comment on attachment 730454 [details] [diff] [review] InstallAccessor r=me
Attachment #730454 - Flags: review?(bzbarsky) → review+
Comment on attachment 730455 [details] [diff] [review] InstallField r=me
Attachment #730455 - Flags: review?(bzbarsky) → review+
Comment on attachment 730456 [details] [diff] [review] Various stuff r=me
Attachment #730456 - Flags: review?(bzbarsky) → review+
Comment on attachment 730457 [details] [diff] [review] Serialize r=me
Attachment #730457 - Flags: review?(bzbarsky) → review+
Comment on attachment 730708 [details] [diff] [review] Init[Js]Clas v2 r=me
Attachment #730708 - Flags: review?(bzbarsky) → review+
Comment on attachment 730707 [details] [diff] [review] ChangeDocument v2 r=me
Attachment #730707 - Flags: review?(bzbarsky) → review+
Attachment #730707 - Flags: review?(terrence) → review+
Attachment #730708 - Flags: review?(terrence) → review+
Comment on attachment 730447 [details] [diff] [review] InstallMember Review of attachment 730447 [details] [diff] [review]: ----------------------------------------------------------------- I can't speak for the context movement, but the rest looks fine to me.
Attachment #730447 - Flags: review?(terrence) → review+
Attached patch InstallMember - v2 (obsolete) — Splinter Review
Attachment #730447 - Attachment is obsolete: true
Attachment #731333 - Flags: review?
Attached patch read v2Splinter Review
Attachment #731334 - Flags: review?(bzbarsky)
Attachment #731333 - Flags: review? → review?(bzbarsky)
Comment on attachment 731334 [details] [diff] [review] read v2 r=me
Attachment #731334 - Flags: review?(bzbarsky) → review+
Comment on attachment 731333 [details] [diff] [review] InstallMember - v2 > + JS::Rooted<JSObject*> targetScriptObject(cx); How did that compile? cx is declared later....
Comment on attachment 731333 [details] [diff] [review] InstallMember - v2 Per comment 41.
Attachment #731333 - Flags: review?(bzbarsky) → review-
Attachment #730450 - Attachment is obsolete: true
Attachment #731334 - Attachment description: read → read v2
(In reply to Boris Zbarsky (:bz) from comment #42) > Comment on attachment 731333 [details] [diff] [review] > InstallMember - v2 > > Per comment 41. Let's just pretend this was > JS::Rooted<JSObject*> targetScriptObject(context->GetNativeContext()); Okay?
Compiles :)
Attachment #731333 - Attachment is obsolete: true
Attachment #733684 - Flags: review?(bzbarsky)
Comment on attachment 731333 [details] [diff] [review] InstallMember - v2 r=me in that alternate universe. ;)
Attachment #731333 - Flags: review- → review+
Attachment #733684 - Flags: review?(bzbarsky) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: