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

Unified Diff: runtime/vm/debugger_api_impl.cc

Issue 10414084: Replace linked list of loaded libraries (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
Index: runtime/vm/debugger_api_impl.cc
===================================================================
--- runtime/vm/debugger_api_impl.cc (revision 7914)
+++ runtime/vm/debugger_api_impl.cc (working copy)
@@ -498,24 +498,19 @@
ASSERT(isolate != NULL);
DARTSCOPE(isolate);
- // Find out how many libraries are loaded in this isolate.
- int num_libs = 0;
- Library &lib = Library::Handle();
- lib = isolate->object_store()->registered_libraries();
- while (!lib.IsNull()) {
- num_libs++;
- lib = lib.next_registered();
- }
+ const GrowableObjectArray& libs =
+ GrowableObjectArray::Handle(isolate->object_store()->libraries());
+ int num_libs = libs.Length();
// Create new list and populate with the url of loaded libraries.
- const Array& library_list = Array::Handle(Array::New(num_libs));
- lib = isolate->object_store()->registered_libraries();
+ Library &lib = Library::Handle();
String& lib_url = String::Handle();
+ const Array& library_list = Array::Handle(Array::New(num_libs));
srdjan 2012/05/23 17:35:18 library_url_list ?
hausner 2012/05/23 20:27:14 Done.
for (int i = 0; i < num_libs; i++) {
+ lib ^= libs.At(i);
ASSERT(!lib.IsNull());
lib_url = lib.url();
library_list.SetAt(i, lib_url);
- lib = lib.next_registered();
}
return Api::NewHandle(isolate, library_list.raw());
}

Powered by Google App Engine
This is Rietveld 408576698