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

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

Issue 2474693002: [wrapper-tracing] Support for incrementally tracing ScopedPersistent (Closed)
Patch Set: Added tests Created 4 years, 1 month 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/WrapperVisitor.h
diff --git a/third_party/WebKit/Source/platform/heap/WrapperVisitor.h b/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
index dc9c5da0851e71d5f0f48a00bf13bcc3dde373be..f9c97d867a0492f1dc48d78bf1b28906e4a5274c 100644
--- a/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
+++ b/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
@@ -23,7 +23,7 @@ template <typename T>
class Member;
class ScriptWrappable;
template <typename T>
-class ScopedPersistent;
+class TraceWrapperV8Reference;
class TraceWrapperBase;
template <typename T>
class TraceWrapperMember;
@@ -94,6 +94,9 @@ class PLATFORM_EXPORT WrapperVisitor {
template <typename T>
void traceWrappers(const T* traceable) const {
haraken 2016/11/03 14:25:04 Would you help me understand who uses this method?
Michael Lippautz 2016/11/03 14:53:41 Yes, one has to be careful with traceWrappers over
static_assert(sizeof(T), "T must be fully defined");
+ // Ideally, we'd assert that we can cast to TraceWrapperBase here.
+ static_assert(IsGarbageCollectedType<T>::value,
+ "only garbage collected objects can be");
haraken 2016/11/03 14:25:04 Only garbage collected objects can be used in trac
Michael Lippautz 2016/11/03 14:53:41 Done.
if (!traceable) {
return;
@@ -136,11 +139,8 @@ class PLATFORM_EXPORT WrapperVisitor {
}
virtual void traceWrappers(
- const ScopedPersistent<v8::Value>* persistent) const = 0;
- virtual void traceWrappers(
- const ScopedPersistent<v8::Object>* persistent) const = 0;
- virtual void markWrapper(
- const v8::PersistentBase<v8::Object>* persistent) const = 0;
+ const TraceWrapperV8Reference<v8::Value>*) const = 0;
haraken 2016/11/03 14:25:04 It's inconsistent that traceWrappers(const TraceWr
Michael Lippautz 2016/11/03 14:53:41 Done.
+ virtual void markWrapper(const v8::PersistentBase<v8::Value>*) const = 0;
virtual void dispatchTraceWrappers(const TraceWrapperBase*) const = 0;
#define DECLARE_DISPATCH_TRACE_WRAPPERS(ClassName) \

Powered by Google App Engine
This is Rietveld 408576698