Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: webrtc/base/messagequeue.h

Issue 2019423006: Adding more detail to MessageQueue::Dispatch logging. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing one more place where RTC_FROM_HERE wasn't used. Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/location.cc ('k') | webrtc/base/messagequeue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/messagequeue.h
diff --git a/webrtc/base/messagequeue.h b/webrtc/base/messagequeue.h
index bf110376b58d7eb681fb93477d8ac02384c6365d..15b98565b770e0eef60563c82e25d3ff4da03c07 100644
--- a/webrtc/base/messagequeue.h
+++ b/webrtc/base/messagequeue.h
@@ -22,6 +22,7 @@
#include "webrtc/base/basictypes.h"
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/criticalsection.h"
+#include "webrtc/base/location.h"
#include "webrtc/base/messagehandler.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/sharedexclusivelock.h"
@@ -138,13 +139,13 @@ const uint32_t MQID_DISPOSE = static_cast<uint32_t>(-2);
// No destructor
struct Message {
- Message() {
- memset(this, 0, sizeof(*this));
- }
+ Message()
+ : phandler(nullptr), message_id(0), pdata(nullptr), ts_sensitive(0) {}
inline bool Match(MessageHandler* handler, uint32_t id) const {
return (handler == NULL || handler == phandler)
&& (id == MQID_ANY || id == message_id);
}
+ Location posted_from;
MessageHandler *phandler;
uint32_t message_id;
MessageData *pdata;
@@ -213,20 +214,24 @@ class MessageQueue {
virtual bool Get(Message *pmsg, int cmsWait = kForever,
bool process_io = true);
virtual bool Peek(Message *pmsg, int cmsWait = 0);
- virtual void Post(MessageHandler* phandler,
+ virtual void Post(const Location& posted_from,
+ MessageHandler* phandler,
uint32_t id = 0,
MessageData* pdata = NULL,
bool time_sensitive = false);
- virtual void PostDelayed(int cmsDelay,
+ virtual void PostDelayed(const Location& posted_from,
+ int cmsDelay,
MessageHandler* phandler,
uint32_t id = 0,
MessageData* pdata = NULL);
- virtual void PostAt(int64_t tstamp,
+ virtual void PostAt(const Location& posted_from,
+ int64_t tstamp,
MessageHandler* phandler,
uint32_t id = 0,
MessageData* pdata = NULL);
// TODO(honghaiz): Remove this when all the dependencies are removed.
- virtual void PostAt(uint32_t tstamp,
+ virtual void PostAt(const Location& posted_from,
+ uint32_t tstamp,
MessageHandler* phandler,
uint32_t id = 0,
MessageData* pdata = NULL);
@@ -248,7 +253,7 @@ class MessageQueue {
// Internally posts a message which causes the doomed object to be deleted
template<class T> void Dispose(T* doomed) {
if (doomed) {
- Post(NULL, MQID_DISPOSE, new DisposeData<T>(doomed));
+ Post(RTC_FROM_HERE, NULL, MQID_DISPOSE, new DisposeData<T>(doomed));
}
}
@@ -263,7 +268,8 @@ class MessageQueue {
void reheap() { make_heap(c.begin(), c.end(), comp); }
};
- void DoDelayPost(int64_t cmsDelay,
+ void DoDelayPost(const Location& posted_from,
+ int64_t cmsDelay,
int64_t tstamp,
MessageHandler* phandler,
uint32_t id,
« no previous file with comments | « webrtc/base/location.cc ('k') | webrtc/base/messagequeue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698