Bug 996785 - Distinguish local and remote CPOW objects in IPDL (r=mrbkap)

This commit is contained in:
Bill McCloskey
2014-05-16 16:40:36 -07:00
parent 94e25e7956
commit 648513711d
7 changed files with 69 additions and 52 deletions

View File

@@ -103,18 +103,8 @@ class JavaScriptShared
bool convertIdToGeckoString(JSContext *cx, JS::HandleId id, nsString *to);
bool convertGeckoStringToId(JSContext *cx, const nsString &from, JS::MutableHandleId id);
virtual bool toId(JSContext *cx, JSObject *obj, ObjectId *idp) = 0;
virtual JSObject *fromId(JSContext *cx, ObjectId id) = 0;
bool fromId(JSContext *cx, ObjectId id, JS::MutableHandle<JSObject*> objp) {
if (!id) {
objp.set(nullptr);
return true;
}
objp.set(fromId(cx, id));
return bool(objp.get());
}
virtual bool toObjectVariant(JSContext *cx, JSObject *obj, ObjectVariant *objVarp) = 0;
virtual JSObject *fromObjectVariant(JSContext *cx, ObjectVariant objVar) = 0;
static void ConvertID(const nsID &from, JSIID *to);
static void ConvertID(const JSIID &from, nsID *to);