Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NativeValueTraitsImpl_h | 5 #ifndef NativeValueTraitsImpl_h |
| 6 #define NativeValueTraitsImpl_h | 6 #define NativeValueTraitsImpl_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/IDLTypes.h" | 8 #include "bindings/core/v8/IDLTypes.h" |
| 9 #include "bindings/core/v8/NativeValueTraits.h" | 9 #include "bindings/core/v8/NativeValueTraits.h" |
| 10 #include "bindings/core/v8/V8Binding.h" | 10 #include "bindings/core/v8/V8Binding.h" |
| 11 #include "core/CoreExport.h" | 11 #include "core/CoreExport.h" |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 // Boolean | 16 // Boolean |
| 17 template <> | 17 template <> |
| 18 struct NativeValueTraits<IDLBoolean> | 18 struct CORE_EXPORT NativeValueTraits<IDLBoolean> |
| 19 : public NativeValueTraitsBase<IDLBoolean> { | 19 : public NativeValueTraitsBase<IDLBoolean> { |
| 20 CORE_EXPORT static inline bool nativeValue(v8::Isolate* isolate, | 20 static inline bool nativeValue(v8::Isolate* isolate, |
| 21 v8::Local<v8::Value> value, | 21 v8::Local<v8::Value> value, |
| 22 ExceptionState& exceptionState) { | 22 ExceptionState& exceptionState) { |
| 23 return toBoolean(isolate, value, exceptionState); | 23 return toBoolean(isolate, value, exceptionState); |
| 24 } | 24 } |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // Integers | 27 // Integers |
| 28 // | 28 // |
| 29 // All integer specializations offer a second nativeValue() besides the default | 29 // All integer specializations offer a second nativeValue() besides the default |
| 30 // one: it takes an IntegerConversionConfiguration argument to let callers | 30 // one: it takes an IntegerConversionConfiguration argument to let callers |
| 31 // specify how the integers should be converted. The default nativeValue() | 31 // specify how the integers should be converted. The default nativeValue() |
| 32 // overload will always use NormalConversion. | 32 // overload will always use NormalConversion. |
| 33 template <> | 33 template <> |
| 34 struct NativeValueTraits<IDLByte> : public NativeValueTraitsBase<IDLByte> { | 34 struct CORE_EXPORT NativeValueTraits<IDLByte> |
| 35 CORE_EXPORT static inline int8_t nativeValue(v8::Isolate* isolate, | 35 : public NativeValueTraitsBase<IDLByte> { |
| 36 v8::Local<v8::Value> value, | 36 static inline int8_t nativeValue(v8::Isolate* isolate, |
| 37 ExceptionState& exceptionState) { | 37 v8::Local<v8::Value> value, |
| 38 ExceptionState& exceptionState) { | |
| 38 return nativeValue(isolate, value, exceptionState, NormalConversion); | 39 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 39 } | 40 } |
| 40 | 41 |
| 41 CORE_EXPORT static inline int8_t nativeValue( | 42 static inline int8_t nativeValue( |
| 42 v8::Isolate* isolate, | 43 v8::Isolate* isolate, |
| 43 v8::Local<v8::Value> value, | 44 v8::Local<v8::Value> value, |
| 44 ExceptionState& exceptionState, | 45 ExceptionState& exceptionState, |
| 45 IntegerConversionConfiguration conversionMode) { | 46 IntegerConversionConfiguration conversionMode) { |
| 46 return toInt8(isolate, value, conversionMode, exceptionState); | 47 return toInt8(isolate, value, conversionMode, exceptionState); |
| 47 } | 48 } |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 template <> | 51 template <> |
| 51 struct NativeValueTraits<IDLOctet> : public NativeValueTraitsBase<IDLOctet> { | 52 struct CORE_EXPORT NativeValueTraits<IDLOctet> |
| 52 CORE_EXPORT static inline uint8_t nativeValue( | 53 : public NativeValueTraitsBase<IDLOctet> { |
| 53 v8::Isolate* isolate, | 54 static inline uint8_t nativeValue(v8::Isolate* isolate, |
| 54 v8::Local<v8::Value> value, | 55 v8::Local<v8::Value> value, |
| 55 ExceptionState& exceptionState) { | 56 ExceptionState& exceptionState) { |
| 56 return nativeValue(isolate, value, exceptionState, NormalConversion); | 57 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 57 } | 58 } |
| 58 | 59 |
| 59 CORE_EXPORT static inline uint8_t nativeValue( | 60 static inline uint8_t nativeValue( |
| 60 v8::Isolate* isolate, | 61 v8::Isolate* isolate, |
| 61 v8::Local<v8::Value> value, | 62 v8::Local<v8::Value> value, |
| 62 ExceptionState& exceptionState, | 63 ExceptionState& exceptionState, |
| 63 IntegerConversionConfiguration conversionMode) { | 64 IntegerConversionConfiguration conversionMode) { |
| 64 return toUInt8(isolate, value, conversionMode, exceptionState); | 65 return toUInt8(isolate, value, conversionMode, exceptionState); |
| 65 } | 66 } |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 template <> | 69 template <> |
| 69 struct NativeValueTraits<IDLShort> : public NativeValueTraitsBase<IDLShort> { | 70 struct CORE_EXPORT NativeValueTraits<IDLShort> |
| 70 CORE_EXPORT static inline int16_t nativeValue( | 71 : public NativeValueTraitsBase<IDLShort> { |
| 71 v8::Isolate* isolate, | 72 static inline int16_t nativeValue(v8::Isolate* isolate, |
| 72 v8::Local<v8::Value> value, | 73 v8::Local<v8::Value> value, |
| 73 ExceptionState& exceptionState) { | 74 ExceptionState& exceptionState) { |
| 74 return nativeValue(isolate, value, exceptionState, NormalConversion); | 75 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 75 } | 76 } |
| 76 | 77 |
| 77 CORE_EXPORT static inline int16_t nativeValue( | 78 static inline int16_t nativeValue( |
| 78 v8::Isolate* isolate, | 79 v8::Isolate* isolate, |
| 79 v8::Local<v8::Value> value, | 80 v8::Local<v8::Value> value, |
| 80 ExceptionState& exceptionState, | 81 ExceptionState& exceptionState, |
| 81 IntegerConversionConfiguration conversionMode) { | 82 IntegerConversionConfiguration conversionMode) { |
| 82 return toInt16(isolate, value, conversionMode, exceptionState); | 83 return toInt16(isolate, value, conversionMode, exceptionState); |
| 83 } | 84 } |
| 84 }; | 85 }; |
| 85 | 86 |
| 86 template <> | 87 template <> |
| 87 struct NativeValueTraits<IDLUnsignedShort> | 88 struct CORE_EXPORT NativeValueTraits<IDLUnsignedShort> |
| 88 : public NativeValueTraitsBase<IDLUnsignedShort> { | 89 : public NativeValueTraitsBase<IDLUnsignedShort> { |
| 89 CORE_EXPORT static inline uint16_t nativeValue( | 90 static inline uint16_t nativeValue(v8::Isolate* isolate, |
| 90 v8::Isolate* isolate, | 91 v8::Local<v8::Value> value, |
| 91 v8::Local<v8::Value> value, | 92 ExceptionState& exceptionState) { |
| 92 ExceptionState& exceptionState) { | |
| 93 return nativeValue(isolate, value, exceptionState, NormalConversion); | 93 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 94 } | 94 } |
| 95 | 95 |
| 96 CORE_EXPORT static inline uint16_t nativeValue( | 96 static inline uint16_t nativeValue( |
| 97 v8::Isolate* isolate, | 97 v8::Isolate* isolate, |
| 98 v8::Local<v8::Value> value, | 98 v8::Local<v8::Value> value, |
| 99 ExceptionState& exceptionState, | 99 ExceptionState& exceptionState, |
| 100 IntegerConversionConfiguration conversionMode) { | 100 IntegerConversionConfiguration conversionMode) { |
| 101 return toUInt16(isolate, value, conversionMode, exceptionState); | 101 return toUInt16(isolate, value, conversionMode, exceptionState); |
| 102 } | 102 } |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 template <> | 105 template <> |
| 106 struct NativeValueTraits<IDLLong> : public NativeValueTraitsBase<IDLLong> { | 106 struct CORE_EXPORT NativeValueTraits<IDLLong> |
| 107 CORE_EXPORT static inline int32_t nativeValue( | 107 : public NativeValueTraitsBase<IDLLong> { |
| 108 v8::Isolate* isolate, | 108 static inline int32_t nativeValue(v8::Isolate* isolate, |
| 109 v8::Local<v8::Value> value, | 109 v8::Local<v8::Value> value, |
| 110 ExceptionState& exceptionState) { | 110 ExceptionState& exceptionState) { |
| 111 return nativeValue(isolate, value, exceptionState, NormalConversion); | 111 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 112 } | 112 } |
| 113 | 113 |
| 114 CORE_EXPORT static inline int32_t nativeValue( | 114 static inline int32_t nativeValue( |
| 115 v8::Isolate* isolate, | 115 v8::Isolate* isolate, |
| 116 v8::Local<v8::Value> value, | 116 v8::Local<v8::Value> value, |
| 117 ExceptionState& exceptionState, | 117 ExceptionState& exceptionState, |
| 118 IntegerConversionConfiguration conversionMode) { | 118 IntegerConversionConfiguration conversionMode) { |
| 119 return toInt32(isolate, value, conversionMode, exceptionState); | 119 return toInt32(isolate, value, conversionMode, exceptionState); |
| 120 } | 120 } |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 template <> | 123 template <> |
| 124 struct NativeValueTraits<IDLUnsignedLong> | 124 struct CORE_EXPORT NativeValueTraits<IDLUnsignedLong> |
| 125 : public NativeValueTraitsBase<IDLUnsignedLong> { | 125 : public NativeValueTraitsBase<IDLUnsignedLong> { |
| 126 CORE_EXPORT static inline uint32_t nativeValue( | 126 static inline uint32_t nativeValue(v8::Isolate* isolate, |
| 127 v8::Isolate* isolate, | 127 v8::Local<v8::Value> value, |
| 128 v8::Local<v8::Value> value, | 128 ExceptionState& exceptionState) { |
| 129 ExceptionState& exceptionState) { | |
| 130 return nativeValue(isolate, value, exceptionState, NormalConversion); | 129 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 131 } | 130 } |
| 132 | 131 |
| 133 CORE_EXPORT static inline uint32_t nativeValue( | 132 static inline uint32_t nativeValue( |
| 134 v8::Isolate* isolate, | 133 v8::Isolate* isolate, |
| 135 v8::Local<v8::Value> value, | 134 v8::Local<v8::Value> value, |
| 136 ExceptionState& exceptionState, | 135 ExceptionState& exceptionState, |
| 137 IntegerConversionConfiguration conversionMode) { | 136 IntegerConversionConfiguration conversionMode) { |
| 138 return toUInt32(isolate, value, conversionMode, exceptionState); | 137 return toUInt32(isolate, value, conversionMode, exceptionState); |
| 139 } | 138 } |
| 140 }; | 139 }; |
| 141 | 140 |
| 142 template <> | 141 template <> |
| 143 struct NativeValueTraits<IDLLongLong> | 142 struct CORE_EXPORT NativeValueTraits<IDLLongLong> |
| 144 : public NativeValueTraitsBase<IDLLongLong> { | 143 : public NativeValueTraitsBase<IDLLongLong> { |
| 145 CORE_EXPORT static inline int64_t nativeValue( | 144 static inline int64_t nativeValue(v8::Isolate* isolate, |
| 146 v8::Isolate* isolate, | 145 v8::Local<v8::Value> value, |
| 147 v8::Local<v8::Value> value, | 146 ExceptionState& exceptionState) { |
| 148 ExceptionState& exceptionState) { | |
| 149 return nativeValue(isolate, value, exceptionState, NormalConversion); | 147 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 150 } | 148 } |
| 151 | 149 |
| 152 CORE_EXPORT static inline int64_t nativeValue( | 150 static inline int64_t nativeValue( |
| 153 v8::Isolate* isolate, | 151 v8::Isolate* isolate, |
| 154 v8::Local<v8::Value> value, | 152 v8::Local<v8::Value> value, |
| 155 ExceptionState& exceptionState, | 153 ExceptionState& exceptionState, |
| 156 IntegerConversionConfiguration conversionMode) { | 154 IntegerConversionConfiguration conversionMode) { |
| 157 return toInt64(isolate, value, conversionMode, exceptionState); | 155 return toInt64(isolate, value, conversionMode, exceptionState); |
| 158 } | 156 } |
| 159 }; | 157 }; |
| 160 | 158 |
| 161 template <> | 159 template <> |
| 162 struct NativeValueTraits<IDLUnsignedLongLong> | 160 struct CORE_EXPORT NativeValueTraits<IDLUnsignedLongLong> |
| 163 : public NativeValueTraitsBase<IDLUnsignedLongLong> { | 161 : public NativeValueTraitsBase<IDLUnsignedLongLong> { |
| 164 CORE_EXPORT static inline uint64_t nativeValue( | 162 static inline uint64_t nativeValue(v8::Isolate* isolate, |
| 165 v8::Isolate* isolate, | 163 v8::Local<v8::Value> value, |
| 166 v8::Local<v8::Value> value, | 164 ExceptionState& exceptionState) { |
| 167 ExceptionState& exceptionState) { | |
| 168 return nativeValue(isolate, value, exceptionState, NormalConversion); | 165 return nativeValue(isolate, value, exceptionState, NormalConversion); |
| 169 } | 166 } |
| 170 | 167 |
| 171 CORE_EXPORT static inline uint64_t nativeValue( | 168 static inline uint64_t nativeValue( |
| 172 v8::Isolate* isolate, | 169 v8::Isolate* isolate, |
| 173 v8::Local<v8::Value> value, | 170 v8::Local<v8::Value> value, |
| 174 ExceptionState& exceptionState, | 171 ExceptionState& exceptionState, |
| 175 IntegerConversionConfiguration conversionMode) { | 172 IntegerConversionConfiguration conversionMode) { |
| 176 return toUInt64(isolate, value, conversionMode, exceptionState); | 173 return toUInt64(isolate, value, conversionMode, exceptionState); |
| 177 } | 174 } |
| 178 }; | 175 }; |
| 179 | 176 |
| 180 // Strings | 177 // Strings |
| 181 template <> | 178 template <> |
| 182 struct NativeValueTraits<IDLByteString> | 179 struct CORE_EXPORT NativeValueTraits<IDLByteString> |
| 183 : public NativeValueTraitsBase<IDLByteString> { | 180 : public NativeValueTraitsBase<IDLByteString> { |
| 184 CORE_EXPORT static inline String nativeValue(v8::Isolate* isolate, | 181 static inline String nativeValue(v8::Isolate* isolate, |
| 185 v8::Local<v8::Value> value, | 182 v8::Local<v8::Value> value, |
| 186 ExceptionState& exceptionState) { | 183 ExceptionState& exceptionState) { |
| 187 return toByteString(isolate, value, exceptionState); | 184 return toByteString(isolate, value, exceptionState); |
| 188 } | 185 } |
| 189 }; | 186 }; |
| 190 | 187 |
| 191 template <> | 188 template <> |
| 192 struct NativeValueTraits<IDLString> : public NativeValueTraitsBase<IDLString> { | 189 struct CORE_EXPORT NativeValueTraits<IDLString> |
| 193 CORE_EXPORT static inline String nativeValue(v8::Isolate* isolate, | 190 : public NativeValueTraitsBase<IDLString> { |
| 194 v8::Local<v8::Value> value, | 191 static inline String nativeValue(v8::Isolate* isolate, |
| 195 ExceptionState& exceptionState) { | 192 v8::Local<v8::Value> value, |
| 193 ExceptionState& exceptionState) { | |
| 196 return nativeValue<V8StringResourceMode::DefaultMode>(isolate, value, | 194 return nativeValue<V8StringResourceMode::DefaultMode>(isolate, value, |
| 197 exceptionState); | 195 exceptionState); |
| 198 } | 196 } |
| 199 | 197 |
| 200 template <V8StringResourceMode Mode = DefaultMode> | 198 template <V8StringResourceMode Mode = DefaultMode> |
| 201 CORE_EXPORT static inline String nativeValue(v8::Isolate* isolate, | 199 static inline String nativeValue(v8::Isolate* isolate, |
| 202 v8::Local<v8::Value> value, | 200 v8::Local<v8::Value> value, |
| 203 ExceptionState& exceptionState) { | 201 ExceptionState& exceptionState) { |
| 204 V8StringResource<Mode> string(value); | 202 V8StringResource<Mode> string(value); |
| 205 if (!string.prepare(isolate, exceptionState)) | 203 if (!string.prepare(isolate, exceptionState)) |
| 206 return String(); | 204 return String(); |
| 207 return string; | 205 return string; |
| 208 } | 206 } |
| 209 }; | 207 }; |
| 210 | 208 |
| 211 template <> | 209 template <> |
| 212 struct NativeValueTraits<IDLUSVString> | 210 struct CORE_EXPORT NativeValueTraits<IDLUSVString> |
| 213 : public NativeValueTraitsBase<IDLUSVString> { | 211 : public NativeValueTraitsBase<IDLUSVString> { |
| 214 CORE_EXPORT static inline String nativeValue(v8::Isolate* isolate, | 212 static inline String nativeValue(v8::Isolate* isolate, |
| 215 v8::Local<v8::Value> value, | 213 v8::Local<v8::Value> value, |
| 216 ExceptionState& exceptionState) { | 214 ExceptionState& exceptionState) { |
| 217 return toUSVString(isolate, value, exceptionState); | 215 return toUSVString(isolate, value, exceptionState); |
| 218 } | 216 } |
| 219 }; | 217 }; |
| 220 | 218 |
| 221 // Floats and doubles | 219 // Floats and doubles |
| 222 template <> | 220 template <> |
| 223 struct NativeValueTraits<IDLDouble> : public NativeValueTraitsBase<IDLDouble> { | 221 struct CORE_EXPORT NativeValueTraits<IDLDouble> |
| 224 CORE_EXPORT static inline double nativeValue(v8::Isolate* isolate, | 222 : public NativeValueTraitsBase<IDLDouble> { |
| 225 v8::Local<v8::Value> value, | 223 static inline double nativeValue(v8::Isolate* isolate, |
| 226 ExceptionState& exceptionState) { | 224 v8::Local<v8::Value> value, |
| 225 ExceptionState& exceptionState) { | |
| 227 return toRestrictedDouble(isolate, value, exceptionState); | 226 return toRestrictedDouble(isolate, value, exceptionState); |
| 228 } | 227 } |
| 229 }; | 228 }; |
| 230 | 229 |
| 231 template <> | 230 template <> |
| 232 struct NativeValueTraits<IDLUnrestrictedDouble> | 231 struct CORE_EXPORT NativeValueTraits<IDLUnrestrictedDouble> |
| 233 : public NativeValueTraitsBase<IDLUnrestrictedDouble> { | 232 : public NativeValueTraitsBase<IDLUnrestrictedDouble> { |
| 234 CORE_EXPORT static inline double nativeValue(v8::Isolate* isolate, | 233 static inline double nativeValue(v8::Isolate* isolate, |
| 235 v8::Local<v8::Value> value, | 234 v8::Local<v8::Value> value, |
| 236 ExceptionState& exceptionState) { | 235 ExceptionState& exceptionState) { |
| 237 return toDouble(isolate, value, exceptionState); | 236 return toDouble(isolate, value, exceptionState); |
| 238 } | 237 } |
| 239 }; | 238 }; |
| 240 | 239 |
| 241 template <> | 240 template <> |
| 242 struct NativeValueTraits<IDLFloat> : public NativeValueTraitsBase<IDLFloat> { | 241 struct CORE_EXPORT NativeValueTraits<IDLFloat> |
| 243 CORE_EXPORT static inline float nativeValue(v8::Isolate* isolate, | 242 : public NativeValueTraitsBase<IDLFloat> { |
| 244 v8::Local<v8::Value> value, | 243 static inline float nativeValue(v8::Isolate* isolate, |
| 245 ExceptionState& exceptionState) { | 244 v8::Local<v8::Value> value, |
| 245 ExceptionState& exceptionState) { | |
| 246 return toRestrictedFloat(isolate, value, exceptionState); | 246 return toRestrictedFloat(isolate, value, exceptionState); |
| 247 } | 247 } |
| 248 }; | 248 }; |
| 249 | 249 |
| 250 template <> | 250 template <> |
| 251 struct NativeValueTraits<IDLUnrestrictedFloat> | 251 struct CORE_EXPORT NativeValueTraits<IDLUnrestrictedFloat> |
| 252 : public NativeValueTraitsBase<IDLUnrestrictedFloat> { | 252 : public NativeValueTraitsBase<IDLUnrestrictedFloat> { |
| 253 CORE_EXPORT static inline float nativeValue(v8::Isolate* isolate, | 253 static inline float nativeValue(v8::Isolate* isolate, |
| 254 v8::Local<v8::Value> value, | 254 v8::Local<v8::Value> value, |
| 255 ExceptionState& exceptionState) { | 255 ExceptionState& exceptionState) { |
| 256 return toFloat(isolate, value, exceptionState); | 256 return toFloat(isolate, value, exceptionState); |
| 257 } | 257 } |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 // Promises | 260 // Promises |
| 261 template <> | 261 template <> |
| 262 struct NativeValueTraits<IDLPromise> | 262 struct CORE_EXPORT NativeValueTraits<IDLPromise> |
| 263 : public NativeValueTraitsBase<IDLPromise> { | 263 : public NativeValueTraitsBase<IDLPromise> { |
| 264 CORE_EXPORT static inline ScriptPromise nativeValue( | 264 static inline ScriptPromise nativeValue(v8::Isolate* isolate, |
| 265 v8::Isolate* isolate, | 265 v8::Local<v8::Value> value, |
| 266 v8::Local<v8::Value> value, | 266 ExceptionState& exceptionState) { |
| 267 ExceptionState& exceptionState) { | |
| 268 return nativeValue(isolate, value); | 267 return nativeValue(isolate, value); |
| 269 } | 268 } |
| 270 | 269 |
| 271 CORE_EXPORT static inline ScriptPromise nativeValue( | 270 static inline ScriptPromise nativeValue(v8::Isolate* isolate, |
| 272 v8::Isolate* isolate, | 271 v8::Local<v8::Value> value) { |
| 273 v8::Local<v8::Value> value) { | |
| 274 return ScriptPromise::cast(ScriptState::current(isolate), value); | 272 return ScriptPromise::cast(ScriptState::current(isolate), value); |
| 275 } | 273 } |
| 276 }; | 274 }; |
| 277 | 275 |
| 278 // Type-specific overloads | 276 // Type-specific overloads |
| 279 template <> | 277 template <> |
| 280 struct NativeValueTraits<IDLDate> : public NativeValueTraitsBase<IDLDate> { | 278 struct CORE_EXPORT NativeValueTraits<IDLDate> |
| 281 CORE_EXPORT static inline double nativeValue(v8::Isolate* isolate, | 279 : public NativeValueTraitsBase<IDLDate> { |
| 282 v8::Local<v8::Value> value, | 280 static inline double nativeValue(v8::Isolate* isolate, |
| 283 ExceptionState& exceptionState) { | 281 v8::Local<v8::Value> value, |
| 282 ExceptionState& exceptionState) { | |
| 284 return toCoreDate(isolate, value, exceptionState); | 283 return toCoreDate(isolate, value, exceptionState); |
| 285 } | 284 } |
| 286 }; | 285 }; |
| 287 | 286 |
| 288 // Sequences | 287 // Sequences |
| 289 template <typename T> | 288 template <typename T> |
| 290 struct NativeValueTraits<IDLSequence<T>> | 289 struct NativeValueTraits<IDLSequence<T>> |
|
Yuki
2017/03/09 07:55:29
I think that you need CORE_TEMPLATE_CLASS_EXPORT h
Raphael Kubo da Costa (rakuco)
2017/03/09 08:34:49
This was all quite confusing and I'm still not 100
Yuki
2017/03/09 08:41:06
Good to know. You should be right.
| |
| 291 : public NativeValueTraitsBase<IDLSequence<T>> { | 290 : public NativeValueTraitsBase<IDLSequence<T>> { |
| 292 // Nondependent types need to be explicitly qualified to be accessible. | 291 // Nondependent types need to be explicitly qualified to be accessible. |
| 293 using typename NativeValueTraitsBase<IDLSequence<T>>::ImplType; | 292 using typename NativeValueTraitsBase<IDLSequence<T>>::ImplType; |
| 294 | 293 |
| 295 CORE_EXPORT static inline ImplType nativeValue( | 294 static inline ImplType nativeValue(v8::Isolate* isolate, |
| 296 v8::Isolate* isolate, | 295 v8::Local<v8::Value> value, |
| 297 v8::Local<v8::Value> value, | 296 ExceptionState& exceptionState) { |
| 298 ExceptionState& exceptionState) { | |
| 299 return nativeValue(isolate, value, exceptionState, 0); | 297 return nativeValue(isolate, value, exceptionState, 0); |
| 300 } | 298 } |
| 301 | 299 |
| 302 CORE_EXPORT static inline ImplType nativeValue(v8::Isolate* isolate, | 300 static inline ImplType nativeValue(v8::Isolate* isolate, |
| 303 v8::Local<v8::Value> value, | 301 v8::Local<v8::Value> value, |
| 304 ExceptionState& exceptionState, | 302 ExceptionState& exceptionState, |
| 305 int index) { | 303 int index) { |
| 306 return toImplArray<ImplType, T>(value, index, isolate, exceptionState); | 304 return toImplArray<ImplType, T>(value, index, isolate, exceptionState); |
| 307 } | 305 } |
| 308 }; | 306 }; |
| 309 | 307 |
| 310 } // namespace blink | 308 } // namespace blink |
| 311 | 309 |
| 312 #endif // NativeValueTraitsImpl_h | 310 #endif // NativeValueTraitsImpl_h |
| OLD | NEW |