Chromium Code Reviews| Index: runtime/vm/dart_api_impl.cc |
| diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
| index cb5d584d94defbb8ce8e76e8412285428fb5cce5..a3f1ff35302605093e94f61b1455039e7dde9333 100644 |
| --- a/runtime/vm/dart_api_impl.cc |
| +++ b/runtime/vm/dart_api_impl.cc |
| @@ -3241,10 +3241,19 @@ DART_EXPORT Dart_TypedData_Type Dart_GetTypeOfExternalTypedData( |
| Dart_Handle object) { |
| TRACE_API_CALL(CURRENT_FUNC); |
| intptr_t class_id = Api::ClassId(object); |
| - if (RawObject::IsExternalTypedDataClassId(class_id) || |
| - RawObject::IsTypedDataViewClassId(class_id)) { |
| + if (RawObject::IsExternalTypedDataClassId(class_id)) { |
| return GetType(class_id); |
| } |
| + if (RawObject::IsTypedDataViewClassId(class_id)) { |
| + // Check if data object of the view is external. |
| + Isolate* isolate = Isolate::Current(); |
| + const Instance& view_obj = Api::UnwrapInstanceHandle(isolate, object); |
| + ASSERT(!view_obj.IsNull()); |
| + const Instance& data_obj = Instance::Handle(TypedDataView::Data(view_obj)); |
|
siva
2015/06/12 16:27:06
Since isolate is available why not use
Instance::H
|
| + if (ExternalTypedData::IsExternalTypedData(data_obj)) { |
| + return GetType(class_id); |
| + } |
| + } |
| return Dart_TypedData_kInvalid; |
| } |