зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1638925 - Log names of nsINamed runnables, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79620
This commit is contained in:
Родитель
41e8aa0689
Коммит
91ff5e401f
|
@ -39,6 +39,8 @@ static LazyLogModule sEventDispatchAndRunLog("events");
|
|||
#endif
|
||||
#define LOG1(args) \
|
||||
MOZ_LOG(sEventDispatchAndRunLog, mozilla::LogLevel::Error, args)
|
||||
#define LOG1_ENABLED() \
|
||||
MOZ_LOG_TEST(sEventDispatchAndRunLog, mozilla::LogLevel::Error)
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -619,6 +621,24 @@ LogTaskBase<T>::Run::Run(T* aEvent, bool aWillRunAgain)
|
|||
LOG1(("EXEC %p", mEvent));
|
||||
}
|
||||
|
||||
template <>
|
||||
LogTaskBase<nsIRunnable>::Run::Run(nsIRunnable* aEvent, bool aWillRunAgain)
|
||||
: mEvent(aEvent), mWillRunAgain(aWillRunAgain) {
|
||||
if (!LOG1_ENABLED()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINamed> named(do_QueryInterface(aEvent));
|
||||
if (!named) {
|
||||
LOG1(("EXEC %p", mEvent));
|
||||
return;
|
||||
}
|
||||
|
||||
nsAutoCString name;
|
||||
named->GetName(name);
|
||||
LOG1(("EXEC %p [%s]", aEvent, name.BeginReading()));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
LogTaskBase<T>::Run::~Run() {
|
||||
LOG1((mWillRunAgain ? "INTERRUPTED %p" : "DONE %p", mEvent));
|
||||
|
|
|
@ -1905,6 +1905,10 @@ class LogTaskBase {
|
|||
};
|
||||
};
|
||||
|
||||
// Specialized constructor; must be explicitly declared.
|
||||
template <>
|
||||
LogTaskBase<nsIRunnable>::Run::Run(nsIRunnable* aEvent, bool aWillRunAgain);
|
||||
|
||||
class MicroTaskRunnable;
|
||||
|
||||
typedef LogTaskBase<nsIRunnable> LogRunnable;
|
||||
|
|
Загрузка…
Ссылка в новой задаче