Chromium Code Reviews| Index: runtime/vm/mirrors_api_impl.cc |
| diff --git a/runtime/vm/mirrors_api_impl.cc b/runtime/vm/mirrors_api_impl.cc |
| index caa1346c835d518a7cedd953138812d73a57f989..af7c0963b08157b20415fe2170823592fa7dcb00 100644 |
| --- a/runtime/vm/mirrors_api_impl.cc |
| +++ b/runtime/vm/mirrors_api_impl.cc |
| @@ -323,6 +323,19 @@ DART_EXPORT Dart_Handle Dart_LibraryName(Dart_Handle library) { |
| return Api::NewHandle(isolate, name.raw()); |
| } |
| +DART_EXPORT Dart_Handle Dart_LibraryId(Dart_Handle library, |
| + intptr_t* library_id) { |
| + Isolate* isolate = Isolate::Current(); |
| + DARTSCOPE(isolate); |
| + const Library& lib = Api::UnwrapLibraryHandle(isolate, library); |
| + if (lib.IsNull()) { |
| + RETURN_TYPE_ERROR(isolate, library, Library); |
| + } |
|
siva
2013/10/28 02:27:48
Usually we report an error when NULL pointers are
|
| + if (library_id != NULL) { |
| + *library_id = lib.index(); |
| + } |
|
siva
2013/10/28 02:27:48
Once the NULL check is in place you could remove t
|
| + return Api::Success(); |
| +} |
| DART_EXPORT Dart_Handle Dart_LibraryGetClassNames(Dart_Handle library) { |
| Isolate* isolate = Isolate::Current(); |