diff options
author | erikchen <erikchen@chromium.org> | 2015-11-04 15:15:57 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-04 23:16:51 +0000 |
commit | adfa92002af95610209d9cbde77f5b890e4331d7 (patch) | |
tree | ecf5b0b80a9f2e3ed28e1d0c51baa884c89c1175 /ipc | |
parent | 60af903f03fd95fa15a684659b302c4a14b7b8cd (diff) | |
download | chromium_src-adfa92002af95610209d9cbde77f5b890e4331d7.zip chromium_src-adfa92002af95610209d9cbde77f5b890e4331d7.tar.gz chromium_src-adfa92002af95610209d9cbde77f5b890e4331d7.tar.bz2 |
ipc: Add more UMA metrics for AttachmentBrokerUnprivileged.
BUG=NONE
Review URL: https://codereview.chromium.org/1419203006
Cr-Commit-Position: refs/heads/master@{#357925}
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/attachment_broker_unprivileged.h | 4 | ||||
-rw-r--r-- | ipc/attachment_broker_unprivileged_mac.cc | 4 |
2 files changed, 7 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); |