Changes

Jump to: navigation, search

IPDL/Five minute example

1,412 bytes added, 22:21, 13 July 2009
Create the subprocess and "child main thread" classes
It's a good idea to check now that everything compiles.
== Create the subprocess class == Create the files <code>ipc/test-harness/TestProcessParent.h</code> and <code>ipc/test-harness/TestProcessParent.cpp</code> with the following content.  // TestProcessParent.h #ifndef mozilla_test_TestProcessParent_h #define mozilla_test_TestProcessParent_h 1 #include "mozilla/ipc/GeckoChildProcessHost.h" namespace mozilla { namespace test { class TestProcessParent : mozilla::ipc::GeckoChildProcessHost { public: TestProcessParent(); ~TestProcessParent(); /** * Asynchronously launch the plugin process. */ // Could override parent Launch, but don't need to here //bool Launch(); private: DISALLOW_EVIL_CONSTRUCTORS(TestProcessParent); }; } // namespace plugins } // namespace mozilla #endif // ifndef mozilla_test_TestProcessParent_h  // TestProcessParent.cpp #include "child main threadmozilla/test/TestProcessParent.h" classes == using mozilla::ipc::GeckoChildProcessHost; namespace mozilla { namespace test { TestProcessParent::TestProcessParent() : GeckoChildProcessHost(GeckoChildProcess_TestHarness) { } TestProcessParent::~TestProcessParent() { } } // namespace test } // namespace mozilla Now open <code>nsXULAppAPI.h</code> and add the new value <code>GeckoChildProcess_TestHarness</code> to the enumeration <code>GeckoChildProcessType</code>. (Yes, this sucks. Sorry.) Hook this new code into your build system and verify that everything still compiles.
Confirm
699
edits

Navigation menu