Bug 1434384 - Mark v1 structured clone data as cross-process. r=jorendorff, a=RyanVM

--HG--
extra : source : d85679eb427513cb18650f3d4e7d37a6ccbefbab
extra : intermediate-source : 5c286cc709dfcaca7269b88516e6f71626c98496
This commit is contained in:
Steve Fink 2018-01-05 14:37:47 -08:00 committed by Roy Tam
commit 1baa793518

View file

@ -2188,12 +2188,14 @@ JSStructuredCloneReader::readHeader()
return in.reportTruncated();
if (tag != SCTAG_HEADER) {
// Old structured clone buffer. We must have read it from disk or
// somewhere, so we can assume it's scope-compatible.
// Old structured clone buffer. We must have read it from disk.
storedScope = JS::StructuredCloneScope::DifferentProcess;
return true;
}
MOZ_ALWAYS_TRUE(in.readPair(&tag, &data));
storedScope = JS::StructuredCloneScope(data);
if (data != uint32_t(JS::StructuredCloneScope::SameProcessSameThread) &&
data != uint32_t(JS::StructuredCloneScope::SameProcessDifferentThread) &&
data != uint32_t(JS::StructuredCloneScope::DifferentProcess))
@ -2202,7 +2204,6 @@ JSStructuredCloneReader::readHeader()
"invalid structured clone scope");
return false;
}
storedScope = JS::StructuredCloneScope(data);
if (storedScope < allowedScope) {
JS_ReportErrorNumberASCII(context(), GetErrorMessage, nullptr, JSMSG_SC_BAD_SERIALIZED_DATA,
"incompatible structured clone scope");