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

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: 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') | Source/platform/heap/Heap.h » ('J')
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 6a46cef73a1b9bbf1ee303b986977ceb9d7d81f2..2d272b857c2ca78768a32c773a0590f76426efc4 100644
--- a/Source/platform/heap/Handle.h
+++ b/Source/platform/heap/Handle.h
@@ -1040,6 +1040,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*> {
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | Source/platform/heap/Heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698