| 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| (...skipping 5153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5164 | 5164 |
| 5165 DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler( | 5165 DART_EXPORT Dart_Handle Dart_SetLibraryTagHandler( |
| 5166 Dart_LibraryTagHandler handler) { | 5166 Dart_LibraryTagHandler handler) { |
| 5167 Isolate* isolate = Isolate::Current(); | 5167 Isolate* isolate = Isolate::Current(); |
| 5168 CHECK_ISOLATE(isolate); | 5168 CHECK_ISOLATE(isolate); |
| 5169 isolate->set_library_tag_handler(handler); | 5169 isolate->set_library_tag_handler(handler); |
| 5170 return Api::Success(); | 5170 return Api::Success(); |
| 5171 } | 5171 } |
| 5172 | 5172 |
| 5173 | 5173 |
| 5174 DART_EXPORT Dart_Handle Dart_DefaultCanonicalizeUrl(Dart_Handle library, | 5174 DART_EXPORT Dart_Handle Dart_DefaultCanonicalizeUrl(Dart_Handle library_url, |
| 5175 Dart_Handle url) { | 5175 Dart_Handle url) { |
| 5176 API_TIMELINE_DURATION; | 5176 API_TIMELINE_DURATION; |
| 5177 DARTSCOPE(Thread::Current()); | 5177 DARTSCOPE(Thread::Current()); |
| 5178 CHECK_CALLBACK_STATE(T); | 5178 CHECK_CALLBACK_STATE(T); |
| 5179 | 5179 |
| 5180 const Library& lib = Api::UnwrapLibraryHandle(Z, library); | 5180 const String& lib_uri = Api::UnwrapStringHandle(Z, library_url); |
| 5181 if (lib.IsNull()) { | 5181 if (lib_uri.IsNull()) { |
| 5182 RETURN_TYPE_ERROR(Z, library, Library); | 5182 RETURN_TYPE_ERROR(Z, library_url, String); |
| 5183 } | 5183 } |
| 5184 const String& uri = Api::UnwrapStringHandle(Z, url); | 5184 const String& uri = Api::UnwrapStringHandle(Z, url); |
| 5185 if (uri.IsNull()) { | 5185 if (uri.IsNull()) { |
| 5186 RETURN_TYPE_ERROR(Z, url, String); | 5186 RETURN_TYPE_ERROR(Z, url, String); |
| 5187 } | 5187 } |
| 5188 | 5188 |
| 5189 const String& lib_uri = String::Handle(Z, lib.url()); | |
| 5190 const char* resolved_uri; | 5189 const char* resolved_uri; |
| 5191 if (!ResolveUri(uri.ToCString(), lib_uri.ToCString(), &resolved_uri)) { | 5190 if (!ResolveUri(uri.ToCString(), lib_uri.ToCString(), &resolved_uri)) { |
| 5192 return Api::NewError("%s: Unable to canonicalize uri '%s'.", | 5191 return Api::NewError("%s: Unable to canonicalize uri '%s'.", |
| 5193 CURRENT_FUNC, uri.ToCString()); | 5192 CURRENT_FUNC, uri.ToCString()); |
| 5194 } | 5193 } |
| 5195 return Api::NewHandle(T, String::New(resolved_uri)); | 5194 return Api::NewHandle(T, String::New(resolved_uri)); |
| 5196 } | 5195 } |
| 5197 | 5196 |
| 5198 | 5197 |
| 5199 // NOTE: Need to pass 'result' as a parameter here in order to avoid | 5198 // NOTE: Need to pass 'result' as a parameter here in order to avoid |
| (...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6440 | 6439 |
| 6441 DART_EXPORT bool Dart_IsPrecompiledRuntime() { | 6440 DART_EXPORT bool Dart_IsPrecompiledRuntime() { |
| 6442 #if defined(DART_PRECOMPILED_RUNTIME) | 6441 #if defined(DART_PRECOMPILED_RUNTIME) |
| 6443 return true; | 6442 return true; |
| 6444 #else | 6443 #else |
| 6445 return false; | 6444 return false; |
| 6446 #endif | 6445 #endif |
| 6447 } | 6446 } |
| 6448 | 6447 |
| 6449 } // namespace dart | 6448 } // namespace dart |
| OLD | NEW |