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

Unified Diff: runtime/vm/service.cc

Issue 1477573002: Remove Field::FindFieldIndex() and update service protocol (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/vm/object_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/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index 39f4fec6246c13c4e50efd183a0d6792ddd4fb17..ccc2d58865787bec2cd1cd461036385575625692 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -1271,22 +1271,24 @@ static RawObject* LookupHeapObjectClasses(Thread* thread,
return func.raw();
} else if (strcmp(parts[2], "fields") == 0) {
- // Field ids look like: "classes/17/fields/11"
+ // Field ids look like: "classes/17/fields/name"
if (num_parts != 4) {
return Object::sentinel().raw();
}
- intptr_t id;
- if (!GetIntegerId(parts[3], &id)) {
+ const char* encoded_id = parts[3];
+ String& id = String::Handle(zone, String::New(encoded_id));
+ id = String::DecodeIRI(id);
+ if (id.IsNull()) {
return Object::sentinel().raw();
}
- Field& field = Field::Handle(zone, cls.FieldFromIndex(id));
+ Field& field = Field::Handle(zone, cls.LookupField(id));
if (field.IsNull()) {
return Object::sentinel().raw();
}
return field.raw();
} else if (strcmp(parts[2], "functions") == 0) {
- // Function ids look like: "classes/17/functions/11"
+ // Function ids look like: "classes/17/functions/name"
if (num_parts != 4) {
return Object::sentinel().raw();
}
« no previous file with comments | « runtime/vm/object_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698