Bug 1474541 part 1 - Unwrap the object passed to AutoEntryScript in nsFrameMessageManager::ReceiveMessage. r=bz

This commit is contained in:
Jan de Mooij 2018-07-25 10:42:27 +02:00
parent 98cb122caa
commit c13f61a442

View File

@ -746,9 +746,15 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget,
continue;
}
AutoEntryScript aes(object, "message manager handler");
AutoEntryScript aes(js::UncheckedUnwrap(object), "message manager handler");
JSContext* cx = aes.cx();
// We passed the unwrapped object to AutoEntryScript so we now need to
// enter the (maybe wrapper) object's realm. We will have to revisit this
// later because CCWs are not associated with a single realm so this
// doesn't make much sense. See bug 1477923.
JSAutoRealm ar(cx, object);
RootedDictionary<ReceiveMessageArgument> argument(cx);
JS::Rooted<JSObject*> cpows(cx);