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

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

Issue 2728203002: Remove WRAPPER_VISITOR_SPECIAL_CLASSES (Closed)
Patch Set: Change CanTraceWrappers Created 3 years, 9 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 | « third_party/WebKit/Source/platform/heap/TraceTraits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3e0c49b8e52a2a06960fdef4b8a371cf50e6c3f0..d5002a677fac428c0b937b82f50277d796b96ba1 100644
--- a/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
+++ b/third_party/WebKit/Source/platform/heap/WrapperVisitor.h
@@ -27,34 +27,36 @@ class TraceWrapperBase;
template <typename T>
class TraceWrapperMember;
-// Only add a special class here if the class cannot derive from
-// TraceWrapperBase.
-#define WRAPPER_VISITOR_SPECIAL_CLASSES(V) \
- V(ElementRareData) \
- V(NodeListsNodeData) \
- V(NodeMutationObserverData) \
- V(NodeRareData)
-
-#define FORWARD_DECLARE_SPECIAL_CLASSES(className) class className;
-
-WRAPPER_VISITOR_SPECIAL_CLASSES(FORWARD_DECLARE_SPECIAL_CLASSES);
-
-#undef FORWARD_DECLARE_SPECIAL_CLASSES
-
/**
* Declares non-virtual traceWrappers method. Should be used on
* non-ScriptWrappable classes which should participate in wrapper tracing (e.g.
- * NodeRareData):
+ * StyleEngine):
*
- * class NodeRareData {
- * public:
- * DECLARE_TRACE_WRAPPERS();
- * }
+ * class StyleEngine: public TraceWrapperBase {
+ * public:
+ * DECLARE_TRACE_WRAPPERS();
+ * };
*/
#define DECLARE_TRACE_WRAPPERS() \
void traceWrappers(const WrapperVisitor* visitor) const
/**
+ * Declares markAndDispatchTraceWrappers and non-virtual traceWrappers methods.
+ * Use this on non-TraceWrapperBase classes that participate in wrapper tracing
+ * (e.g. NodeRareData):
+ *
+ * class NodeRareData {
+ * public:
+ * DECLARE_TRACE_WRAPPERS_WITHOUT_BASE();
+ * };
+ */
+#define DECLARE_TRACE_WRAPPERS_WITHOUT_BASE() \
+ void markAndDispatchTraceWrappers(const WrapperVisitor* visitor) const { \
+ traceWrappers(visitor); \
+ } \
+ DECLARE_TRACE_WRAPPERS()
+
+/**
* Declares virtual traceWrappers method. It is used in ScriptWrappable, can be
* used to override the method in the subclasses, and can be used by
* non-ScriptWrappable classes which expect to be inherited.
@@ -150,22 +152,11 @@ class PLATFORM_EXPORT WrapperVisitor {
virtual void markWrapper(const v8::PersistentBase<v8::Value>*) const = 0;
virtual void dispatchTraceWrappers(const TraceWrapperBase*) const = 0;
-#define DECLARE_DISPATCH_TRACE_WRAPPERS(ClassName) \
- virtual void dispatchTraceWrappers(const ClassName*) const = 0;
-
- WRAPPER_VISITOR_SPECIAL_CLASSES(DECLARE_DISPATCH_TRACE_WRAPPERS);
-
-#undef DECLARE_DISPATCH_TRACE_WRAPPERS
virtual bool markWrapperHeader(HeapObjectHeader*) const = 0;
virtual void markWrappersInAllWorlds(const ScriptWrappable*) const = 0;
- void markWrappersInAllWorlds(const void*) const {
- // Empty handler used for WRAPPER_VISITOR_SPECIAL_CLASSES. These types
- // don't require marking wrappers in all worlds, so just nop on those.
- }
-
template <typename T>
ALWAYS_INLINE void markAndPushToMarkingDeque(const T* traceable) const {
if (pushToMarkingDeque(TraceTrait<T>::traceMarkedWrapper,
@@ -184,17 +175,6 @@ class PLATFORM_EXPORT WrapperVisitor {
const void*) const = 0;
};
-#define SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT(ClassName) \
- template <> \
- class CanTraceWrappers<ClassName, false> { \
- public: \
- static const bool value = true; \
- };
-
-WRAPPER_VISITOR_SPECIAL_CLASSES(SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT)
-
-#undef SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT
-
} // namespace blink
#endif // WrapperVisitor_h
« no previous file with comments | « third_party/WebKit/Source/platform/heap/TraceTraits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698