IPDL/Five minute example: Difference between revisions

Jump to navigation Jump to search
no edit summary
mNo edit summary
No edit summary
Line 5: Line 5:
Put this in the file <code>ipc/ipdl/test-harness/Test.ipdl</code>.
Put this in the file <code>ipc/ipdl/test-harness/Test.ipdl</code>.


namespace mozilla {
namespace test {
  sync protocol Test
  sync protocol Test
  {
  {
Line 39: Line 42:
     send TellValues goto HAVE_VALUES;
     send TellValues goto HAVE_VALUES;
  };
  };
} // namespace test
} // namespace mozilla


== Hook the IPDL file into our build system ==
== Hook the IPDL file into our build system ==
Line 48: Line 54:
   Test.ipdl \
   Test.ipdl \
   $(NULL)
   $(NULL)
== Create the C++ implementation stubs ==
* 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>
Confirmed users
699

edits

Navigation menu