OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 #include "vm/dart_api_impl.h" | 6 #include "vm/dart_api_impl.h" |
7 #include "vm/datastream.h" | 7 #include "vm/datastream.h" |
8 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/message.h" | 10 #include "vm/message.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 | 335 |
336 | 336 |
337 static void FilenameFinalizer(void* peer) { | 337 static void FilenameFinalizer(void* peer) { |
338 char* filename = reinterpret_cast<char*>(peer); | 338 char* filename = reinterpret_cast<char*>(peer); |
339 delete[] filename; | 339 delete[] filename; |
340 } | 340 } |
341 | 341 |
342 | 342 |
343 DEFINE_NATIVE_ENTRY(VMService_DecodeAssets, 1) { | 343 DEFINE_NATIVE_ENTRY(VMService_DecodeAssets, 1) { |
344 GET_NON_NULL_NATIVE_ARGUMENT(TypedData, data, arguments->NativeArgAt(0)); | 344 GET_NON_NULL_NATIVE_ARGUMENT(TypedData, data, arguments->NativeArgAt(0)); |
| 345 TransitionVMToNative transition(thread); |
345 Api::Scope scope(thread); | 346 Api::Scope scope(thread); |
346 | 347 |
347 Dart_Handle data_handle = Api::NewHandle(thread, data.raw()); | 348 Dart_Handle data_handle = Api::NewHandle(thread, data.raw()); |
348 | 349 |
349 Dart_TypedData_Type typ; | 350 Dart_TypedData_Type typ; |
350 void* bytes; | 351 void* bytes; |
351 intptr_t length; | 352 intptr_t length; |
352 Dart_Handle err = Dart_TypedDataAcquireData( | 353 Dart_Handle err = Dart_TypedDataAcquireData( |
353 data_handle, &typ, &bytes, &length); | 354 data_handle, &typ, &bytes, &length); |
354 ASSERT(!Dart_IsError(err)); | 355 ASSERT(!Dart_IsError(err)); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 thread->zone(), dart_filename)); | 388 thread->zone(), dart_filename)); |
388 result_list.SetAt(idx + 1, Api::UnwrapExternalTypedDataHandle( | 389 result_list.SetAt(idx + 1, Api::UnwrapExternalTypedDataHandle( |
389 thread->zone(), dart_contents)); | 390 thread->zone(), dart_contents)); |
390 idx += 2; | 391 idx += 2; |
391 } | 392 } |
392 | 393 |
393 return result_list.raw(); | 394 return result_list.raw(); |
394 } | 395 } |
395 | 396 |
396 } // namespace dart | 397 } // namespace dart |
OLD | NEW |