Adding more detail to MessageQueue::Dispatch logging.
Every message will now be traced with the location from which it was
posted, including function name, file and line number.
This CL also writes a normal LOG message when the dispatch took more
than a certain amount of time (currently 50ms).
This logging should help us identify messages that are taking
longer than expected to be dispatched.
R=pthatcher@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2019423006 .
Cr-Commit-Position: refs/heads/master@{#13104}
diff --git a/webrtc/p2p/base/stunrequest.cc b/webrtc/p2p/base/stunrequest.cc
index 32449e2..5886cc9 100644
--- a/webrtc/p2p/base/stunrequest.cc
+++ b/webrtc/p2p/base/stunrequest.cc
@@ -49,9 +49,9 @@
request->Construct();
requests_[request->id()] = request;
if (delay > 0) {
- thread_->PostDelayed(delay, request, MSG_STUN_SEND, NULL);
+ thread_->PostDelayed(RTC_FROM_HERE, delay, request, MSG_STUN_SEND, NULL);
} else {
- thread_->Send(request, MSG_STUN_SEND, NULL);
+ thread_->Send(RTC_FROM_HERE, request, MSG_STUN_SEND, NULL);
}
}
@@ -60,7 +60,7 @@
StunRequest* request = kv.second;
if (msg_type == kAllRequests || msg_type == request->type()) {
thread_->Clear(request, MSG_STUN_SEND);
- thread_->Send(request, MSG_STUN_SEND, NULL);
+ thread_->Send(RTC_FROM_HERE, request, MSG_STUN_SEND, NULL);
}
}
}
@@ -220,7 +220,8 @@
manager_->SignalSendPacket(buf.Data(), buf.Length(), this);
OnSent();
- manager_->thread_->PostDelayed(resend_delay(), this, MSG_STUN_SEND, NULL);
+ manager_->thread_->PostDelayed(RTC_FROM_HERE, resend_delay(), this,
+ MSG_STUN_SEND, NULL);
}
void StunRequest::OnSent() {