bool SharedMemory::Handle::decode(CoreIPC::ArgumentDecoder& decoder, Handle& handle) { ASSERT_ARG(handle, !handle.m_size); ASSERT_ARG(handle, handle.isNull()); CoreIPC::Attachment attachment; if (!decoder.decode(attachment)) return false; handle.adoptFromAttachment(attachment.releaseFileDescriptor(), attachment.size()); return true; }
bool UpdateChunk::decode(CoreIPC::ArgumentDecoder& decoder, UpdateChunk& chunk) { IntRect rect; if (!decoder.decode(rect)) return false; chunk.m_rect = rect; CoreIPC::Attachment attachment; if (!decoder.decode(attachment)) return false; chunk.m_size = attachment.size(); chunk.m_data = reinterpret_cast<uint8_t*>(attachment.address()); return true; }