IPDL constructors... pre-created object
Benjamin Smedberg <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
Currently when client code calls an IPDL constructor, it uses:
ProtocolParent->CallSubProtocolConstructor(...);
Internally, this will call a virtual function to create a new
SubProtocolParent object:
ProtocolParent::SubProtocolConstructor(...)
{
return new SubProtocolParent(...);
}
When *receiving* a constructor function, I understand that it is necessary
to have the pure-virtual constructor. But when *calling* a constructor, I'd
prefer to pre-create the parent. This would involve a change to the
CallSubProtocolConstructor signature:
ToplevelProtocolParent::CallSubProtocolConstructor(SubprotocolProtocolParent*,
args...);
I specifically want to do this because I need to create the subprotocol
parent with extra private data... data which is not being sent across the
wire in the IPC message, but is stored as a member in the SubprotocolParent
class.
Chris, does this sound like a reasonable change?
--BDS