Bug 1345339 - Label runnables in dom/media/VideoUtils.h;r?jwwang
MozReview-Commit-ID: KqaHyMBTSBq
--- a/dom/media/VideoUtils.h
+++ b/dom/media/VideoUtils.h
@@ -100,31 +100,33 @@ public:
private:
nsCOMPtr<nsIThread> mThread;
};
template<class T>
class DeleteObjectTask: public Runnable {
public:
explicit DeleteObjectTask(nsAutoPtr<T>& aObject)
- : mObject(aObject)
+ : Runnable("VideoUtils::DeleteObjectTask")
+ , mObject(aObject)
{
}
NS_IMETHOD Run() override {
NS_ASSERTION(NS_IsMainThread(), "Must be on main thread.");
mObject = nullptr;
return NS_OK;
}
private:
nsAutoPtr<T> mObject;
};
template<class T>
void DeleteOnMainThread(nsAutoPtr<T>& aObject) {
- NS_DispatchToMainThread(new DeleteObjectTask<T>(aObject));
+ nsCOMPtr<nsIRunnable> r = new DeleteObjectTask<T>(aObject);
+ SystemGroup::Dispatch("VideoUtils::DeleteObjectTask", TaskCategory::Other, r.forget());
}
class MediaResource;
// Estimates the buffered ranges of a MediaResource using a simple
// (byteOffset/length)*duration method. Probably inaccurate, but won't
// do file I/O, and can be used when we don't have detailed knowledge
// of the byte->time mapping of a resource. aDurationUsecs is the duration