Index: webrtc/base/thread.h |
diff --git a/webrtc/base/thread.h b/webrtc/base/thread.h |
index 1afe9d5ebef17aca78fb460a3d5df012a61bcaa5..97e69415cd3dba6098c022edfd7968a705c7c357 100644 |
--- a/webrtc/base/thread.h |
+++ b/webrtc/base/thread.h |
@@ -151,7 +151,8 @@ class LOCKABLE Thread : public MessageQueue { |
// ProcessMessages occasionally. |
virtual void Run(); |
- virtual void Send(MessageHandler* phandler, |
+ virtual void Send(const Location& posted_from, |
+ MessageHandler* phandler, |
uint32_t id = 0, |
MessageData* pdata = NULL); |
@@ -159,15 +160,14 @@ class LOCKABLE Thread : public MessageQueue { |
// provide the |ReturnT| template argument, which cannot (easily) be deduced. |
// Uses Send() internally, which blocks the current thread until execution |
// is complete. |
- // Ex: bool result = thread.Invoke<bool>(&MyFunctionReturningBool); |
+ // Ex: bool result = thread.Invoke<bool>(RTC_FROM_HERE, |
+ // &MyFunctionReturningBool); |
// NOTE: This function can only be called when synchronous calls are allowed. |
// See ScopedDisallowBlockingCalls for details. |
template <class ReturnT, class FunctorT> |
- ReturnT Invoke(const FunctorT& functor) { |
- InvokeBegin(); |
+ ReturnT Invoke(const Location& posted_from, const FunctorT& functor) { |
FunctorMessageHandler<ReturnT, FunctorT> handler(functor); |
- Send(&handler); |
- InvokeEnd(); |
+ InvokeInternal(posted_from, &handler); |
return handler.result(); |
} |
@@ -261,9 +261,7 @@ class LOCKABLE Thread : public MessageQueue { |
// Returns true if there is such a message. |
bool PopSendMessageFromThread(const Thread* source, _SendMessage* msg); |
- // Used for tracking performance of Invoke calls. |
- void InvokeBegin(); |
- void InvokeEnd(); |
+ void InvokeInternal(const Location& posted_from, MessageHandler* handler); |
std::list<_SendMessage> sendlist_; |
std::string name_; |