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

Unified Diff: Source/platform/heap/GarbageCollected.h

Issue 1217083002: Only check for on-heap Member<T>s iff T is in scope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 6 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 | « no previous file | Source/platform/heap/Handle.h » ('j') | Source/platform/heap/Handle.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/GarbageCollected.h
diff --git a/Source/platform/heap/GarbageCollected.h b/Source/platform/heap/GarbageCollected.h
index ce920621a9261b50b4a0f51985a43131018340b0..5fe5388fcf849b7c7aebaa4f4aaa1e4800a0b04c 100644
--- a/Source/platform/heap/GarbageCollected.h
+++ b/Source/platform/heap/GarbageCollected.h
@@ -422,6 +422,21 @@ public:
};
template <typename T> const bool NeedsAdjustAndMark<T, false>::value;
+// TODO(sof): migrate to wtf/TypeTraits.h
+template<typename T>
+class IsFullyDefined {
+ using TrueType = char;
+ struct FalseType {
+ char dummy[2];
+ };
+
+ template<typename U, size_t sz = sizeof(U)> static TrueType isSizeofKnown(U*);
+ static FalseType isSizeofKnown(...);
+ static T& t;
+public:
+ static const bool value = sizeof(TrueType) == sizeof(isSizeofKnown(&t));
+};
+
} // namespace blink
#endif
« no previous file with comments | « no previous file | Source/platform/heap/Handle.h » ('j') | Source/platform/heap/Handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698