Chromium Code Reviews| 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 a554b2be6fe8953c756e5917a755fafd2a9ebdb3..fdb05e647bacbe26311c6369835d0d1c1ee2776d 100644 |
| --- a/third_party/WebKit/Source/platform/heap/WrapperVisitor.h |
| +++ b/third_party/WebKit/Source/platform/heap/WrapperVisitor.h |
| @@ -27,37 +27,33 @@ class TraceWrapperBase; |
| template <typename T> |
| class TraceWrapperMember; |
| -/** |
| - * Declares non-virtual traceWrappers method. Should be used on |
| - * non-ScriptWrappable classes which should participate in wrapper tracing (e.g. |
| - * StyleEngine): |
| - * |
| - * class StyleEngine: public TraceWrapperBase { |
| - * public: |
| - * DECLARE_TRACE_WRAPPERS(); |
| - * }; |
| - */ |
| +// Declares non-virtual traceWrappers method. Should be used on |
| +// non-ScriptWrappable classes which should participate in wrapper tracing (e.g. |
| +// StyleEngine): |
| +// |
| +// class StyleEngine: public TraceWrapperBase { |
| +// public: |
| +// DECLARE_TRACE_WRAPPERS(); |
| +// }; |
| +// |
| #define DECLARE_TRACE_WRAPPERS() \ |
| void TraceWrappers(const WrapperVisitor* visitor) const |
| -/** |
| - * 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. |
| - */ |
| +// 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. |
| #define DECLARE_VIRTUAL_TRACE_WRAPPERS() virtual DECLARE_TRACE_WRAPPERS() |
| -/** |
| - * Provides definition of traceWrappers method. Custom code will usually call |
| - * visitor->traceWrappers with all objects which could contribute to the set of |
| - * reachable wrappers: |
| - * |
| - * DEFINE_TRACE_WRAPPERS(NodeRareData) |
| - * { |
| - * visitor->traceWrappers(m_nodeLists); |
| - * visitor->traceWrappers(m_mutationObserverData); |
| - * } |
| - */ |
| +// Provides definition of traceWrappers method. Custom code will usually call |
| +// visitor->traceWrappers with all objects which could contribute to the set of |
| +// reachable wrappers: |
| +// |
| +// DEFINE_TRACE_WRAPPERS(NodeRareData) |
| +// { |
| +// visitor->traceWrappers(node_lists_); |
|
dcheng
2017/05/10 17:37:06
Just to confirm: the comment CLs are mostly scoped
Nico
2017/05/10 17:42:43
Yes, but done too, thanks. (I'm only focusing on t
|
| +// visitor->traceWrappers(mutation_observer_data_); |
| +// } |
| +// |
| #define DEFINE_TRACE_WRAPPERS(T) \ |
| void T::TraceWrappers(const WrapperVisitor* visitor) const |
| @@ -106,25 +102,21 @@ class PLATFORM_EXPORT WrapperVisitor { |
| MarkAndPushToMarkingDeque(traceable); |
| } |
| - /** |
| - * Trace all wrappers of |t|. |
| - * |
| - * If you cannot use TraceWrapperMember & the corresponding traceWrappers() |
| - * for some reason (e.g., due to sizeof(TraceWrapperMember)), you can use |
| - * Member and |traceWrappersWithManualWriteBarrier()|. See below. |
| - */ |
| + // Trace all wrappers of |t|. |
| + // |
| + // If you cannot use TraceWrapperMember & the corresponding traceWrappers() |
| + // for some reason (e.g., due to sizeof(TraceWrapperMember)), you can use |
| + // Member and |traceWrappersWithManualWriteBarrier()|. See below. |
| template <typename T> |
| void TraceWrappers(const TraceWrapperMember<T>& t) const { |
| TraceWrappers(t.Get()); |
| } |
| - /** |
| - * Require all users of manual write barriers to make this explicit in their |
| - * |traceWrappers| definition. Be sure to add |
| - * |ScriptWrappableVisitor::writeBarrier(this, new_value)| after all |
| - * assignments to the field. Otherwise, the objects may be collected |
| - * prematurely. |
| - */ |
| + // Require all users of manual write barriers to make this explicit in their |
| + // |traceWrappers| definition. Be sure to add |
| + // |ScriptWrappableVisitor::writeBarrier(this, new_value)| after all |
| + // assignments to the field. Otherwise, the objects may be collected |
| + // prematurely. |
| template <typename T> |
| void TraceWrappersWithManualWriteBarrier(const Member<T>& t) const { |
| TraceWrappers(t.Get()); |