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

Unified Diff: Source/platform/Supplementable.h

Issue 409113003: Revert of [oilpan]: Remove support for tracing off-heap hashmaps. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/modules/webdatabase/SQLTransactionCoordinator.cpp ('k') | Source/platform/heap/Handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/Supplementable.h
diff --git a/Source/platform/Supplementable.h b/Source/platform/Supplementable.h
index 650a204bd57cbbee12b7ebf1ad25f73e6e3b5791..f148734e003f11811ce5de2f76adb71f20dcf6bb 100644
--- a/Source/platform/Supplementable.h
+++ b/Source/platform/Supplementable.h
@@ -159,8 +159,6 @@
template<typename T>
class SupplementableTracing<T, false> { };
-// Helper class for implementing Supplementable, HeapSupplementable, and
-// PersistentHeapSupplementable.
template<typename T, bool isGarbageCollected = false>
class SupplementableBase : public SupplementableTracing<T, isGarbageCollected> {
public:
@@ -190,11 +188,7 @@
#endif
}
- // We have a trace method in the SupplementableBase class to ensure we have
- // the vtable at the first word of the object. However we don't trace the
- // m_supplements here, but in the partially specialized template subclasses
- // since we only want to trace it for garbage collected classes.
- virtual void trace(Visitor*) { }
+ virtual void trace(Visitor* visitor) { visitor->trace(m_supplements); }
void willBeDestroyed()
{
@@ -217,8 +211,6 @@
#endif
};
-// This class is used to make an on-heap class supplementable. Its supplements
-// must be HeapSupplement.
template<typename T>
class HeapSupplement : public SupplementBase<T, true> { };
@@ -226,17 +218,11 @@
template<typename T>
class GC_PLUGIN_IGNORE("http://crbug.com/395036") HeapSupplementable : public SupplementableBase<T, true>, public GarbageCollectedMixin {
public:
- virtual void trace(Visitor* visitor) OVERRIDE
- {
- visitor->trace(this->m_supplements);
- SupplementableBase<T, true>::trace(visitor);
- }
-};
-
-// This class is used to make an off-heap class supplementable with supplements
-// that are on-heap, aka. HeapSupplements.
-template<typename T>
-class GC_PLUGIN_IGNORE("http://crbug.com/395036") PersistentHeapSupplementable : public SupplementableBase<T, true> {
+ virtual void trace(Visitor* visitor) { SupplementableBase<T, true>::trace(visitor); }
+};
+
+template<typename T>
+class PersistentHeapSupplementable : public SupplementableBase<T, true> {
public:
PersistentHeapSupplementable() : m_root(this) { }
virtual ~PersistentHeapSupplementable()
@@ -245,13 +231,6 @@
for (SupplementIterator it = this->m_supplements.begin(); it != this->m_supplements.end(); ++it)
it->value->persistentHostHasBeenDestroyed();
}
-
- virtual void trace(Visitor* visitor)
- {
- visitor->trace(this->m_supplements);
- SupplementableBase<T, true>::trace(visitor);
- }
-
private:
class TraceDelegate : PersistentBase<ThreadLocalPersistents<AnyThread>, TraceDelegate> {
public:
@@ -267,21 +246,8 @@
template<typename T>
class Supplement : public SupplementBase<T, false> { };
-// This class is used to make an off-heap class supplementable with off-heap
-// supplements (Supplement).
-template<typename T>
-class GC_PLUGIN_IGNORE("http://crbug.com/395036") Supplementable : public SupplementableBase<T, false> {
-public:
- virtual void trace(Visitor* visitor)
- {
- // No tracing of off-heap supplements. We should not have any Supplementable
- // object on the heap. Either the object is HeapSupplementable or if it is
- // off heap it should use PersistentHeapSupplementable to trace any on-heap
- // supplements.
- COMPILE_ASSERT(!IsGarbageCollectedType<T>::value, GarbageCollectedObjectMustBeHeapSupplementable);
- SupplementableBase<T, false>::trace(visitor);
- }
-};
+template<typename T>
+class Supplementable : public SupplementableBase<T, false> { };
template<typename T>
struct ThreadingTrait<blink::SupplementBase<T, true> > {
« no previous file with comments | « Source/modules/webdatabase/SQLTransactionCoordinator.cpp ('k') | Source/platform/heap/Handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698