IPDL/Getting started: Difference between revisions

Jump to navigation Jump to search
Line 180: Line 180:
     '''virtual''' '''void''' RecvFoo('''const''' '''int'''& paramter) = 0;
     '''virtual''' '''void''' RecvFoo('''const''' '''int'''& paramter) = 0;


The IPDL compiler has a set of "builtin" types for which library code exists to serialize and deserialize parameters of that type.  These builtin types include the C/C++ integer types (bool, char, int, ..., int8_t, uint16_t, ...), a string type (<code>String</code> in IPDL), and some array types (<code>StringArray</code>, for example).  These builtin types are in flux and will certainly be expanded.  The most up-to-date reference for builtins is the file <code>ipc/glue/MessageTypes.h</code>.
The IPDL compiler has a set of "builtin" types for which library code exists to serialize and deserialize parameters of that type.  These builtin types include the C/C++ integer types (bool, char, int, ..., int8_t, uint16_t, ...), a string type (<code>nsString</code> in IPDL), and some array types (<code>nsTArray<nsString></code>, for example).  These builtin types are in flux and will certainly be expanded.   


The builtin types are insufficient for all protocols.  When you need to send data of type other than one built into IPDL, you can add a <code>'''using'''</code> declaration of the type in an IPDL specification, and in C++ define your own data serializer and deserializer.  The details of this are beyond the scope of this document; see <code>dom/plugins/NPAPI.ipdl</code> and <code>dom/plugins/PluginMessageUtils.h</code> for examples of how this is done.
The builtin types are insufficient for all protocols.  When you need to send data of type other than one built into IPDL, you can add a <code>'''using'''</code> declaration of the type in an IPDL specification, and in C++ define your own data serializer and deserializer.  The details of this are beyond the scope of this document; see <code>dom/plugins/NPAPI.ipdl</code> and <code>dom/plugins/PluginMessageUtils.h</code> for examples of how this is done.
Confirmed users
157

edits

Navigation menu