зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1680544 - Part 1: Introduce a GetName member for Tasks and implement this for RunnableTask. r=smaug,nika
Differential Revision: https://phabricator.services.mozilla.com/D98644
This commit is contained in:
Родитель
167d5effe6
Коммит
3f4d736062
|
@ -465,6 +465,16 @@ class RunnableTask : public Task {
|
|||
return nsThread::GetPerformanceCounterBase(mRunnable);
|
||||
}
|
||||
|
||||
virtual bool GetName(nsACString& aName) override {
|
||||
#ifdef MOZ_COLLECTING_RUNNABLE_TELEMETRY
|
||||
nsThread::GetLabeledRunnableName(mRunnable, aName,
|
||||
EventQueuePriority(GetPriority()));
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<nsIRunnable> mRunnable;
|
||||
};
|
||||
|
|
|
@ -170,6 +170,9 @@ class Task {
|
|||
|
||||
virtual PerformanceCounter* GetPerformanceCounter() const { return nullptr; }
|
||||
|
||||
// Get a name for this task. This returns false if the task has no name.
|
||||
virtual bool GetName(nsACString& aName) { return false; }
|
||||
|
||||
protected:
|
||||
Task(bool aMainThreadOnly,
|
||||
uint32_t aPriority = static_cast<uint32_t>(kDefaultPriorityValue))
|
||||
|
|
Загрузка…
Ссылка в новой задаче