Closed
Bug 1131801
Opened 10 years ago
Closed 10 years ago
remove use of parent in XPCWrappedNative's RescueOrphans
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla38
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: sfink, Assigned: bzbarsky)
References
Details
Attachments
(3 files)
(deleted),
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
Split out from bug 805052, item 12: RescueOrphans in XPCWrappedNative, which has a cross-compartment wrapper as parent??
Assignee | ||
Comment 1•10 years ago
|
||
OK, so RescueOrphans is meant to deal with an XPCWrappedNative whose parent gets reparented.
For an XPCWrappedNative to have an interesting (non-global-object) parent, it needs to have a PreCreate hook.
We have the following PreCreate hooks in our codebase:
1) nsDOMConstructorSH::PreCreate, which calls nsDOMConstructor::PreCreate, which does SetParentToWindow(win, parentObj), so the parent always ends up being a window.
2) nsEventTargetSH::PreCreate which does:
*parentObj = native_parent ? native_parent->GetGlobalJSObject() : globalObj;
where native_parent is an nsIScriptGlobalObject and globalObj is the aGlobalObj that was passed in.
3) nsDOMClassInfo::PreCreate, which does "*parentObj = globalObj;".
4) ComponentsSH::PreCreate, which does:
*parentObj = self->GetScope()->GetGlobalJSObject();
5) BackstagePass::PreCreate which sets *parentObj to global->GetGlobalJSObject(), where global is an nsIGlobalObject.
That's it. So the parent always ends up being a global, and those of course never get reparented.
Given that, we can just kill off RescueOrphans entirely.
Assignee: nobody → bzbarsky
Assignee | ||
Comment 2•10 years ago
|
||
Attachment #8562984 -
Flags: review?(peterv)
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8562985 -
Flags: review?(peterv)
Assignee | ||
Comment 4•10 years ago
|
||
Attachment #8562986 -
Flags: review?(peterv)
Updated•10 years ago
|
Attachment #8562984 -
Flags: review?(peterv) → review+
Updated•10 years ago
|
Attachment #8562985 -
Flags: review?(peterv) → review+
Updated•10 years ago
|
Attachment #8562986 -
Flags: review?(peterv) → review+
Assignee | ||
Comment 5•10 years ago
|
||
Backed out in for bustage:
https://hg.mozilla.org/integration/mozilla-inbound/rev/945a30df1b0a
https://hg.mozilla.org/integration/mozilla-inbound/rev/238076a16f5a
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa2a3978652a
https://treeherder.mozilla.org/logviewer.html#?job_id=6597859&repo=mozilla-inbound
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 7•10 years ago
|
||
The problem was bug 1117242. Repushed:
https://hg.mozilla.org/integration/mozilla-inbound/rev/7a3153f07028
https://hg.mozilla.org/integration/mozilla-inbound/rev/9a66f24829d9
https://hg.mozilla.org/integration/mozilla-inbound/rev/af5f70c0286a
Flags: needinfo?(bzbarsky)
Comment 8•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/7a3153f07028
https://hg.mozilla.org/mozilla-central/rev/9a66f24829d9
https://hg.mozilla.org/mozilla-central/rev/af5f70c0286a
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•