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

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

Issue 2748103002: [wrapper-tracing] Redesign dispatching on non-inheriting cases (Closed)
Patch Set: Addressed comment 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 GarbageCollected_h 5 #ifndef GarbageCollected_h
6 #define GarbageCollected_h 6 #define GarbageCollected_h
7 7
8 #include "platform/heap/ThreadState.h" 8 #include "platform/heap/ThreadState.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/Assertions.h" 10 #include "wtf/Assertions.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 template <typename T> 240 template <typename T>
241 class NeedsAdjustAndMark<T, false> { 241 class NeedsAdjustAndMark<T, false> {
242 static_assert(sizeof(T), "T must be fully defined"); 242 static_assert(sizeof(T), "T must be fully defined");
243 243
244 public: 244 public:
245 static const bool value = 245 static const bool value =
246 IsGarbageCollectedMixin<typename std::remove_const<T>::type>::value; 246 IsGarbageCollectedMixin<typename std::remove_const<T>::type>::value;
247 }; 247 };
248 248
249 class WrapperVisitor;
250 template <typename T, typename = void>
251 struct CanTraceWrappers : std::false_type {};
252
253 template <typename T>
254 struct CanTraceWrappers<T,
255 decltype(
256 std::declval<T&>().markAndDispatchTraceWrappers(
257 std::declval<WrapperVisitor*>()))>
258 : std::true_type {};
259
260 // TODO(sof): migrate to wtf/TypeTraits.h 249 // TODO(sof): migrate to wtf/TypeTraits.h
261 template <typename T> 250 template <typename T>
262 class IsFullyDefined { 251 class IsFullyDefined {
263 using TrueType = char; 252 using TrueType = char;
264 struct FalseType { 253 struct FalseType {
265 char dummy[2]; 254 char dummy[2];
266 }; 255 };
267 256
268 template <typename U, size_t sz = sizeof(U)> 257 template <typename U, size_t sz = sizeof(U)>
269 static TrueType isSizeofKnown(U*); 258 static TrueType isSizeofKnown(U*);
270 static FalseType isSizeofKnown(...); 259 static FalseType isSizeofKnown(...);
271 static T& t; 260 static T& t;
272 261
273 public: 262 public:
274 static const bool value = sizeof(TrueType) == sizeof(isSizeofKnown(&t)); 263 static const bool value = sizeof(TrueType) == sizeof(isSizeofKnown(&t));
275 }; 264 };
276 265
277 } // namespace blink 266 } // namespace blink
278 267
279 #endif 268 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeRareData.h ('k') | third_party/WebKit/Source/platform/heap/TraceTraits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698