Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Unified Diff: Source/core/dom/MainThreadTaskRunner.h

Issue 1296243004: Oilpan: Move MainThreadTaskRunner into Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use CrossThreadWeakPersistent. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/MainThreadTaskRunner.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/MainThreadTaskRunner.h
diff --git a/Source/core/dom/MainThreadTaskRunner.h b/Source/core/dom/MainThreadTaskRunner.h
index c3c9287cc01706ceca563ad8e312d6a97fdacde3..dfd414ad44d950c71bf0819c0616f3bf12bcefd3 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,20 @@ private:
void pendingTasksTimerFired(Timer<MainThreadTaskRunner>*);
- ExecutionContext* m_context;
+ WeakPtrWillBeRawPtr<MainThreadTaskRunner> createWeakPointerToSelf();
+
+ RawPtrWillBeMember<ExecutionContext> m_context;
+#if !ENABLE(OILPAN)
WeakPtrFactory<MainThreadTaskRunner> m_weakFactory;
+#endif
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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/dom/MainThreadTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698