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

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

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 c65907728e1f115ccd2c8b95dc6f359b79f05c7e..1035ee950f51e49562fc964970843b2905e1215d 100644
--- a/third_party/WebKit/Source/platform/heap/Visitor.h
+++ b/third_party/WebKit/Source/platform/heap/Visitor.h
@@ -121,6 +121,8 @@ public:
template<typename Derived>
class VisitorHelper {
public:
+ VisitorHelper() : m_threadState(ThreadState::current()) {}
+
// 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
@@ -281,9 +283,13 @@ public:
Derived::fromHelper(this)->registerWeakMembers(object, object, callback);
}
+ inline ThreadState* threadState() const { return m_threadState; }
+
private:
template<typename T>
static void handleWeakCell(Visitor* self, void* object);
+
+ ThreadState* m_threadState;
};
// Visitor is used to traverse the Blink object graph. Used for the

Powered by Google App Engine
This is Rietveld 408576698