Chromium Code Reviews| Index: runtime/vm/service.cc |
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc |
| index 7318e4374805ddfaa28015798b40a3f47a64da1a..fd83688b9d643e8b25524636355efa1970e84d08 100644 |
| --- a/runtime/vm/service.cc |
| +++ b/runtime/vm/service.cc |
| @@ -1884,7 +1884,6 @@ static bool RemoveBreakpoint(Isolate* isolate, JSONStream* js) { |
| } |
| isolate->debugger()->RemoveBreakpoint(bpt->id()); |
| - // TODO(turnidge): Consider whether the 'Success' type is proper. |
| JSONObject jsobj(js); |
|
Cutch
2015/05/28 19:59:19
Might be worth making a Success function so we can
turnidge
2015/05/28 20:06:58
Added PrintSuccess.... now looks like:
PrintSucce
|
| jsobj.AddProperty("type", "Success"); |
| return true; |
| @@ -2484,6 +2483,23 @@ static bool GetTypeArgumentsList(Isolate* isolate, JSONStream* js) { |
| } |
| +static const MethodParameter* get_version_params[] = { |
| + NO_ISOLATE_PARAMETER, |
| + NULL, |
| +}; |
| + |
| + |
| +static bool GetVersion(Isolate* isolate, JSONStream* js) { |
| + JSONObject jsobj(js); |
| + jsobj.AddProperty("type", "Version"); |
| + jsobj.AddProperty("major", static_cast<intptr_t>(1)); |
| + jsobj.AddProperty("minor", static_cast<intptr_t>(0)); |
| + jsobj.AddProperty("_privateMajor", static_cast<intptr_t>(0)); |
| + jsobj.AddProperty("_privateMinor", static_cast<intptr_t>(0)); |
| + return true; |
| +} |
| + |
| + |
| class ServiceIsolateVisitor : public IsolateVisitor { |
| public: |
| explicit ServiceIsolateVisitor(JSONArray* jsarr) |
| @@ -2578,6 +2594,33 @@ static bool SetFlag(Isolate* isolate, JSONStream* js) { |
| } |
| +static const MethodParameter* set_library_debuggable_params[] = { |
| + ISOLATE_PARAMETER, |
| + new IdParameter("libraryId", true), |
| + new BoolParameter("isDebuggable", true), |
| + NULL, |
| +}; |
| + |
| + |
| +static bool SetLibraryDebuggable(Isolate* isolate, JSONStream* js) { |
| + const char* lib_id = js->LookupParam("libraryId"); |
| + ObjectIdRing::LookupResult lookup_result; |
| + Object& obj = Object::Handle(LookupHeapObject(isolate, lib_id, |
| + &lookup_result)); |
| + const bool is_debuggable = |
| + BoolParameter::Parse(js->LookupParam("isDebuggable"), false); |
| + if (obj.IsLibrary()) { |
| + const Library& lib = Library::Cast(obj); |
| + lib.set_debuggable(is_debuggable); |
| + JSONObject jsobj(js); |
| + jsobj.AddProperty("type", "Success"); |
| + return true; |
| + } |
| + PrintInvalidParamError(js, "libraryId"); |
| + return true; |
| +} |
| + |
| + |
| static const MethodParameter* set_name_params[] = { |
| ISOLATE_PARAMETER, |
| new MethodParameter("name", true), |
| @@ -2657,6 +2700,8 @@ static ServiceMethodDescriptor service_methods_[] = { |
| get_tag_profile_params }, |
| { "_getTypeArgumentsList", GetTypeArgumentsList, |
| get_type_arguments_list_params }, |
| + { "getVersion", GetVersion, |
| + get_version_params }, |
| { "getVM", GetVM, |
| get_vm_params }, |
| { "_getVMMetric", GetVMMetric, |
| @@ -2673,6 +2718,8 @@ static ServiceMethodDescriptor service_methods_[] = { |
| request_heap_snapshot_params }, |
| { "_setFlag", SetFlag, |
| set_flags_params }, |
| + { "setLibraryDebuggable", SetLibraryDebuggable, |
| + set_library_debuggable_params }, |
| { "setName", SetName, |
| set_name_params }, |
| }; |