/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file.
// Seek to the start of the footer, and read it in. We read in with a // duplicate of the iterator so we can use it to truncate later.
uint32_t offset = header()->payload_size - AlignInt(buffer_len);
PickleIterator footer_iter(*this); if (NS_WARN_IF(!IgnoreBytes(&footer_iter, offset))) { returnfalse;
}
PickleIterator read_iter(footer_iter); bool ok = ReadBytesInto(&read_iter, buffer, buffer_len);
// If requested, truncate the buffer to the start of the footer. if (truncate) {
Truncate(&footer_iter);
} return ok;
}
bool Message::WillBeRoutedExternally(
mojo::core::ports::UserMessageEvent& event) { if (!attached_ports_.IsEmpty()) { // Explicitly attach any ports which were attached to this Message to this // UserMessageEvent before we route it externally so that they can be // transferred correctly. These ports will be recovered if needed in // `GetMessage`.
MOZ_DIAGNOSTIC_ASSERT(
event.num_ports() == 0, "Must not have previously attached ports to the UserMessageEvent");
event.ReservePorts(attached_ports_.Length()); for (size_t i = 0; i < event.num_ports(); ++i) {
event.ports()[i] = attached_ports_[i].Release().name();
}
attached_ports_.Clear();
} returntrue;
}
void Message::AssertAsLargeAsHeader() const {
MOZ_DIAGNOSTIC_ASSERT(size() >= sizeof(Header));
MOZ_DIAGNOSTIC_ASSERT(CurrentSize() >= sizeof(Header)); // Our buffers should agree with what our header specifies.
MOZ_DIAGNOSTIC_ASSERT(size() == CurrentSize());
}
} // namespace IPC
Messung V0.5
¤ Dauer der Verarbeitung: 0.0 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.