Chromium Code Reviews| Index: Source/core/dom/MainThreadTaskRunner.h |
| diff --git a/Source/core/dom/MainThreadTaskRunner.h b/Source/core/dom/MainThreadTaskRunner.h |
| index c3c9287cc01706ceca563ad8e312d6a97fdacde3..48e7324a5717353c19fd81a9a9bca5f8d5f73e4a 100644 |
| --- a/Source/core/dom/MainThreadTaskRunner.h |
| +++ b/Source/core/dom/MainThreadTaskRunner.h |
| @@ -29,7 +29,7 @@ |
| #include "core/CoreExport.h" |
| #include "platform/Timer.h" |
| - |
| +#include "platform/heap/Handle.h" |
| #include "wtf/FastAllocBase.h" |
| #include "wtf/Noncopyable.h" |
| #include "wtf/OwnPtr.h" |
| @@ -42,15 +42,17 @@ namespace blink { |
| class ExecutionContext; |
| class ExecutionContextTask; |
| -class CORE_EXPORT MainThreadTaskRunner { |
| +class CORE_EXPORT MainThreadTaskRunner final : public NoBaseWillBeGarbageCollectedFinalized<MainThreadTaskRunner> { |
| WTF_MAKE_NONCOPYABLE(MainThreadTaskRunner); |
| - WTF_MAKE_FAST_ALLOCATED(MainThreadTaskRunner); |
| + WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(MainThreadTaskRunner); |
| public: |
| - static PassOwnPtr<MainThreadTaskRunner> create(ExecutionContext*); |
| + static PassOwnPtrWillBeRawPtr<MainThreadTaskRunner> create(ExecutionContext*); |
| ~MainThreadTaskRunner(); |
| + DECLARE_TRACE(); |
| + |
| void postTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>); // Executes the task on context's thread asynchronously. |
| void postInspectorTask(const WebTraceLocation&, PassOwnPtr<ExecutionContextTask>); |
| void perform(PassOwnPtr<ExecutionContextTask>, bool); |
| @@ -63,16 +65,16 @@ private: |
| void pendingTasksTimerFired(Timer<MainThreadTaskRunner>*); |
| - ExecutionContext* m_context; |
| + RawPtrWillBeMember<ExecutionContext> m_context; |
| WeakPtrFactory<MainThreadTaskRunner> m_weakFactory; |
|
sof
2015/08/18 07:15:31
Doesn't this need to be eagerly finalized?
haraken
2015/08/18 08:08:54
I don't see any issue in not eagerly finalizing th
sof
2015/08/18 13:54:45
Could you explain your reasoning behind that asses
|
| Timer<MainThreadTaskRunner> m_pendingTasksTimer; |
| Vector<OwnPtr<ExecutionContextTask>> m_pendingTasks; |
| bool m_suspended; |
| }; |
| -inline PassOwnPtr<MainThreadTaskRunner> MainThreadTaskRunner::create(ExecutionContext* context) |
| +inline PassOwnPtrWillBeRawPtr<MainThreadTaskRunner> MainThreadTaskRunner::create(ExecutionContext* context) |
| { |
| - return adoptPtr(new MainThreadTaskRunner(context)); |
| + return adoptPtrWillBeNoop(new MainThreadTaskRunner(context)); |
| } |
| } // namespace |