Closed
Bug 609139
Opened 15 years ago
Closed 15 years ago
QueryInterfaced objects forget some interfaces when they cross compartments
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta8+ |
People
(Reporter: Mardak, Assigned: mrbkap)
References
Details
(Keywords: regression)
Attachments
(1 file)
1.91 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
If I do the following from the error console, it correctly reports nsPIPlacesDatabase:
const {utils: Cu} = Components;
Cu.import("resource://services-sync/util.js");
Cu.reportError(Svc.History);
[xpconnect wrapped (nsISupports, nsINavHistoryService, nsIGlobalHistory3, nsIGlobalHistory2, nsIDownloadHistory, nsIBrowserHistory, nsPIPlacesDatabase)]
However, if I do that from a restartless add-on, it doesn't have nsPIPlacesDatabase without first QIing it:
const {interfaces: Ci, utils: Cu} = Components;
function startup() {
Cu.import("resource://services-sync/util.js");
Cu.reportError(Svc.History);
Cu.reportError(Svc.History.QueryInterface(Ci.nsPIPlacesDatabase));
Cu.reportError(Svc.History);
}
[xpconnect wrapped (nsISupports, nsINavHistoryService, nsIGlobalHistory3, nsIGlobalHistory2, nsIDownloadHistory, nsIBrowserHistory)]
[xpconnect wrapped (nsISupports, nsINavHistoryService, nsIGlobalHistory3, nsIGlobalHistory2, nsIDownloadHistory, nsIBrowserHistory, nsPIPlacesDatabase)]
[xpconnect wrapped (nsISupports, nsINavHistoryService, nsIGlobalHistory3, nsIGlobalHistory2, nsIDownloadHistory, nsIBrowserHistory, nsPIPlacesDatabase)]
Reporter | ||
Comment 1•15 years ago
|
||
Seems to be m-c only:
1101 ok http://hg.mozilla.org/tracemonkey/rev/7af31ff1e9f5
1102 ok http://hg.mozilla.org/tracemonkey/rev/b71e965f4093
1101 ok http://hg.mozilla.org/mozilla-central/rev/f4ea6992e1c6
1102 bad http://hg.mozilla.org/mozilla-central/rev/45d6a73ef138
http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=f4ea6992e1c6&tochange=45d6a73ef138
Reporter | ||
Comment 2•15 years ago
|
||
Reporter | ||
Comment 3•15 years ago
|
||
Testing without the restartless addon:
var {classes: Cc, interfaces: Ci, utils: Cu} = Components; expr = "Components.utils.import('resource://services-sync/util.js'); Svc.History"; [Cu.evalInSandbox(expr, Cu.Sandbox(Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal))).toString(), eval(expr)].join("\n")
Assignee | ||
Comment 4•15 years ago
|
||
This won't be fixed for beta7. The problem is that we have some code to rewrap wrapped natives as they cross compartment boundaries, and two wrapped natives for the same native object don't necessarily share the same interface list. The proper way to fix this is to merge the two wrapped natives' sets when we rewrap.
blocking2.0: --- → ?
Updated•15 years ago
|
blocking2.0: ? → beta8+
Summary: QueryInterfaced objects forget some interfaces in restartless add-ons → QueryInterfaced objects forget some interfaces when they cross compartments
Assignee | ||
Comment 5•15 years ago
|
||
Rather than do the "merge", this just uses the passed-in wrapped native's sets in more cases. This could have unexpected behavior if the wrapped native on the other side of the conversion here was QI'd to a different set of interfaces, but I hope that would be a pretty rare case.
Updated•15 years ago
|
Attachment #489070 -
Flags: review?(jst) → review+
Assignee | ||
Comment 6•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•