Bug 1176034 - MessagePort should force a close() if the structured clone algorithm fails, r=bent

This commit is contained in:
Andrea Marchesini
2015-06-23 15:50:00 -07:00
parent 0f4cbeab2c
commit d720e96813
14 changed files with 213 additions and 4 deletions

View File

@@ -238,7 +238,13 @@ PostMessageEvent::FreeTransferStructuredClone(uint32_t aTag,
uint64_t aExtraData,
void* aClosure)
{
// Nothing to do.
if (aTag == SCTAG_DOM_MAP_MESSAGEPORT) {
MOZ_ASSERT(aClosure);
MOZ_ASSERT(!aContent);
StructuredCloneInfo* scInfo = static_cast<StructuredCloneInfo*>(aClosure);
MessagePort::ForceClose(scInfo->event->GetPortIdentifier(aExtraData));
}
}
PostMessageEvent::PostMessageEvent(nsGlobalWindow* aSource,