Implement CPOW support in MessageManager (bug 870180, r=smaug,billm).
This commit is contained in:
@@ -21,6 +21,24 @@ namespace jsipc {
|
||||
|
||||
typedef uint64_t ObjectId;
|
||||
|
||||
class JavaScriptShared;
|
||||
|
||||
class CpowIdHolder : public CpowHolder
|
||||
{
|
||||
public:
|
||||
CpowIdHolder(JavaScriptShared *js, const InfallibleTArray<CpowEntry> &cpows)
|
||||
: js_(js),
|
||||
cpows_(cpows)
|
||||
{
|
||||
}
|
||||
|
||||
bool ToObject(JSContext *cx, JSObject **objp);
|
||||
|
||||
private:
|
||||
JavaScriptShared *js_;
|
||||
const InfallibleTArray<CpowEntry> &cpows_;
|
||||
};
|
||||
|
||||
// Map ids -> JSObjects
|
||||
class ObjectStore
|
||||
{
|
||||
@@ -70,6 +88,9 @@ class JavaScriptShared
|
||||
static const uint32_t OBJECT_EXTRA_BITS = 1;
|
||||
static const uint32_t OBJECT_IS_CALLABLE = (1 << 0);
|
||||
|
||||
bool Unwrap(JSContext *cx, const InfallibleTArray<CpowEntry> &aCpows, JSObject **objp);
|
||||
bool Wrap(JSContext *cx, JS::HandleObject aObj, InfallibleTArray<CpowEntry> *outCpows);
|
||||
|
||||
protected:
|
||||
bool toVariant(JSContext *cx, jsval from, JSVariant *to);
|
||||
bool toValue(JSContext *cx, const JSVariant &from, JS::MutableHandleValue to);
|
||||
|
||||
Reference in New Issue
Block a user