Lines Matching defs:header
34 static_assert(IsAlignedForChannelMessage(sizeof(Channel::Message::Header)),
35 "Invalid Header size.");
41 offsetof(Channel::Message::Header, num_bytes),
42 "num_bytes should be at the same offset in both Header structs.");
44 offsetof(Channel::Message::Header, message_type),
45 "message_type should be at the same offset in both Header "
73 // On Windows we serialize HANDLEs into the extra header space.
85 // Pad extra header data to be aliged to |kChannelMessageAlignment| bytes.
92 is_legacy_message ? sizeof(LegacyHeader) : sizeof(Header);
98 // Only zero out the header and not the payload. Since the payload is going to
115 header()->num_header_bytes =
156 const Header* header = nullptr;
158 header = reinterpret_cast<const Header*>(data);
163 if (!header) {
167 if (header->num_bytes < header->num_header_bytes ||
168 header->num_header_bytes < sizeof(Header)) {
169 DLOG(ERROR) << "Decoding invalid message: " << header->num_bytes << " < "
170 << header->num_header_bytes;
173 extra_header_size = header->num_header_bytes - sizeof(Header);
174 payload_size = data_num_bytes - header->num_header_bytes;
175 payload = static_cast<const char*>(data) + header->num_header_bytes;
197 header ? header->num_handles : legacy_header->num_handles;
212 if (header) {
214 DCHECK_EQ(message->header()->num_header_bytes, header->num_header_bytes);
217 // Copy extra header bytes.
219 static_cast<const char*>(data) + sizeof(Header),
222 message->header()->num_handles = header->num_handles;
241 return data_ + sizeof(Header);
246 return data_ + sizeof(Header);
250 return header()->num_header_bytes - sizeof(Header);
256 return data_ + header()->num_header_bytes;
262 return data_ + header()->num_header_bytes;
268 return size_ - header()->num_header_bytes;
273 : header()->num_handles;
278 : header()->num_handles) > 0;
304 Channel::Message::Header* Channel::Message::header() const {
306 return reinterpret_cast<Header*>(data_);
327 header()->num_handles = static_cast<uint16_t>(new_handles->size());
369 header()->num_handles = 0;
604 const Message::Header* header = nullptr;
606 header = reinterpret_cast<const Message::Header*>(legacy_header);
613 if (header) {
614 if (header->num_header_bytes < sizeof(Message::Header) ||
615 header->num_header_bytes > header->num_bytes) {
616 LOG(ERROR) << "Invalid message header size: "
617 << header->num_header_bytes;
620 extra_header_size = header->num_header_bytes - sizeof(Message::Header);
621 extra_header = extra_header_size ? header + 1 : nullptr;
622 payload_size = header->num_bytes - header->num_header_bytes;
624 ? reinterpret_cast<Message::Header*>(
626 header->num_header_bytes)
636 header ? header->num_handles : legacy_header->num_handles;