1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "TestShellChild.h"
7 using mozilla::ipc::TestShellChild
;
8 using mozilla::ipc::PTestShellCommandChild
;
9 using mozilla::ipc::XPCShellEnvironment
;
11 TestShellChild::TestShellChild()
12 : mXPCShell(XPCShellEnvironment::CreateEnvironment())
17 TestShellChild::RecvExecuteCommand(const nsString
& aCommand
)
19 if (mXPCShell
->IsQuitting()) {
20 NS_WARNING("Commands sent after quit command issued!");
24 return mXPCShell
->EvaluateString(aCommand
);
27 PTestShellCommandChild
*
28 TestShellChild::AllocPTestShellCommandChild(const nsString
& aCommand
)
30 return new PTestShellCommandChild();
34 TestShellChild::DeallocPTestShellCommandChild(PTestShellCommandChild
* aCommand
)
41 TestShellChild::RecvPTestShellCommandConstructor(PTestShellCommandChild
* aActor
,
42 const nsString
& aCommand
)
44 if (mXPCShell
->IsQuitting()) {
45 NS_WARNING("Commands sent after quit command issued!");
50 if (!mXPCShell
->EvaluateString(aCommand
, &response
)) {
54 return PTestShellCommandChild::Send__delete__(aActor
, response
);