| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 static PeekOutType peek(const blink::WeakMember<T>& value) { return value; } | 1076 static PeekOutType peek(const blink::WeakMember<T>& value) { return value; } |
| 1077 static PassOutType passOut(const blink::WeakMember<T>& value) { return value
; } | 1077 static PassOutType passOut(const blink::WeakMember<T>& value) { return value
; } |
| 1078 | 1078 |
| 1079 template<typename VisitorDispatcher> | 1079 template<typename VisitorDispatcher> |
| 1080 static bool traceInCollection(VisitorDispatcher visitor, blink::WeakMember<T
>& weakMember, ShouldWeakPointersBeMarkedStrongly strongify) | 1080 static bool traceInCollection(VisitorDispatcher visitor, blink::WeakMember<T
>& weakMember, ShouldWeakPointersBeMarkedStrongly strongify) |
| 1081 { | 1081 { |
| 1082 if (strongify == WeakPointersActStrong) { | 1082 if (strongify == WeakPointersActStrong) { |
| 1083 visitor->trace(weakMember.get()); // Strongified visit. | 1083 visitor->trace(weakMember.get()); // Strongified visit. |
| 1084 return false; | 1084 return false; |
| 1085 } | 1085 } |
| 1086 return !visitor->isHeapObjectAlive(weakMember); | 1086 return !blink::Heap::isHeapObjectAlive(weakMember); |
| 1087 } | 1087 } |
| 1088 }; | 1088 }; |
| 1089 | 1089 |
| 1090 template<typename T> struct PtrHash<blink::Member<T>> : PtrHash<T*> { | 1090 template<typename T> struct PtrHash<blink::Member<T>> : PtrHash<T*> { |
| 1091 template<typename U> | 1091 template<typename U> |
| 1092 static unsigned hash(const U& key) { return PtrHash<T*>::hash(key); } | 1092 static unsigned hash(const U& key) { return PtrHash<T*>::hash(key); } |
| 1093 static bool equal(T* a, const blink::Member<T>& b) { return a == b; } | 1093 static bool equal(T* a, const blink::Member<T>& b) { return a == b; } |
| 1094 static bool equal(const blink::Member<T>& a, T* b) { return a == b; } | 1094 static bool equal(const blink::Member<T>& a, T* b) { return a == b; } |
| 1095 template<typename U, typename V> | 1095 template<typename U, typename V> |
| 1096 static bool equal(const U& a, const V& b) { return a == b; } | 1096 static bool equal(const U& a, const V& b) { return a == b; } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1180 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { | 1180 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { |
| 1181 static_assert(sizeof(T), "T must be fully defined"); | 1181 static_assert(sizeof(T), "T must be fully defined"); |
| 1182 }; | 1182 }; |
| 1183 | 1183 |
| 1184 template<typename T> | 1184 template<typename T> |
| 1185 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 1185 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
| 1186 | 1186 |
| 1187 } // namespace WTF | 1187 } // namespace WTF |
| 1188 | 1188 |
| 1189 #endif | 1189 #endif |
| OLD | NEW |