summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipc/attachment_broker_unprivileged.h4
-rw-r--r--ipc/attachment_broker_unprivileged_mac.cc4
-rw-r--r--tools/metrics/histograms/histograms.xml3
3 files changed, 10 insertions, 1 deletions
diff --git a/ipc/attachment_broker_unprivileged.h b/ipc/attachment_broker_unprivileged.h
index 26cc1bf..178406a 100644
--- a/ipc/attachment_broker_unprivileged.h
+++ b/ipc/attachment_broker_unprivileged.h
@@ -37,7 +37,7 @@ class IPC_EXPORT AttachmentBrokerUnprivileged : public IPC::AttachmentBroker {
IPC::Sender* get_sender() { return sender_; }
// Errors that can be reported by subclasses.
- // These match tools/metrics/histograms.xml.
+ // These match tools/metrics/histograms/histograms.xml.
// This enum is append-only.
enum UMAError {
// The brokerable attachment was successfully processed.
@@ -45,6 +45,8 @@ class IPC_EXPORT AttachmentBrokerUnprivileged : public IPC::AttachmentBroker {
// The brokerable attachment's destination was not the process that received
// the attachment.
WRONG_DESTINATION = 1,
+ // An error occurred while trying to receive a Mach port with mach_msg().
+ ERR_RECEIVE_MACH_MESSAGE = 2,
ERROR_MAX
};
diff --git a/ipc/attachment_broker_unprivileged_mac.cc b/ipc/attachment_broker_unprivileged_mac.cc
index 2bba01d..31c4fc8 100644
--- a/ipc/attachment_broker_unprivileged_mac.cc
+++ b/ipc/attachment_broker_unprivileged_mac.cc
@@ -92,6 +92,10 @@ void AttachmentBrokerUnprivilegedMac::OnMachPortHasBeenDuplicated(
base::mac::ScopedMachReceiveRight message_port(wire_format.mach_port);
base::mac::ScopedMachSendRight memory_object(
ReceiveMachPort(message_port.get()));
+
+ LogError(memory_object.get() == MACH_PORT_NULL ? ERR_RECEIVE_MACH_MESSAGE
+ : SUCCESS);
+
IPC::internal::MachPortAttachmentMac::WireFormat translated_wire_format(
memory_object.release(), wire_format.destination_process,
wire_format.attachment_id);
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index d2e205d..d9d5ebb 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -64210,6 +64210,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
The brokerable attachment's destination was not the process that received
the attachment.
</int>
+ <int value="2" label="ERR_RECEIVE_MACH_MESSAGE">
+ An error occurred while trying to receive a Mach port with mach_msg().
+ </int>
</enum>
<enum name="IPPermissionStatus" type="int">