mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 10:00:54 +00:00
Bug 1268938 - Use the name of the original message in Send for reply telemetry. r=billm
aReply usually won't have a name properly set, but aMsg does. To avoid accessing aMsg after it dies, copy the pointer to the name.
This commit is contained in:
parent
6197796b59
commit
56f812a0d5
@ -1158,6 +1158,9 @@ MessageChannel::Send(Message* aMsg, Message* aReply)
|
||||
|
||||
IPC_LOG("Send seqno=%d, xid=%d", seqno, transaction);
|
||||
|
||||
// msg will be destroyed soon, but name() is not owned by msg.
|
||||
const char* msgName = msg->name();
|
||||
|
||||
mLink->SendMessage(msg.forget());
|
||||
|
||||
while (true) {
|
||||
@ -1246,7 +1249,7 @@ MessageChannel::Send(Message* aMsg, Message* aReply)
|
||||
*aReply = Move(*reply);
|
||||
if (aReply->capacity() >= kMinTelemetryMessageSize) {
|
||||
Telemetry::Accumulate(Telemetry::IPC_REPLY_SIZE,
|
||||
nsDependentCString(aReply->name()), aReply->capacity());
|
||||
nsDependentCString(msgName), aReply->capacity());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user