Closed
Bug 197281
Opened 23 years ago
Closed 23 years ago
Introduction of XPCConvert::GetNativeInterfaceFromJSObject is causing problems
Categories
(Core :: XPConnect, defect)
Core
XPConnect
Tracking
()
VERIFIED
FIXED
People
(Reporter: dbradley, Assigned: dbradley)
Details
Attachments
(1 file)
|
3.94 KB,
patch
|
jst
:
review+
alecf
:
superreview+
|
Details | Diff | Splinter Review |
I created this and used it early on in the IDispatch code, but no longer use it.
Unfortunately this refactoring changed the exit paths to the
JSObject2NativeInterface function. So I'm going to back this out.
| Assignee | ||
Comment 1•23 years ago
|
||
| Assignee | ||
Comment 2•23 years ago
|
||
Oh, and I should have stated the behavior this resulted in. This was causing the
JSObject wrapping the native to get wrapped itself instead of bailing. For
instance in the case of document.appendChild(window);
The key is the identity->QueryInterface(*iid, dest)); call. In the current code,
this continues on into the next part of JSObject2NativeInterface. In the old
code, it returned regardless of success or failure from
JSObject2NativeInterface. That's not the only place either.
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•23 years ago
|
||
Comment on attachment 117151 [details] [diff] [review]
Back out GetNativeInterfaceFromJSObject
This patch is a pure diff between 1.78 and 1.79. But if there's anything a miss
in the old code I'll be happy to fix it.
Attachment #117151 -
Flags: superreview?(brendan)
Attachment #117151 -
Flags: review?(jst)
Comment 4•23 years ago
|
||
Comment on attachment 117151 [details] [diff] [review]
Back out GetNativeInterfaceFromJSObject
Just found a few nits:
+ if(wrappedNative->GetIID().Equals(*iid))
+ {
+ NS_ADDREF(iface);
+ *dest = iface;
+ return JS_TRUE;
+ }
+ else
+ return NS_SUCCEEDED(iface->QueryInterface(*iid, dest));
You could remove that else-after-return.
+ if(GetISupportsFromJSObject(cx, src, &iface))
+ {
+ if(iface)
+ return NS_SUCCEEDED(iface->QueryInterface(*iid, dest));
+ return JS_FALSE;
+
+ }
Remove that empty line after return JS_FALSE, or move the empty line above the
return.
r=jst
Attachment #117151 -
Flags: review?(jst) → review+
| Assignee | ||
Comment 5•23 years ago
|
||
Comment on attachment 117151 [details] [diff] [review]
Back out GetNativeInterfaceFromJSObject
Alec, could you sr this. This is just a simple backout of part of my IDispatch
code patch. The patch is just the diff between 1.78 and 1.79 for this file.
I'll address jst's points on check in.
Attachment #117151 -
Flags: superreview?(brendan) → superreview?(alecf)
Comment 6•23 years ago
|
||
Comment on attachment 117151 [details] [diff] [review]
Back out GetNativeInterfaceFromJSObject
sr=alecf
Attachment #117151 -
Flags: superreview?(alecf) → superreview+
| Assignee | ||
Comment 7•23 years ago
|
||
Patch checked in, with jst's nits addressed
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•