mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1186745 part 4 - Make TracedRunnable accept an already_AddRefed instead of a raw pointer. r=froydnj
This commit is contained in:
parent
c77cf19cea
commit
480aa15bc7
@ -75,7 +75,8 @@ const PRTime GetStartTime();
|
||||
|
||||
Task* CreateTracedTask(Task* aTask);
|
||||
|
||||
already_AddRefed<nsIRunnable> CreateTracedRunnable(nsIRunnable* aRunnable);
|
||||
already_AddRefed<nsIRunnable>
|
||||
CreateTracedRunnable(already_AddRefed<nsIRunnable>&& aRunnable);
|
||||
|
||||
// Free the TraceInfo allocated on a thread's TLS. Currently we are wrapping
|
||||
// tasks running on nsThreads and base::thread, so FreeTraceInfo is called at
|
||||
|
@ -90,9 +90,9 @@ TracedTaskCommon::ClearTLSTraceInfo()
|
||||
/**
|
||||
* Implementation of class TracedRunnable.
|
||||
*/
|
||||
TracedRunnable::TracedRunnable(nsIRunnable* aOriginalObj)
|
||||
TracedRunnable::TracedRunnable(already_AddRefed<nsIRunnable>&& aOriginalObj)
|
||||
: TracedTaskCommon()
|
||||
, mOriginalObj(aOriginalObj)
|
||||
, mOriginalObj(Move(aOriginalObj))
|
||||
{
|
||||
Init();
|
||||
LogVirtualTablePtr(mTaskId, mSourceEventId, *(int**)(aOriginalObj));
|
||||
@ -148,9 +148,9 @@ TracedTask::Run()
|
||||
* nsIRunnable object, aRunnable.
|
||||
*/
|
||||
already_AddRefed<nsIRunnable>
|
||||
CreateTracedRunnable(nsIRunnable* aRunnable)
|
||||
CreateTracedRunnable(already_AddRefed<nsIRunnable>&& aRunnable)
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> runnable = new TracedRunnable(aRunnable);
|
||||
nsCOMPtr<nsIRunnable> runnable = new TracedRunnable(Move(aRunnable));
|
||||
return runnable.forget();
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ class TracedRunnable : public TracedTaskCommon
|
||||
public:
|
||||
NS_DECL_NSIRUNNABLE
|
||||
|
||||
TracedRunnable(nsIRunnable* aOriginalObj);
|
||||
TracedRunnable(already_AddRefed<nsIRunnable>&& aOriginalObj);
|
||||
|
||||
private:
|
||||
virtual ~TracedRunnable();
|
||||
|
@ -592,7 +592,7 @@ nsThread::DispatchInternal(already_AddRefed<nsIRunnable>&& aEvent, uint32_t aFla
|
||||
}
|
||||
|
||||
#ifdef MOZ_TASK_TRACER
|
||||
nsCOMPtr<nsIRunnable> tracedRunnable = CreateTracedRunnable(event); // adds a ref
|
||||
nsCOMPtr<nsIRunnable> tracedRunnable = CreateTracedRunnable(event.forget());
|
||||
(static_cast<TracedRunnable*>(tracedRunnable.get()))->DispatchTask();
|
||||
event = tracedRunnable.forget();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user