Bug 1479645 - Don't unwrap CPOWs in middleman processes, r=mccr8.

This commit is contained in:
Brian Hackett
2018-07-31 19:30:02 +00:00
parent d2a5dc727f
commit 9155e432f9

View File

@@ -688,7 +688,12 @@ CrossProcessCpowHolder::~CrossProcessCpowHolder()
// the corresponding part of the CPOW in the other process
// will eventually be collected. The scope for this object
// doesn't really matter, because it immediately becomes
// garbage.
// garbage. Ignore this for middleman processes used when
// recording or replaying, as they do not have a CPOW manager
// and the message will also be received in the recording
// process.
if (recordreplay::IsMiddleman())
return;
AutoJSAPI jsapi;
if (!jsapi.Init(xpc::PrivilegedJunkScope()))
return;
@@ -713,6 +718,9 @@ bool
JavaScriptShared::Unwrap(JSContext* cx, const InfallibleTArray<CpowEntry>& aCpows,
JS::MutableHandleObject objp)
{
// Middleman processes never operate on CPOWs.
MOZ_ASSERT(!recordreplay::IsMiddleman());
objp.set(nullptr);
if (!aCpows.Length())