Closed Bug 1622887 Opened 5 years ago Closed 5 years ago

Properly support js components implementing an [optional] out nsISupports

Categories

(Core :: XPConnect, defect)

defect
Not set
normal
Points:
3

Tracking

()

RESOLVED FIXED
mozilla76
Iteration:
76.1 - Mar 9 - Mar 22
Tracking Status
firefox76 --- fixed

People

(Reporter: mak, Assigned: mak)

References

Details

Attachments

(1 file)

In bug 1496578 I'm converting nsDefaultURIFixup to js, the idl contains a couple methods that take an [optional] out nsIInputStream aPostData parameter.

Most of the cpp callers just pass nullptr for the optional out parameter, and that works currently because we call cpp from cpp. Once I convert the component to JS, we cross xpconnect and it doesn't work, we crash in nsXPCWrappedJS::CallMethod when we try to ZeroValue the null pointer... After fixing that, we then fail when trying to convert object.value.

We could either:

  1. disallow [optional] out nsISupports
  2. force consumers to pass in a refcounted pointer even if this is optional
  3. properly support it

I have a patch for 3. but it's up for discussion.

Pushed by mak77@bonardo.net: https://hg.mozilla.org/integration/autoland/rev/330b0ebfad73 Properly support js components implementing an [optional] out nsISupports. r=nika
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: