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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 2527473002: Fix gen_snapshot product mode build (Closed)
Patch Set: Created 4 years, 1 month 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/include/dart_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 9f4c9468e6301877f1622ed81036709477482e1c..29f2b025f220729030a1294a916908d8515ea6eb 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -5514,6 +5514,26 @@ DART_EXPORT Dart_Handle Dart_LibraryUrl(Dart_Handle library) {
}
+DART_EXPORT Dart_Handle Dart_GetLoadedLibraries() {
+ DARTSCOPE(Thread::Current());
+ Isolate* I = T->isolate();
+
+ const GrowableObjectArray& libs =
+ GrowableObjectArray::Handle(Z, I->object_store()->libraries());
+ int num_libs = libs.Length();
+
+ // Create new list and populate with the loaded libraries.
+ Library& lib = Library::Handle();
+ const Array& library_list = Array::Handle(Z, Array::New(num_libs));
+ for (int i = 0; i < num_libs; i++) {
+ lib ^= libs.At(i);
+ ASSERT(!lib.IsNull());
+ library_list.SetAt(i, lib);
+ }
+ return Api::NewHandle(T, library_list.raw());
+}
+
+
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url) {
DARTSCOPE(Thread::Current());
const String& url_str = Api::UnwrapStringHandle(Z, url);
« no previous file with comments | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698