10 Commits

Author SHA1 Message Date
Mark Mentovai
8f0636288a Use constexpr at namespace scope
This is essentially based on a search for “^const .*=”.

Change-Id: I9332c1f0cf7c891ba1ae373dc537f700f9a1d956
Reviewed-on: https://chromium-review.googlesource.com/585452
Reviewed-by: Leonard Mosescu <mosescu@chromium.org>
2017-07-29 01:06:52 +00:00
Mark Mentovai
6dac7ecdf5 Use constexpr at function scope
This is essentially based on a search for “^ *const [^*&]*=[^(]*$”

Change-Id: Id571119d0b9a64c6f387eccd51cea7c9eb530e13
Reviewed-on: https://chromium-review.googlesource.com/585555
Reviewed-by: Leonard Mosescu <mosescu@chromium.org>
2017-07-29 00:50:40 +00:00
Mark Mentovai
c39e4dc976 mac: Remove obsolete comment about mach_msg_header_t::msgh_reserved
mig-generated server dispatch routines used to not clear this field in
reply messages prepared from request messages. This oversight was
corrected in the migcom in bootstrap_cmds-96 (macOS 10.12 and Xcode
8.0). Maybe someone at Apple saw the admonishing comment that we had
left here. This comment can now be removed.

Change-Id: I73d965705a2ff5788afb59dd8ecdf4afe58ee47e
Reviewed-on: https://chromium-review.googlesource.com/465687
Reviewed-by: Robert Sesek <rsesek@chromium.org>
2017-04-03 15:55:30 +00:00
Mark Mentovai
062138106c mac: ChildPortHandshake: allow receive rights to be sent
The intended use is to flip the client-server relationship in
CrashpadClient so that the initial client (parent process) furnishes the
handler process with a receive right. The parent can optionally receive
a port-destroyed notification allowing it to restart the handler if it
exits prematurely.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1408473002 .
2015-10-29 14:14:15 -04:00
Mark Mentovai
4ff6c2d71f Remove #include "base/basictypes.h" as appropriate
These files were only using basictypes.h for implicit_cast, which moved
to util/misc/implicit_cast.h in 0b022d72a2a4.

R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/1352873002 .
2015-09-17 12:32:38 -04:00
Scott Graham
0b022d72a2 Include implicit_cast.h at all users of it.
The implicit_cast in base will be no more, make sure we have a reference
to the crashpad version at all callsites.

BUG=529769, 472900, crashpad:51
R=mark@chromium.org, scottmg@chromium.org

Review URL: https://codereview.chromium.org/1344683002 .
2015-09-14 14:51:05 -07:00
Mark Mentovai
5f19d639e1 handler/mac: Log a warning when an exception message has a suspicious
origin.

This adds AuditPIDFromMachMessageTrailer() to get the process ID of a
Mach message’s sender. Exception messages are considered suspicious when
not sent by the kernel or the exception process.

TEST=crashpad_util_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/1001943002
2015-03-12 14:00:38 -04:00
Mark Mentovai
c874958fd0 MachMessageServer: eliminate argument redundancy.
MachMessageServer::Run()’s distinct |nonblocking| parameter is removed.
The information it formerly conveyed is now implied by the |timeout_ms|
parameter, which can accept two special values,
kMachMessageTimeoutNonblocking and kMachMessageTimeoutWaitIndefinitely.

TEST=client_test, snapshot_test, util_test
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/777993002
2014-12-10 11:11:21 -05:00
Mark Mentovai
dce497446e Add MachMessageWithDeadline() and supporting characters.
MachMessageWithDeadline() is a mach_msg() wrapper that deals with
deadlines instead of timeouts. It is a slight simplification of the
mach_msg() interface because the deadline parameter implies the timeout
option bits, and because the caller does not need to specify send_size
during sends as the message itself already carries this information.

TEST=util_test MachMessage.MachMessageDeadlineFromTimeout
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/773943002
2014-12-02 17:09:08 -05:00
Mark Mentovai
c0d5d87785 Move mach_message_util.* to mach_message.*.
A subsequent change will add MachMessageWithDeadline(), a mach_msg()
wrapper. Conceptually, it makes sense to include that function in this
file family. Since this file family now contains a mach_msg() wrapper,
it makes sense to rename it mach_message and lose the _util suffix.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/772133004
2014-12-02 17:02:32 -05:00