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 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 // FIXME: The distinction between PeekInType and PassInType is there for | 1043 // FIXME: The distinction between PeekInType and PassInType is there for |
1044 // the sake of the reference counting handles. When they are gone the two | 1044 // the sake of the reference counting handles. When they are gone the two |
1045 // types can be merged into PassInType. | 1045 // types can be merged into PassInType. |
1046 // FIXME: Implement proper const'ness for iterator types. Requires support | 1046 // FIXME: Implement proper const'ness for iterator types. Requires support |
1047 // in the marking Visitor. | 1047 // in the marking Visitor. |
1048 using PeekInType = RawPtr<T>; | 1048 using PeekInType = RawPtr<T>; |
1049 using PassInType = RawPtr<T>; | 1049 using PassInType = RawPtr<T>; |
1050 using IteratorGetType = blink::Member<T>*; | 1050 using IteratorGetType = blink::Member<T>*; |
1051 using IteratorConstGetType = const blink::Member<T>*; | 1051 using IteratorConstGetType = const blink::Member<T>*; |
1052 using IteratorReferenceType = blink::Member<T>&; | 1052 using IteratorReferenceType = blink::Member<T>&; |
1053 using IteratorConstReferenceType = T* const; | 1053 using IteratorConstReferenceType = const blink::Member<T>&; |
1054 static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { r
eturn *x; } | 1054 static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { r
eturn *x; } |
1055 static IteratorConstReferenceType getToReferenceConstConversion(IteratorCons
tGetType x) { return x->get(); } | 1055 static IteratorConstReferenceType getToReferenceConstConversion(IteratorCons
tGetType x) { return *x; } |
1056 // FIXME: Similarly, there is no need for a distinction between PeekOutType | 1056 // FIXME: Similarly, there is no need for a distinction between PeekOutType |
1057 // and PassOutType without reference counting. | 1057 // and PassOutType without reference counting. |
1058 using PeekOutType = T*; | 1058 using PeekOutType = T*; |
1059 using PassOutType = T*; | 1059 using PassOutType = T*; |
1060 | 1060 |
1061 template<typename U> | 1061 template<typename U> |
1062 static void store(const U& value, blink::Member<T>& storage) { storage = val
ue; } | 1062 static void store(const U& value, blink::Member<T>& storage) { storage = val
ue; } |
1063 | 1063 |
1064 static PeekOutType peek(const blink::Member<T>& value) { return value; } | 1064 static PeekOutType peek(const blink::Member<T>& value) { return value; } |
1065 static PassOutType passOut(const blink::Member<T>& value) { return value; } | 1065 static PassOutType passOut(const blink::Member<T>& value) { return value; } |
1066 }; | 1066 }; |
1067 | 1067 |
1068 template<typename T> struct HashTraits<blink::WeakMember<T>> : SimpleClassHashTr
aits<blink::WeakMember<T>> { | 1068 template<typename T> struct HashTraits<blink::WeakMember<T>> : SimpleClassHashTr
aits<blink::WeakMember<T>> { |
1069 static const bool needsDestruction = false; | 1069 static const bool needsDestruction = false; |
1070 // FIXME: The distinction between PeekInType and PassInType is there for | 1070 // FIXME: The distinction between PeekInType and PassInType is there for |
1071 // the sake of the reference counting handles. When they are gone the two | 1071 // the sake of the reference counting handles. When they are gone the two |
1072 // types can be merged into PassInType. | 1072 // types can be merged into PassInType. |
1073 // FIXME: Implement proper const'ness for iterator types. Requires support | 1073 // FIXME: Implement proper const'ness for iterator types. Requires support |
1074 // in the marking Visitor. | 1074 // in the marking Visitor. |
1075 using PeekInType = RawPtr<T>; | 1075 using PeekInType = RawPtr<T>; |
1076 using PassInType = RawPtr<T>; | 1076 using PassInType = RawPtr<T>; |
1077 using IteratorGetType = blink::WeakMember<T>*; | 1077 using IteratorGetType = blink::WeakMember<T>*; |
1078 using IteratorConstGetType = const blink::WeakMember<T>*; | 1078 using IteratorConstGetType = const blink::WeakMember<T>*; |
1079 using IteratorReferenceType = blink::WeakMember<T>&; | 1079 using IteratorReferenceType = blink::WeakMember<T>&; |
1080 using IteratorConstReferenceType = T* const; | 1080 using IteratorConstReferenceType = const blink::WeakMember<T>&; |
1081 static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { r
eturn *x; } | 1081 static IteratorReferenceType getToReferenceConversion(IteratorGetType x) { r
eturn *x; } |
1082 static IteratorConstReferenceType getToReferenceConstConversion(IteratorCons
tGetType x) { return x->get(); } | 1082 static IteratorConstReferenceType getToReferenceConstConversion(IteratorCons
tGetType x) { return *x; } |
1083 // FIXME: Similarly, there is no need for a distinction between PeekOutType | 1083 // FIXME: Similarly, there is no need for a distinction between PeekOutType |
1084 // and PassOutType without reference counting. | 1084 // and PassOutType without reference counting. |
1085 using PeekOutType = T*; | 1085 using PeekOutType = T*; |
1086 using PassOutType = T*; | 1086 using PassOutType = T*; |
1087 | 1087 |
1088 template<typename U> | 1088 template<typename U> |
1089 static void store(const U& value, blink::WeakMember<T>& storage) { storage =
value; } | 1089 static void store(const U& value, blink::WeakMember<T>& storage) { storage =
value; } |
1090 | 1090 |
1091 static PeekOutType peek(const blink::WeakMember<T>& value) { return value; } | 1091 static PeekOutType peek(const blink::WeakMember<T>& value) { return value; } |
1092 static PassOutType passOut(const blink::WeakMember<T>& value) { return value
; } | 1092 static PassOutType passOut(const blink::WeakMember<T>& value) { return value
; } |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 template<typename T> | 1188 template<typename T> |
1189 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { | 1189 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { |
1190 }; | 1190 }; |
1191 | 1191 |
1192 template<typename T> | 1192 template<typename T> |
1193 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 1193 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
1194 | 1194 |
1195 } // namespace WTF | 1195 } // namespace WTF |
1196 | 1196 |
1197 #endif | 1197 #endif |
OLD | NEW |