| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "bin/vmservice_impl.h" | 5 #include "bin/vmservice_impl.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 | 8 |
| 9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
| 10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 &data_list_buffer_length); | 311 &data_list_buffer_length); |
| 312 RETURN_ERROR_HANDLE(result); | 312 RETURN_ERROR_HANDLE(result); |
| 313 ASSERT(data_buffer_length == data_list_buffer_length); | 313 ASSERT(data_buffer_length == data_list_buffer_length); |
| 314 ASSERT(data_list_buffer != NULL); | 314 ASSERT(data_list_buffer != NULL); |
| 315 ASSERT(type = Dart_TypedData_kUint8); | 315 ASSERT(type = Dart_TypedData_kUint8); |
| 316 memmove(data_list_buffer, &data_buffer[0], data_buffer_length); | 316 memmove(data_list_buffer, &data_buffer[0], data_buffer_length); |
| 317 result = Dart_TypedDataReleaseData(data_list); | 317 result = Dart_TypedDataReleaseData(data_list); |
| 318 RETURN_ERROR_HANDLE(result); | 318 RETURN_ERROR_HANDLE(result); |
| 319 | 319 |
| 320 // Make invoke call. | 320 // Make invoke call. |
| 321 const intptr_t kNumArgs = 2; | 321 const intptr_t kNumArgs = 3; |
| 322 Dart_Handle args[kNumArgs] = { name, data_list }; | 322 Dart_Handle compressed = Dart_True(); |
| 323 Dart_Handle args[kNumArgs] = { name, data_list, compressed }; |
| 323 result = Dart_Invoke(library, Dart_NewStringFromCString("_addResource"), | 324 result = Dart_Invoke(library, Dart_NewStringFromCString("_addResource"), |
| 324 kNumArgs, args); | 325 kNumArgs, args); |
| 325 return result; | 326 return result; |
| 326 } | 327 } |
| 327 | 328 |
| 328 | 329 |
| 329 Dart_Handle VmService::LoadResources(Dart_Handle library) { | 330 Dart_Handle VmService::LoadResources(Dart_Handle library) { |
| 330 Dart_Handle result = Dart_Null(); | 331 Dart_Handle result = Dart_Null(); |
| 331 intptr_t prefixLen = strlen(kLibrarySourceNamePrefix); | 332 intptr_t prefixLen = strlen(kLibrarySourceNamePrefix); |
| 332 for (intptr_t i = 0; Resources::Path(i) != NULL; i++) { | 333 for (intptr_t i = 0; Resources::Path(i) != NULL; i++) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 Dart_Handle source = GetSource(url_string); | 377 Dart_Handle source = GetSource(url_string); |
| 377 if (Dart_IsError(source)) { | 378 if (Dart_IsError(source)) { |
| 378 return source; | 379 return source; |
| 379 } | 380 } |
| 380 return Dart_LoadSource(library, url, source, 0, 0); | 381 return Dart_LoadSource(library, url, source, 0, 0); |
| 381 } | 382 } |
| 382 | 383 |
| 383 | 384 |
| 384 } // namespace bin | 385 } // namespace bin |
| 385 } // namespace dart | 386 } // namespace dart |
| OLD | NEW |