OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "platform/assert.h" | 5 #include "platform/assert.h" |
6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
9 #include "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 static bool CanonicalizeUri(Isolate* isolate, | 131 static bool CanonicalizeUri(Isolate* isolate, |
132 const Library& library, | 132 const Library& library, |
133 const String& uri, | 133 const String& uri, |
134 char** canonical_uri, | 134 char** canonical_uri, |
135 char** error) { | 135 char** error) { |
136 Zone* zone = isolate->current_zone(); | 136 Zone* zone = isolate->current_zone(); |
137 bool retval = false; | 137 bool retval = false; |
138 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); | 138 Dart_LibraryTagHandler handler = isolate->library_tag_handler(); |
139 if (handler != NULL) { | 139 if (handler != NULL) { |
140 Dart_EnterScope(); | 140 Dart_EnterScope(); |
141 Dart_Handle result = handler(kCanonicalizeUrl, | 141 Dart_Handle result = handler(Dart_kCanonicalizeUrl, |
142 Api::NewHandle(isolate, library.raw()), | 142 Api::NewHandle(isolate, library.raw()), |
143 Api::NewHandle(isolate, uri.raw())); | 143 Api::NewHandle(isolate, uri.raw())); |
144 const Object& obj = Object::Handle(Api::UnwrapHandle(result)); | 144 const Object& obj = Object::Handle(Api::UnwrapHandle(result)); |
145 if (obj.IsString()) { | 145 if (obj.IsString()) { |
146 *canonical_uri = zone->MakeCopyOfString(String::Cast(obj).ToCString()); | 146 *canonical_uri = zone->MakeCopyOfString(String::Cast(obj).ToCString()); |
147 retval = true; | 147 retval = true; |
148 } else if (obj.IsError()) { | 148 } else if (obj.IsError()) { |
149 Error& error_obj = Error::Handle(); | 149 Error& error_obj = Error::Handle(); |
150 error_obj ^= obj.raw(); | 150 error_obj ^= obj.raw(); |
151 *error = zone->PrintToString("Unable to canonicalize uri '%s': %s", | 151 *error = zone->PrintToString("Unable to canonicalize uri '%s': %s", |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { | 296 DEFINE_NATIVE_ENTRY(isolate_getPortInternal, 0) { |
297 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); | 297 const Object& port = Object::Handle(ReceivePortCreate(isolate->main_port())); |
298 if (port.IsError()) { | 298 if (port.IsError()) { |
299 Exceptions::PropagateError(Error::Cast(port)); | 299 Exceptions::PropagateError(Error::Cast(port)); |
300 } | 300 } |
301 return port.raw(); | 301 return port.raw(); |
302 } | 302 } |
303 | 303 |
304 } // namespace dart | 304 } // namespace dart |
OLD | NEW |