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

Unified Diff: third_party/WebKit/Source/platform/heap/Visitor.h

Issue 1974693002: Make Visitor use heap for the current thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Source/platform/heap/Visitor.h
diff --git a/third_party/WebKit/Source/platform/heap/Visitor.h b/third_party/WebKit/Source/platform/heap/Visitor.h
index 68a00f409ae26d4bb520ce76b69402bc325f29c0..5afb914ec1a467b14c4362cbe13baf0c4f34fa0a 100644
--- a/third_party/WebKit/Source/platform/heap/Visitor.h
+++ b/third_party/WebKit/Source/platform/heap/Visitor.h
@@ -119,6 +119,8 @@ public:
template<typename Derived>
class VisitorHelper {
public:
+ VisitorHelper(ThreadState* state) : m_state(state) { }
+
// One-argument templated mark method. This uses the static type of
// the argument to get the TraceTrait. By default, the mark method
// of the TraceTrait just calls the virtual two-argument mark method on this
@@ -221,9 +223,14 @@ public:
Derived::fromHelper(this)->registerWeakMembers(object, object, callback);
}
+ inline ThreadState* state() const { return m_state; }
+ inline ThreadHeap& heap() const { return state()->heap(); }
+
private:
template<typename T>
static void handleWeakCell(Visitor* self, void* object);
+
+ ThreadState* m_state;
};
// Visitor is used to traverse the Blink object graph. Used for the
@@ -313,8 +320,6 @@ public:
inline MarkingMode getMarkingMode() const { return m_markingMode; }
- inline ThreadHeap& heap() const { return m_state->heap(); }
-
protected:
Visitor(ThreadState*, MarkingMode);
« no previous file with comments | « third_party/WebKit/Source/platform/heap/TraceTraits.h ('k') | third_party/WebKit/Source/platform/heap/Visitor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698