2014-05-17 03:40:36 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: set ts=4 sw=4 et tw=80:
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_jsipc_WrapperAnswer_h_
|
|
|
|
#define mozilla_jsipc_WrapperAnswer_h_
|
|
|
|
|
|
|
|
#include "JavaScriptShared.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
2015-03-29 19:13:36 +03:00
|
|
|
|
|
|
|
namespace dom {
|
|
|
|
class AutoJSAPI;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
2015-03-29 19:13:36 +03:00
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
namespace jsipc {
|
|
|
|
|
|
|
|
class WrapperAnswer : public virtual JavaScriptShared
|
|
|
|
{
|
|
|
|
public:
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvPreventExtensions(const ObjectId& objId, ReturnStatus* rs);
|
|
|
|
bool RecvGetOwnPropertyDescriptor(const ObjectId& objId,
|
|
|
|
const JSIDVariant& id,
|
|
|
|
ReturnStatus* rs,
|
|
|
|
PPropertyDescriptor* out);
|
|
|
|
bool RecvDefineProperty(const ObjectId& objId, const JSIDVariant& id,
|
|
|
|
const PPropertyDescriptor& flags, ReturnStatus* rs);
|
|
|
|
bool RecvDelete(const ObjectId& objId, const JSIDVariant& id, ReturnStatus* rs);
|
2014-05-17 03:40:36 +04:00
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvHas(const ObjectId& objId, const JSIDVariant& id,
|
2015-05-12 22:05:50 +03:00
|
|
|
ReturnStatus* rs, bool* foundp);
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvHasOwn(const ObjectId& objId, const JSIDVariant& id,
|
2015-05-12 22:05:50 +03:00
|
|
|
ReturnStatus* rs, bool* foundp);
|
2015-09-18 01:14:41 +03:00
|
|
|
bool RecvGet(const ObjectId& objId, const JSVariant& receiverVar,
|
2015-03-29 01:22:11 +03:00
|
|
|
const JSIDVariant& id,
|
|
|
|
ReturnStatus* rs, JSVariant* result);
|
|
|
|
bool RecvSet(const ObjectId& objId, const JSIDVariant& id, const JSVariant& value,
|
|
|
|
const JSVariant& receiverVar, ReturnStatus* rs);
|
2014-05-17 03:40:36 +04:00
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvIsExtensible(const ObjectId& objId, ReturnStatus* rs,
|
|
|
|
bool* result);
|
|
|
|
bool RecvCallOrConstruct(const ObjectId& objId, InfallibleTArray<JSParam>&& argv,
|
|
|
|
const bool& construct, ReturnStatus* rs, JSVariant* result,
|
|
|
|
nsTArray<JSParam>* outparams);
|
|
|
|
bool RecvHasInstance(const ObjectId& objId, const JSVariant& v, ReturnStatus* rs, bool* bp);
|
2015-08-29 07:55:40 +03:00
|
|
|
bool RecvGetBuiltinClass(const ObjectId& objId, ReturnStatus* rs,
|
|
|
|
uint32_t* classValue);
|
2015-08-23 11:10:24 +03:00
|
|
|
bool RecvIsArray(const ObjectId& objId, ReturnStatus* rs, uint32_t* ans);
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvClassName(const ObjectId& objId, nsCString* result);
|
|
|
|
bool RecvGetPrototype(const ObjectId& objId, ReturnStatus* rs, ObjectOrNullVariant* result);
|
2016-02-24 00:42:30 +03:00
|
|
|
bool RecvGetPrototypeIfOrdinary(const ObjectId& objId, ReturnStatus* rs, bool* isOrdinary,
|
|
|
|
ObjectOrNullVariant* result);
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvRegExpToShared(const ObjectId& objId, ReturnStatus* rs, nsString* source, uint32_t* flags);
|
2014-05-17 03:40:36 +04:00
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvGetPropertyKeys(const ObjectId& objId, const uint32_t& flags,
|
|
|
|
ReturnStatus* rs, nsTArray<JSIDVariant>* ids);
|
|
|
|
bool RecvInstanceOf(const ObjectId& objId, const JSIID& iid,
|
|
|
|
ReturnStatus* rs, bool* instanceof);
|
|
|
|
bool RecvDOMInstanceOf(const ObjectId& objId, const int& prototypeID, const int& depth,
|
|
|
|
ReturnStatus* rs, bool* instanceof);
|
2014-05-17 03:40:36 +04:00
|
|
|
|
2015-03-29 01:22:11 +03:00
|
|
|
bool RecvDropObject(const ObjectId& objId);
|
2014-05-17 03:40:36 +04:00
|
|
|
|
|
|
|
private:
|
2015-03-29 19:13:36 +03:00
|
|
|
bool fail(dom::AutoJSAPI& jsapi, ReturnStatus* rs);
|
2015-03-29 01:22:11 +03:00
|
|
|
bool ok(ReturnStatus* rs);
|
|
|
|
bool ok(ReturnStatus* rs, const JS::ObjectOpResult& result);
|
2016-07-26 13:30:42 +03:00
|
|
|
bool deadCPOW(dom::AutoJSAPI& jsapi, ReturnStatus* rs);
|
2014-05-17 03:40:36 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace jsipc
|
|
|
|
} // namespace mozilla
|
2014-05-17 03:40:36 +04:00
|
|
|
|
|
|
|
#endif
|