michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=4 sw=4 et tw=80: michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_jsipc_JavaScriptChild_h_ michael@0: #define mozilla_jsipc_JavaScriptChild_h_ michael@0: michael@0: #include "JavaScriptShared.h" michael@0: #include "mozilla/jsipc/PJavaScriptChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace jsipc { michael@0: michael@0: class JavaScriptChild michael@0: : public PJavaScriptChild, michael@0: public JavaScriptShared michael@0: { michael@0: public: michael@0: JavaScriptChild(JSRuntime *rt); michael@0: ~JavaScriptChild(); michael@0: michael@0: bool init(); michael@0: void trace(JSTracer *trc); michael@0: michael@0: bool RecvDropObject(const ObjectId &objId) MOZ_OVERRIDE; michael@0: michael@0: bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs) MOZ_OVERRIDE; michael@0: bool AnswerGetPropertyDescriptor(const ObjectId &objId, const nsString &id, michael@0: ReturnStatus *rs, michael@0: PPropertyDescriptor *out) MOZ_OVERRIDE; michael@0: bool AnswerGetOwnPropertyDescriptor(const ObjectId &objId, michael@0: const nsString &id, michael@0: ReturnStatus *rs, michael@0: PPropertyDescriptor *out) MOZ_OVERRIDE; michael@0: bool AnswerDefineProperty(const ObjectId &objId, const nsString &id, michael@0: const PPropertyDescriptor &flags, michael@0: ReturnStatus *rs) MOZ_OVERRIDE; michael@0: bool AnswerDelete(const ObjectId &objId, const nsString &id, michael@0: ReturnStatus *rs, bool *success) MOZ_OVERRIDE; michael@0: michael@0: bool AnswerHas(const ObjectId &objId, const nsString &id, michael@0: ReturnStatus *rs, bool *bp) MOZ_OVERRIDE; michael@0: bool AnswerHasOwn(const ObjectId &objId, const nsString &id, michael@0: ReturnStatus *rs, bool *bp) MOZ_OVERRIDE; michael@0: bool AnswerGet(const ObjectId &objId, const ObjectId &receiverId, michael@0: const nsString &id, michael@0: ReturnStatus *rs, JSVariant *result) MOZ_OVERRIDE; michael@0: bool AnswerSet(const ObjectId &objId, const ObjectId &receiverId, michael@0: const nsString &id, const bool &strict, michael@0: const JSVariant &value, ReturnStatus *rs, JSVariant *result) MOZ_OVERRIDE; michael@0: michael@0: bool AnswerIsExtensible(const ObjectId &objId, ReturnStatus *rs, michael@0: bool *result) MOZ_OVERRIDE; michael@0: bool AnswerCall(const ObjectId &objId, const nsTArray &argv, michael@0: ReturnStatus *rs, JSVariant *result, michael@0: nsTArray *outparams) MOZ_OVERRIDE; michael@0: bool AnswerObjectClassIs(const ObjectId &objId, const uint32_t &classValue, michael@0: bool *result) MOZ_OVERRIDE; michael@0: bool AnswerClassName(const ObjectId &objId, nsString *result) MOZ_OVERRIDE; michael@0: michael@0: bool AnswerGetPropertyNames(const ObjectId &objId, const uint32_t &flags, michael@0: ReturnStatus *rs, nsTArray *names) MOZ_OVERRIDE; michael@0: bool AnswerInstanceOf(const ObjectId &objId, const JSIID &iid, michael@0: ReturnStatus *rs, bool *instanceof) MOZ_OVERRIDE; michael@0: bool AnswerDOMInstanceOf(const ObjectId &objId, const int &prototypeID, const int &depth, michael@0: ReturnStatus *rs, bool *instanceof) MOZ_OVERRIDE; michael@0: michael@0: protected: michael@0: JSObject *unwrap(JSContext *cx, ObjectId id); michael@0: michael@0: private: michael@0: bool makeId(JSContext *cx, JSObject *obj, ObjectId *idp); michael@0: bool fail(JSContext *cx, ReturnStatus *rs); michael@0: bool ok(ReturnStatus *rs); michael@0: michael@0: private: michael@0: ObjectId lastId_; michael@0: JSRuntime *rt_; michael@0: ObjectIdCache ids_; michael@0: }; michael@0: michael@0: } // mozilla michael@0: } // jsipc michael@0: michael@0: #endif