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

Unified Diff: runtime/vm/service.cc

Issue 2703373010: Change Library service protocol ids (Closed)
Patch Set: fix test Created 3 years, 10 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/object_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index c456fee51e9516a6f5088e970b5e4f7e47cf6322..2e96b66bf84085e085f7ecc609f8285e18a0b262 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -1515,16 +1515,23 @@ static RawObject* LookupHeapObjectLibraries(Isolate* isolate,
const GrowableObjectArray& libs =
GrowableObjectArray::Handle(isolate->object_store()->libraries());
ASSERT(!libs.IsNull());
- intptr_t id = 0;
- if (!GetIntegerId(parts[1], &id)) {
- return Object::sentinel().raw();
+ const String& id = String::Handle(String::New(parts[1]));
+ // Scan for private key.
+ String& private_key = String::Handle();
+ Library& lib = Library::Handle();
+ bool lib_found = false;
+ for (intptr_t i = 0; i < libs.Length(); i++) {
+ lib ^= libs.At(i);
+ ASSERT(!lib.IsNull());
+ private_key ^= lib.private_key();
+ if (private_key.Equals(id)) {
+ lib_found = true;
+ break;
+ }
}
- if ((id < 0) || (id >= libs.Length())) {
+ if (!lib_found) {
return Object::sentinel().raw();
}
- Library& lib = Library::Handle();
- lib ^= libs.At(id);
- ASSERT(!lib.IsNull());
if (num_parts == 2) {
return lib.raw();
}
« no previous file with comments | « runtime/vm/object_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698