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

Side by Side Diff: third_party/WebKit/Source/platform/heap/WrapperVisitor.h

Issue 2595053002: [wrapper-tracing] Simplify tracing by forbidding tracing from within mixins (Closed)
Patch Set: Guard DCHECK with DCHECK_IS_ON() as the method is only conditionally compiled Created 4 years 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/heap/TraceTraits.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WrapperVisitor_h 5 #ifndef WrapperVisitor_h
6 #define WrapperVisitor_h 6 #define WrapperVisitor_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 10
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 virtual void markWrapper(const v8::PersistentBase<v8::Value>*) const = 0; 147 virtual void markWrapper(const v8::PersistentBase<v8::Value>*) const = 0;
148 148
149 virtual void dispatchTraceWrappers(const TraceWrapperBase*) const = 0; 149 virtual void dispatchTraceWrappers(const TraceWrapperBase*) const = 0;
150 #define DECLARE_DISPATCH_TRACE_WRAPPERS(ClassName) \ 150 #define DECLARE_DISPATCH_TRACE_WRAPPERS(ClassName) \
151 virtual void dispatchTraceWrappers(const ClassName*) const = 0; 151 virtual void dispatchTraceWrappers(const ClassName*) const = 0;
152 152
153 WRAPPER_VISITOR_SPECIAL_CLASSES(DECLARE_DISPATCH_TRACE_WRAPPERS); 153 WRAPPER_VISITOR_SPECIAL_CLASSES(DECLARE_DISPATCH_TRACE_WRAPPERS);
154 154
155 #undef DECLARE_DISPATCH_TRACE_WRAPPERS 155 #undef DECLARE_DISPATCH_TRACE_WRAPPERS
156 156
157 void dispatchTraceWrappers(const void*) const {
158 // This call should never be reached as we access all tracing through
159 // TraceTraits, which will check that we can dispatch at compile time.
160 // This handler is merely here to make adjustAndMarkWrapper compile
161 // for GarbageCollectedMixin objects.
162 NOTREACHED();
163 }
164
165 virtual bool markWrapperHeader(HeapObjectHeader*) const = 0; 157 virtual bool markWrapperHeader(HeapObjectHeader*) const = 0;
166 158
167 virtual void markWrappersInAllWorlds(const ScriptWrappable*) const = 0; 159 virtual void markWrappersInAllWorlds(const ScriptWrappable*) const = 0;
168 160
169 void markWrappersInAllWorlds(const void*) const { 161 void markWrappersInAllWorlds(const void*) const {
170 // Empty handler used for WRAPPER_VISITOR_SPECIAL_CLASSES. These types 162 // Empty handler used for WRAPPER_VISITOR_SPECIAL_CLASSES. These types
171 // don't require marking wrappers in all worlds, so just nop on those. 163 // don't require marking wrappers in all worlds, so just nop on those.
172 } 164 }
173 165
174 virtual void pushToMarkingDeque( 166 virtual void pushToMarkingDeque(
175 void (*traceWrappersCallback)(const WrapperVisitor*, const void*), 167 void (*traceWrappersCallback)(const WrapperVisitor*, const void*),
176 HeapObjectHeader* (*heapObjectHeaderCallback)(const void*), 168 HeapObjectHeader* (*heapObjectHeaderCallback)(const void*),
177 const void*) const = 0; 169 const void*) const = 0;
178 }; 170 };
179 171
180 #define SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT(ClassName) \ 172 #define SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT(ClassName) \
181 template <> \ 173 template <> \
182 class CanTraceWrappers<ClassName, false> { \ 174 class CanTraceWrappers<ClassName, false> { \
183 public: \ 175 public: \
184 static const bool value = true; \ 176 static const bool value = true; \
185 }; 177 };
186 178
187 WRAPPER_VISITOR_SPECIAL_CLASSES(SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT) 179 WRAPPER_VISITOR_SPECIAL_CLASSES(SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT)
188 180
189 #undef SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT 181 #undef SPECIALIZE_WRAPPER_TRACING_MARK_TRAIT
190 182
191 } // namespace blink 183 } // namespace blink
192 184
193 #endif // WrapperVisitor_h 185 #endif // WrapperVisitor_h
OLDNEW
« 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