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

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

Issue 319593004: Oilpan:Allow custom handling of classes that contain weak pointers that are embedded in collections. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove 'typename' that Win compiler does not like Created 6 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/Heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Handle.h
diff --git a/Source/platform/heap/Handle.h b/Source/platform/heap/Handle.h
index d3872b02be0e526a2361b54a410d1922ab06c8d4..a01460dcaafee60258a21d6a4f7c3cf474d82935 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -609,7 +609,7 @@ protected:
T* m_raw;
- template<bool x, bool y, ShouldWeakPointersBeMarkedStrongly z, typename U, typename V> friend struct CollectionBackingTraceTrait;
+ template<bool x, WTF::WeakHandlingFlag y, ShouldWeakPointersBeMarkedStrongly z, typename U, typename V> friend struct CollectionBackingTraceTrait;
friend class Visitor;
};
@@ -1042,6 +1042,12 @@ template<typename T> struct HashTraits<WebCore::WeakMember<T> > : SimpleClassHas
static PeekOutType peek(const WebCore::WeakMember<T>& value) { return value; }
static PassOutType passOut(const WebCore::WeakMember<T>& value) { return value; }
+ static bool shouldRemoveFromCollection(WebCore::Visitor* visitor, WebCore::WeakMember<T>& value) { return !visitor->isAlive(value); }
+ static void traceInCollection(WebCore::Visitor* visitor, WebCore::WeakMember<T>& weakMember, WebCore::ShouldWeakPointersBeMarkedStrongly strongify)
+ {
+ if (strongify == WebCore::WeakPointersActStrong)
+ visitor->trace(reinterpret_cast<WebCore::Member<T>&>(weakMember)); // Strongified visit.
+ }
};
template<typename T> struct PtrHash<WebCore::Member<T> > : PtrHash<T*> {
@@ -1088,11 +1094,6 @@ struct IsWeak<WebCore::WeakMember<T> > {
static const bool value = true;
};
-template<typename Table>
-struct IsWeak<WebCore::HeapHashTableBacking<Table> > {
- static const bool value = Table::ValueTraits::isWeak;
-};
-
template<typename T> inline T* getPtr(const WebCore::Member<T>& p)
{
return p.get();
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698