1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef ipc_testshell_TestShellParent_h
9 #define ipc_testshell_TestShellParent_h 1
11 #include "mozilla/ipc/PTestShellParent.h"
12 #include "mozilla/ipc/PTestShellCommandParent.h"
14 #include "js/TypeDecls.h"
15 #include "nsAutoJSValHolder.h"
22 class TestShellCommandParent
;
24 class TestShellParent
: public PTestShellParent
27 virtual void ActorDestroy(ActorDestroyReason aWhy
) MOZ_OVERRIDE
;
29 PTestShellCommandParent
*
30 AllocPTestShellCommandParent(const nsString
& aCommand
);
33 DeallocPTestShellCommandParent(PTestShellCommandParent
* aActor
);
36 CommandDone(TestShellCommandParent
* aActor
, const nsString
& aResponse
);
40 class TestShellCommandParent
: public PTestShellCommandParent
43 TestShellCommandParent() {}
45 bool SetCallback(JSContext
* aCx
, JS::Value aCallback
);
47 bool RunCallback(const nsString
& aResponse
);
49 void ReleaseCallback();
52 bool ExecuteCallback(const nsString
& aResponse
);
54 void ActorDestroy(ActorDestroyReason why
);
56 bool Recv__delete__(const nsString
& aResponse
) {
57 return ExecuteCallback(aResponse
);
61 nsAutoJSValHolder mCallback
;
66 } /* namespace mozilla */
68 #endif /* ipc_testshell_TestShellParent_h */