mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 1260417 - Part c: Stop mentioning requests around CallSetup::mRootedCallable; r=bz
Rooted used to only work when the JSContext was in a request. This has long been rectified, so the comments referring to that constraint are confusing at best.
This commit is contained in:
parent
7942e7f996
commit
dd6ade76ab
@ -135,12 +135,9 @@ CallbackObject::CallSetup::CallSetup(CallbackObject* aCallback,
|
||||
// Unmark the callable (by invoking Callback() and not the CallbackPreserveColor()
|
||||
// variant), and stick it in a Rooted before it can go gray again.
|
||||
// Nothing before us in this function can trigger a CC, so it's safe to wait
|
||||
// until here it do the unmark. This allows us to order the following two
|
||||
// operations _after_ the Push() above, which lets us take advantage of the
|
||||
// JSAutoRequest embedded in the pusher.
|
||||
//
|
||||
// We can do this even though we're not in the right compartment yet, because
|
||||
// Rooted<> does not care about compartments.
|
||||
// until here it do the unmark. This allows us to construct mRootedCallable
|
||||
// with the cx from mAutoEntryScript, avoiding the cost of finding another
|
||||
// JSContext. (Rooted<> does not care about requests or compartments.)
|
||||
mRootedCallable.emplace(cx, aCallback->Callback());
|
||||
}
|
||||
|
||||
|
@ -255,8 +255,6 @@ protected:
|
||||
Maybe<AutoEntryScript> mAutoEntryScript;
|
||||
Maybe<AutoIncumbentScript> mAutoIncumbentScript;
|
||||
|
||||
// Constructed the rooter within the scope of mCxPusher above, so that it's
|
||||
// always within a request during its lifetime.
|
||||
Maybe<JS::Rooted<JSObject*> > mRootedCallable;
|
||||
|
||||
// Members which are used to set the async stack.
|
||||
|
Loading…
Reference in New Issue
Block a user