| 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 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 if (Dart_IsError(result)) { | 335 if (Dart_IsError(result)) { |
| 336 return result; | 336 return result; |
| 337 } | 337 } |
| 338 Dart_Handle library_url = Dart_LibraryUrl(library); | 338 Dart_Handle library_url = Dart_LibraryUrl(library); |
| 339 const char* library_url_string = NULL; | 339 const char* library_url_string = NULL; |
| 340 result = Dart_StringToCString(library_url, &library_url_string); | 340 result = Dart_StringToCString(library_url, &library_url_string); |
| 341 if (Dart_IsError(result)) { | 341 if (Dart_IsError(result)) { |
| 342 return result; | 342 return result; |
| 343 } | 343 } |
| 344 if (tag == Dart_kImportTag) { | 344 if (tag == Dart_kImportTag) { |
| 345 // Embedder handles all requests for external libraries. | 345 UNREACHABLE(); |
| 346 return DartUtils::LibraryTagHandler(tag, library, url); | 346 return Dart_Null(); |
| 347 } | 347 } |
| 348 ASSERT((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); | 348 ASSERT((tag == Dart_kSourceTag) || (tag == Dart_kCanonicalizeUrl)); |
| 349 if (tag == Dart_kCanonicalizeUrl) { | 349 if (tag == Dart_kCanonicalizeUrl) { |
| 350 // url is already canonicalized. | 350 // url is already canonicalized. |
| 351 return url; | 351 return url; |
| 352 } | 352 } |
| 353 Dart_Handle source = GetSource(url_string); | 353 Dart_Handle source = GetSource(url_string); |
| 354 if (Dart_IsError(source)) { | 354 if (Dart_IsError(source)) { |
| 355 return source; | 355 return source; |
| 356 } | 356 } |
| 357 return Dart_LoadSource(library, url, source, 0, 0); | 357 return Dart_LoadSource(library, url, source, 0, 0); |
| 358 } | 358 } |
| 359 | 359 |
| 360 | 360 |
| 361 } // namespace bin | 361 } // namespace bin |
| 362 } // namespace dart | 362 } // namespace dart |
| OLD | NEW |