Changes

Jump to: navigation, search

IPDL/Five minute example

238 bytes added, 18:23, 13 July 2009
no edit summary
This page walks you through the steps of creating an IPDL protocol and writing the C++ code that implements the required interfaces. This guide walks you through the steps taken to implement the testing code in <code>ipc/ipdl/test-harness</code>. You are encouraged to follow this guide step-by-step and change the code in <code>ipc/ipdl/test-harness</code> as you follow along.
== Write the IPDL specification ==
Put this in the file <code>ipc/ipdl/test-harness/Test.ipdl</code>.
namespace mozilla {
== Hook the IPDL file into our build system ==
* Add <code>ipc/ipdl/test-harness</code> to the IPDLDIRS variable in <code>ipc/ipdl/Makefile.in</code>* Create the file <code>ipc/ipdl/test-harness/ipdl.mk</code> and add the following text to it.
IPDLSRCS = \
* Run
ipc/ipdl/test-harness$ python ../ipdl.py -d /tmp Test.ipdl
* Open <code>/tmp/mozilla/test/TestProtocolParent.h</code>. Look for the text "Skeleton implementation of abstract actor class."
** copy the "Header file contents" into the file <code>ipc/ipdl/test-harness/TestParent.h</code>** copy the "C++ file contents" into <code>ipc/ipdl/test-harness/TestParent.cpp</code>
** globally replace the text <code>ActorImpl</code> with <code>TestParent</code> in both files.
** set up namespaces as you wish. The checked-in example puts TestParent in the mozilla::test namespace.
* Repeat the above step for <code>TestProtocolChild.h</code> and <code>TestChild.(h, cpp)</code>
 
== Hook the C++ stubs into your build configuration ==
 
This is beyond the scope of this guide. See <code>ipc/test-harness/Makefile.in</code> for an example.
 
It's a good idea to check now that everything compiles.
 
== Create the subprocess and "child main thread" classes ==
Confirm
699
edits

Navigation menu