Closed Bug 1572292 Opened 11 months ago Closed 11 months ago

Rewrite nsIHttpProtocolHandler::EnsureHSTSDataReadyNative() in XPIDL

Categories

(Core :: Networking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: ehsan, Assigned: kershaw)

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

I accidentally added a new IDL member after this line https://searchfox.org/mozilla-central/rev/9ae20497229225cb3fa729a787791f424ff8087b/netwerk/protocol/http/nsIHttpProtocolHandler.idl#74 and got crashes when accessing it from JS, because the vtable entrypoint for EnsureHSTSDataReadyNative() would be accessed instead, as the XPIDL compiler has no idea about this custom virtual function.

You can rewrite this in XPIDL like this:

  // at the top of the file
  native HSTSDataCallbackWrapperAlreadyAddRefed(already_AddRefed<mozilla::net::HSTSDataCallbackWrapper>);

  [noscript]
  void EnsureHSTSDataReadyNative(in HSTSDataCallbackWrapperAlreadyAddRefed aCallback);

That should give us the exact same C++ code and prevent this kind of problem from happening again.

What do you think, Kershaw?

Flags: needinfo?(kershaw)

Thanks for filing this bug.
I think your solution is better than what we have now.

Assignee: nobody → kershaw
Flags: needinfo?(kershaw)
Priority: -- → P2
Whiteboard: [necko-triaged]
Pushed by kjang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/028f522d1e6a
Rewrite EnsureHSTSDataReadyNative r=Ehsan
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.