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

Unified Diff: third_party/WebKit/Source/platform/heap/GarbageCollected.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
Index: third_party/WebKit/Source/platform/heap/GarbageCollected.h
diff --git a/third_party/WebKit/Source/platform/heap/GarbageCollected.h b/third_party/WebKit/Source/platform/heap/GarbageCollected.h
index eb6c3166de979c5cbe027b516b2758ab1b0d8096..e22e0e1e0197f1ae3a03766ecf3ee409f8d86ec9 100644
--- a/third_party/WebKit/Source/platform/heap/GarbageCollected.h
+++ b/third_party/WebKit/Source/platform/heap/GarbageCollected.h
@@ -14,7 +14,6 @@ namespace blink {
template <typename T>
class GarbageCollected;
-class TraceWrapperBase;
// GC_PLUGIN_IGNORE is used to make the plugin ignore a particular class or
// field when checking for proper usage. When using GC_PLUGIN_IGNORE
@@ -149,15 +148,15 @@ class PLATFORM_EXPORT GarbageCollectedMixin {
// when the "operator new" for B runs, and leaving the forbidden GC scope
// when the constructor of the recorded GarbageCollectedMixinConstructorMarker
// runs.
-#define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \
- IS_GARBAGE_COLLECTED_TYPE(); \
- DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::Visitor*, TYPE) \
- DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \
- public: \
- bool isHeapObjectAlive() const override { \
- return ThreadHeap::isHeapObjectAlive(this); \
- } \
- \
+#define USING_GARBAGE_COLLECTED_MIXIN(TYPE) \
+ IS_GARBAGE_COLLECTED_TYPE(); \
+ DEFINE_GARBAGE_COLLECTED_MIXIN_METHODS(blink::Visitor*, TYPE) \
+ DEFINE_GARBAGE_COLLECTED_MIXIN_CONSTRUCTOR_MARKER(TYPE) \
+ public: \
+ bool isHeapObjectAlive() const override { \
+ return ThreadHeap::isHeapObjectAlive(this); \
+ } \
+ \
private:
// An empty class with a constructor that's arranged invoked when all derived
@@ -247,26 +246,16 @@ class NeedsAdjustAndMark<T, false> {
IsGarbageCollectedMixin<typename std::remove_const<T>::type>::value;
};
-template <typename T,
- bool = std::is_base_of<TraceWrapperBase,
- typename std::remove_const<T>::type>::value>
-class CanTraceWrappers;
-
-template <typename T>
-class CanTraceWrappers<T, true> {
- static_assert(sizeof(T), "T must be fully defined");
-
- public:
- static const bool value = true;
-};
+class WrapperVisitor;
+template <typename T, typename = void>
+struct CanTraceWrappers : std::false_type {};
template <typename T>
-class CanTraceWrappers<T, false> {
- static_assert(sizeof(T), "T must be fully defined");
-
- public:
- static const bool value = false;
-};
+struct CanTraceWrappers<T,
+ decltype(
+ std::declval<T&>().markAndDispatchTraceWrappers(
+ std::declval<WrapperVisitor*>()))>
+ : std::true_type {};
// TODO(sof): migrate to wtf/TypeTraits.h
template <typename T>
« 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