Bug 1176214 - Part 13: Changes to ipc. r=mrbkap

--HG--
extra : rebase_source : 1ee26bdb0e97b0a494bcc0c534f322d53be85b4e
This commit is contained in:
Lars T Hansen 2015-11-30 08:58:54 +01:00
parent 49063542c0
commit 41a444a198

View File

@ -206,9 +206,18 @@ RilConsumer::Send(JSContext* aCx, const CallArgs& aArgs)
return NS_ERROR_FAILURE;
}
AutoCheckCannotGC nogc;
size_t size = JS_GetTypedArrayByteLength(obj);
void* data = JS_GetArrayBufferViewData(obj, nogc);
bool isShared;
void* data;
{
AutoCheckCannotGC nogc;
data = JS_GetArrayBufferViewData(obj, &isShared, nogc);
}
if (isShared) {
JS_ReportError(
aCx, "Incorrect argument. Shared memory not supported");
return NS_ERROR_FAILURE;
}
raw = new UnixSocketRawData(data, size);
} else {
JS_ReportError(
@ -241,8 +250,10 @@ RilConsumer::Receive(JSContext* aCx,
}
{
AutoCheckCannotGC nogc;
memcpy(JS_GetArrayBufferViewData(array, nogc),
bool isShared;
memcpy(JS_GetArrayBufferViewData(array, &isShared, nogc),
aBuffer->GetData(), aBuffer->GetSize());
MOZ_ASSERT(!isShared); // Array was constructed above.
}
AutoValueArray<2> args(aCx);