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

Unified Diff: Source/heap/Visitor.h

Issue 169653006: [not for commit] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: something that works Created 6 years, 10 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 | public/platform/WebPrivatePtr.h » ('j') | public/platform/WebPrivatePtr.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/heap/Visitor.h
diff --git a/Source/heap/Visitor.h b/Source/heap/Visitor.h
index 80623bf29531b79daa213ccdecb17877dff4bd6d..aa44fda6245165eb48a571e5d62e4cd06ace11e0 100644
--- a/Source/heap/Visitor.h
+++ b/Source/heap/Visitor.h
@@ -52,6 +52,7 @@
namespace WebCore {
class FinalizedHeapObjectHeader;
+template<typename T> class GarbageCollected;
template<typename T> class GarbageCollectedFinalized;
class HeapObjectHeader;
template<typename T> class Member;
@@ -92,6 +93,20 @@ struct GCInfo {
};
// Template struct to detect whether type T inherits from
+// GarbageCollected.
+template<typename T>
+struct IsGarbageCollected {
Mads Ager (chromium) 2014/02/18 06:50:50 Can we use WTF::IsSubclassOfTemplate here? WTF::I
Vyacheslav Egorov (Chromium) 2014/02/18 09:37:44 Done.
+ typedef char TrueType;
+ struct FalseType {
+ char dummy[2];
+ };
+ template<typename U> static TrueType has(GarbageCollected<U>*);
+ static FalseType has(...);
+ static bool const value = sizeof(has(static_cast<T*>(0))) == sizeof(TrueType);
+};
+
+
+// Template struct to detect whether type T inherits from
// GarbageCollectedFinalized.
template<typename T>
struct IsGarbageCollectedFinalized {
Mads Ager (chromium) 2014/02/18 06:50:50 I think we can get rid of this one as well and use
« no previous file with comments | « no previous file | public/platform/WebPrivatePtr.h » ('j') | public/platform/WebPrivatePtr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698