Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 : * vim: set ts=4 sw=4 et tw=80:
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/. */
7 :
8 : #ifndef mozilla_jsipc_WrapperAnswer_h_
9 : #define mozilla_jsipc_WrapperAnswer_h_
10 :
11 : #include "JavaScriptShared.h"
12 :
13 : namespace mozilla {
14 :
15 : namespace dom {
16 : class AutoJSAPI;
17 : } // namespace dom
18 :
19 : namespace jsipc {
20 :
21 3 : class WrapperAnswer : public virtual JavaScriptShared
22 : {
23 : public:
24 : bool RecvPreventExtensions(const ObjectId& objId, ReturnStatus* rs);
25 : bool RecvGetPropertyDescriptor(const ObjectId& objId, const JSIDVariant& id,
26 : ReturnStatus* rs,
27 : PPropertyDescriptor* out);
28 : bool RecvGetOwnPropertyDescriptor(const ObjectId& objId,
29 : const JSIDVariant& id,
30 : ReturnStatus* rs,
31 : PPropertyDescriptor* out);
32 : bool RecvDefineProperty(const ObjectId& objId, const JSIDVariant& id,
33 : const PPropertyDescriptor& flags, ReturnStatus* rs);
34 : bool RecvDelete(const ObjectId& objId, const JSIDVariant& id, ReturnStatus* rs);
35 :
36 : bool RecvHas(const ObjectId& objId, const JSIDVariant& id,
37 : ReturnStatus* rs, bool* foundp);
38 : bool RecvHasOwn(const ObjectId& objId, const JSIDVariant& id,
39 : ReturnStatus* rs, bool* foundp);
40 : bool RecvGet(const ObjectId& objId, const JSVariant& receiverVar,
41 : const JSIDVariant& id,
42 : ReturnStatus* rs, JSVariant* result);
43 : bool RecvSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
44 : const JSVariant& receiverVar, ReturnStatus* rs);
45 :
46 : bool RecvIsExtensible(const ObjectId& objId, ReturnStatus* rs,
47 : bool* result);
48 : bool RecvCallOrConstruct(const ObjectId& objId, InfallibleTArray<JSParam>&& argv,
49 : const bool& construct, ReturnStatus* rs, JSVariant* result,
50 : nsTArray<JSParam>* outparams);
51 : bool RecvHasInstance(const ObjectId& objId, const JSVariant& v, ReturnStatus* rs, bool* bp);
52 : bool RecvGetBuiltinClass(const ObjectId& objId, ReturnStatus* rs,
53 : uint32_t* classValue);
54 : bool RecvIsArray(const ObjectId& objId, ReturnStatus* rs, uint32_t* ans);
55 : bool RecvClassName(const ObjectId& objId, nsCString* result);
56 : bool RecvGetPrototype(const ObjectId& objId, ReturnStatus* rs, ObjectOrNullVariant* result);
57 : bool RecvGetPrototypeIfOrdinary(const ObjectId& objId, ReturnStatus* rs, bool* isOrdinary,
58 : ObjectOrNullVariant* result);
59 : bool RecvRegExpToShared(const ObjectId& objId, ReturnStatus* rs, nsString* source, uint32_t* flags);
60 :
61 : bool RecvGetPropertyKeys(const ObjectId& objId, const uint32_t& flags,
62 : ReturnStatus* rs, nsTArray<JSIDVariant>* ids);
63 : bool RecvInstanceOf(const ObjectId& objId, const JSIID& iid,
64 : ReturnStatus* rs, bool* instanceof);
65 : bool RecvDOMInstanceOf(const ObjectId& objId, const int& prototypeID, const int& depth,
66 : ReturnStatus* rs, bool* instanceof);
67 :
68 : bool RecvDropObject(const ObjectId& objId);
69 :
70 : private:
71 : bool fail(dom::AutoJSAPI& jsapi, ReturnStatus* rs);
72 : bool ok(ReturnStatus* rs);
73 : bool ok(ReturnStatus* rs, const JS::ObjectOpResult& result);
74 : bool deadCPOW(dom::AutoJSAPI& jsapi, ReturnStatus* rs);
75 : };
76 :
77 : } // namespace jsipc
78 : } // namespace mozilla
79 :
80 : #endif
|