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

Unified Diff: runtime/vm/service.cc

Issue 466183002: Use function names as service IDs, rather than indices. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
===================================================================
--- runtime/vm/service.cc (revision 39179)
+++ runtime/vm/service.cc (working copy)
@@ -1139,19 +1139,15 @@
static bool HandleClassesFunctions(Isolate* isolate, const Class& cls,
JSONStream* js) {
- intptr_t id;
- if (js->num_arguments() > 5) {
- PrintError(js, "Command too long");
+ if (js->num_arguments() != 4 && js->num_arguments() != 5) {
+ PrintError(js, "Command should have 4 or 5 arguments");
return true;
}
- if (!GetIntegerId(js->GetArgument(3), &id)) {
- PrintError(js, "Must specify collection object id: functions/id");
- return true;
- }
- Function& func = Function::Handle();
- func ^= cls.FunctionFromIndex(id);
+ String& id = String::Handle(isolate, String::New(js->GetArgument(3)));
+ id = String::DecodeIRI(id);
+ Function& func = Function::Handle(cls.LookupFunction(id));
if (func.IsNull()) {
- PrintError(js, "Function %" Pd " not found", id);
+ PrintError(js, "Function %s not found", id.ToCString());
Cutch 2014/08/13 18:01:47 Should we report the undecoded id (so that it matc
koda 2014/08/13 18:18:35 Good idea; changed to report the id from the reque
return true;
}
if (js->num_arguments() == 4) {
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/service_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698