Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(786)

Unified Diff: runtime/vm/mirrors_api_impl.cc

Issue 47293002: Add Dart_LibraryId method unblocking landing 45613003. TBR (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Ready to review Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « runtime/vm/dart_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698