| 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 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 static PeekOutType peek(const blink::WeakMember<T>& value) { return value; } | 1034 static PeekOutType peek(const blink::WeakMember<T>& value) { return value; } |
| 1035 static PassOutType passOut(const blink::WeakMember<T>& value) { return value
; } | 1035 static PassOutType passOut(const blink::WeakMember<T>& value) { return value
; } |
| 1036 | 1036 |
| 1037 template<typename VisitorDispatcher> | 1037 template<typename VisitorDispatcher> |
| 1038 static bool traceInCollection(VisitorDispatcher visitor, blink::WeakMember<T
>& weakMember, ShouldWeakPointersBeMarkedStrongly strongify) | 1038 static bool traceInCollection(VisitorDispatcher visitor, blink::WeakMember<T
>& weakMember, ShouldWeakPointersBeMarkedStrongly strongify) |
| 1039 { | 1039 { |
| 1040 if (strongify == WeakPointersActStrong) { | 1040 if (strongify == WeakPointersActStrong) { |
| 1041 visitor->trace(weakMember.get()); // Strongified visit. | 1041 visitor->trace(weakMember.get()); // Strongified visit. |
| 1042 return false; | 1042 return false; |
| 1043 } | 1043 } |
| 1044 return !visitor->isHeapObjectAlive(weakMember); | 1044 return !blink::Heap::isHeapObjectAlive(weakMember); |
| 1045 } | 1045 } |
| 1046 }; | 1046 }; |
| 1047 | 1047 |
| 1048 template<typename T> struct PtrHash<blink::Member<T>> : PtrHash<T*> { | 1048 template<typename T> struct PtrHash<blink::Member<T>> : PtrHash<T*> { |
| 1049 template<typename U> | 1049 template<typename U> |
| 1050 static unsigned hash(const U& key) { return PtrHash<T*>::hash(key); } | 1050 static unsigned hash(const U& key) { return PtrHash<T*>::hash(key); } |
| 1051 static bool equal(T* a, const blink::Member<T>& b) { return a == b; } | 1051 static bool equal(T* a, const blink::Member<T>& b) { return a == b; } |
| 1052 static bool equal(const blink::Member<T>& a, T* b) { return a == b; } | 1052 static bool equal(const blink::Member<T>& a, T* b) { return a == b; } |
| 1053 template<typename U, typename V> | 1053 template<typename U, typename V> |
| 1054 static bool equal(const U& a, const V& b) { return a == b; } | 1054 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... |
| 1138 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { | 1138 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { |
| 1139 static_assert(sizeof(T), "T must be fully defined"); | 1139 static_assert(sizeof(T), "T must be fully defined"); |
| 1140 }; | 1140 }; |
| 1141 | 1141 |
| 1142 template<typename T> | 1142 template<typename T> |
| 1143 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 1143 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
| 1144 | 1144 |
| 1145 } // namespace WTF | 1145 } // namespace WTF |
| 1146 | 1146 |
| 1147 #endif | 1147 #endif |
| OLD | NEW |