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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 FATAL1("vm-service: Could not find embedded source file: %s ", buffer); | 310 FATAL1("vm-service: Could not find embedded source file: %s ", buffer); |
311 } | 311 } |
312 ASSERT(r != Resources::kNoSuchInstance); | 312 ASSERT(r != Resources::kNoSuchInstance); |
313 return Dart_NewStringFromCString(vmservice_source); | 313 return Dart_NewStringFromCString(vmservice_source); |
314 } | 314 } |
315 | 315 |
316 | 316 |
317 Dart_Handle VmService::LoadScript(const char* name) { | 317 Dart_Handle VmService::LoadScript(const char* name) { |
318 Dart_Handle uri = Dart_NewStringFromCString(kVMServiceIOLibraryUri); | 318 Dart_Handle uri = Dart_NewStringFromCString(kVMServiceIOLibraryUri); |
319 Dart_Handle source = GetSource(name); | 319 Dart_Handle source = GetSource(name); |
320 return Dart_LoadScript(uri, source, 0, 0); | 320 return Dart_LoadScript(uri, Dart_Null(), source, 0, 0); |
321 } | 321 } |
322 | 322 |
323 | 323 |
324 Dart_Handle VmService::LoadLibrary(const char* name) { | 324 Dart_Handle VmService::LoadLibrary(const char* name) { |
325 Dart_Handle uri = Dart_NewStringFromCString(kVMServiceIOLibraryUri); | 325 Dart_Handle uri = Dart_NewStringFromCString(kVMServiceIOLibraryUri); |
326 Dart_Handle source = GetSource(name); | 326 Dart_Handle source = GetSource(name); |
327 return Dart_LoadLibrary(uri, source, 0, 0); | 327 return Dart_LoadLibrary(uri, Dart_Null(), source, 0, 0); |
328 } | 328 } |
329 | 329 |
330 | 330 |
331 Dart_Handle VmService::LoadSource(Dart_Handle library, const char* name) { | 331 Dart_Handle VmService::LoadSource(Dart_Handle library, const char* name) { |
332 Dart_Handle uri = Dart_NewStringFromCString(name); | 332 Dart_Handle uri = Dart_NewStringFromCString(name); |
333 Dart_Handle source = GetSource(name); | 333 Dart_Handle source = GetSource(name); |
334 return Dart_LoadSource(library, uri, source, 0, 0); | 334 return Dart_LoadSource(library, uri, Dart_Null(), source, 0, 0); |
335 } | 335 } |
336 | 336 |
337 | 337 |
338 Dart_Handle VmService::LibraryTagHandler(Dart_LibraryTag tag, | 338 Dart_Handle VmService::LibraryTagHandler(Dart_LibraryTag tag, |
339 Dart_Handle library, | 339 Dart_Handle library, |
340 Dart_Handle url) { | 340 Dart_Handle url) { |
341 if (!Dart_IsLibrary(library)) { | 341 if (!Dart_IsLibrary(library)) { |
342 return Dart_NewApiError("not a library"); | 342 return Dart_NewApiError("not a library"); |
343 } | 343 } |
344 if (!Dart_IsString(url)) { | 344 if (!Dart_IsString(url)) { |
(...skipping 16 matching lines...) Expand all Loading... |
361 } | 361 } |
362 ASSERT((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); | 362 ASSERT((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); |
363 if (tag == Dart_kCanonicalizeUrl) { | 363 if (tag == Dart_kCanonicalizeUrl) { |
364 // url is already canonicalized. | 364 // url is already canonicalized. |
365 return url; | 365 return url; |
366 } | 366 } |
367 Dart_Handle source = GetSource(url_string); | 367 Dart_Handle source = GetSource(url_string); |
368 if (Dart_IsError(source)) { | 368 if (Dart_IsError(source)) { |
369 return source; | 369 return source; |
370 } | 370 } |
371 return Dart_LoadSource(library, url, source, 0, 0); | 371 return Dart_LoadSource(library, url, Dart_Null(), source, 0, 0); |
372 } | 372 } |
373 | 373 |
374 | 374 |
375 } // namespace bin | 375 } // namespace bin |
376 } // namespace dart | 376 } // namespace dart |
OLD | NEW |