Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Unified Diff: util/mach/mach_message_util.cc

Issue 755313004: Pass Mach message trailers to server handler functions (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Address review feedback Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/mach_message_util.h ('k') | util/mach/mach_message_util_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/mach_message_util.cc
diff --git a/util/mach/mach_message_util.cc b/util/mach/mach_message_util.cc
index a1392fe01886f9bf7bb0b2d9b15a54bb6bb36b10..a6e61d1ed4fc012b13f6f35c9d7d68e6147ebf70 100644
--- a/util/mach/mach_message_util.cc
+++ b/util/mach/mach_message_util.cc
@@ -34,4 +34,11 @@ void SetMIGReplyError(mach_msg_header_t* out_header, kern_return_t error) {
reinterpret_cast<mig_reply_error_t*>(out_header)->RetCode = error;
}
+const mach_msg_trailer_t* MachMessageTrailerFromHeader(
+ const mach_msg_header_t* header) {
+ vm_address_t header_address = reinterpret_cast<vm_address_t>(header);
+ vm_address_t trailer_address = header_address + round_msg(header->msgh_size);
+ return reinterpret_cast<const mach_msg_trailer_t*>(trailer_address);
+}
+
} // namespace crashpad
« no previous file with comments | « util/mach/mach_message_util.h ('k') | util/mach/mach_message_util_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698