Bumping manifests a=b2g-bump
[gecko.git] / ipc / testshell / TestShellParent.h
blob40e29dd36785e7d10113fd57a6c6ee0678b2f141
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=8 et :
3 */
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"
16 #include "nsString.h"
18 namespace mozilla {
20 namespace ipc {
22 class TestShellCommandParent;
24 class TestShellParent : public PTestShellParent
26 public:
27 virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
29 PTestShellCommandParent*
30 AllocPTestShellCommandParent(const nsString& aCommand);
32 bool
33 DeallocPTestShellCommandParent(PTestShellCommandParent* aActor);
35 bool
36 CommandDone(TestShellCommandParent* aActor, const nsString& aResponse);
40 class TestShellCommandParent : public PTestShellCommandParent
42 public:
43 TestShellCommandParent() {}
45 bool SetCallback(JSContext* aCx, JS::Value aCallback);
47 bool RunCallback(const nsString& aResponse);
49 void ReleaseCallback();
51 protected:
52 bool ExecuteCallback(const nsString& aResponse);
54 void ActorDestroy(ActorDestroyReason why);
56 bool Recv__delete__(const nsString& aResponse) {
57 return ExecuteCallback(aResponse);
60 private:
61 nsAutoJSValHolder mCallback;
65 } /* namespace ipc */
66 } /* namespace mozilla */
68 #endif /* ipc_testshell_TestShellParent_h */