Changeset 207791 in webkit
- Timestamp:
- Oct 24, 2016 5:16:29 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r207789 r207791 1 2016-10-24 Chris Dumez <cdumez@apple.com> 2 3 Reduce special handling for typed arrays in JSDOMConvert.h 4 https://bugs.webkit.org/show_bug.cgi?id=163907 5 6 Reviewed by Sam Weinig. 7 8 Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static 9 function on JSGenericTypedArrayView, similarly to other wrapper types. 10 11 * runtime/JSGenericTypedArrayView.h: 12 (JSC::JSGenericTypedArrayView::typedImpl): 13 (JSC::JSGenericTypedArrayView<Adaptor>::toWrapped): 14 1 15 2016-10-24 Yusuke Suzuki <utatane.tea@gmail.com> 2 16 -
trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
r207411 r207791 226 226 bool set(ExecState*, unsigned offset, JSObject*, unsigned objectOffset, unsigned length, CopyType type = CopyType::Unobservable); 227 227 228 PassRefPtr<typename Adaptor::ViewType> typedImpl()228 RefPtr<typename Adaptor::ViewType> typedImpl() 229 229 { 230 230 return Adaptor::ViewType::create(buffer(), byteOffset(), length()); 231 231 } 232 233 static RefPtr<typename Adaptor::ViewType> toWrapped(JSValue); 232 234 233 235 static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype) … … 368 370 } 369 371 372 template<typename Adaptor> 373 RefPtr<typename Adaptor::ViewType> JSGenericTypedArrayView<Adaptor>::toWrapped(JSValue value) 374 { 375 return JSC::toNativeTypedView<Adaptor>(value); 376 } 377 370 378 } // namespace JSC -
trunk/Source/WebCore/ChangeLog
r207790 r207791 1 2016-10-24 Chris Dumez <cdumez@apple.com> 2 3 Reduce special handling for typed arrays in JSDOMConvert.h 4 https://bugs.webkit.org/show_bug.cgi?id=163907 5 6 Reviewed by Sam Weinig. 7 8 Reduce special handling for typed arrays in JSDOMConvert.h by adding a toWrapped() static 9 function on JSGenericTypedArrayView, similarly to other wrapper types. 10 11 No new tests, no web-exposed behavior change. 12 13 * bindings/js/JSDOMConvert.h: 14 (WebCore::Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>>::convert): Deleted. 15 1 16 2016-10-24 Ryan Haddad <ryanhaddad@apple.com> 2 17 -
trunk/Source/WebCore/bindings/js/JSDOMConvert.h
r207737 r207791 236 236 }; 237 237 238 // Typed arrays support. 239 template<typename Adaptor> struct JSDOMWrapperConverterTraits<JSC::GenericTypedArrayView<Adaptor>> { 240 using WrapperClass = JSC::JSGenericTypedArrayView<Adaptor>; 241 using ToWrappedReturnType = RefPtr<JSC::GenericTypedArrayView<Adaptor>>; 242 }; 243 238 244 // MARK: - 239 245 // MARK: Interface type … … 262 268 { 263 269 return toJS(&exec, &globalObject, WTF::getPtr(value)); 264 }265 };266 267 // Typed arrays support.268 269 template<typename Adaptor> struct IDLInterface<JSC::GenericTypedArrayView<Adaptor>> : IDLType<Ref<JSC::GenericTypedArrayView<Adaptor>>> {270 using RawType = JSC::GenericTypedArrayView<Adaptor>;271 using NullableType = RefPtr<JSC::GenericTypedArrayView<Adaptor>>;272 };273 274 template<typename Adaptor> struct Converter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>> : DefaultConverter<IDLInterface<JSC::GenericTypedArrayView<Adaptor>>> {275 using ReturnType = RefPtr<JSC::GenericTypedArrayView<Adaptor>>;276 277 static ReturnType convert(JSC::ExecState& state, JSC::JSValue value)278 {279 JSC::VM& vm = state.vm();280 auto scope = DECLARE_THROW_SCOPE(vm);281 ReturnType object = JSC::toNativeTypedView<Adaptor>(value);282 if (!object)283 throwTypeError(&state, scope);284 return object;285 270 } 286 271 };
Note: See TracChangeset
for help on using the changeset viewer.