| Index: runtime/vm/service.cc
|
| diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
|
| index 80607bba42fa084766dd68c0098570c562463657..a9f9d6280a05da8669c6356babdb5c889c080688 100644
|
| --- a/runtime/vm/service.cc
|
| +++ b/runtime/vm/service.cc
|
| @@ -14,6 +14,7 @@
|
| #include "vm/dart_api_state.h"
|
| #include "vm/dart_entry.h"
|
| #include "vm/debugger.h"
|
| +#include "vm/dev_fs.h"
|
| #include "vm/isolate.h"
|
| #include "vm/lockers.h"
|
| #include "vm/message.h"
|
| @@ -3883,6 +3884,7 @@ static bool SetName(Thread* thread, JSONStream* js) {
|
|
|
|
|
| static const MethodParameter* set_vm_name_params[] = {
|
| + NO_ISOLATE_PARAMETER,
|
| new MethodParameter("name", true),
|
| NULL,
|
| };
|
| @@ -3932,6 +3934,80 @@ static bool SetTraceClassAllocation(Thread* thread, JSONStream* js) {
|
| }
|
|
|
|
|
| +static const MethodParameter* create_dev_fs_params[] = {
|
| + NO_ISOLATE_PARAMETER,
|
| + new MethodParameter("fsName", true),
|
| + NULL,
|
| +};
|
| +
|
| +
|
| +static bool CreateDevFS(Thread* thread, JSONStream* js) {
|
| + const char* fs_name = js->LookupParam("fsName");
|
| + DevFS::CreateFileSystem(js, fs_name);
|
| + return true;
|
| +}
|
| +
|
| +
|
| +static const MethodParameter* delete_dev_fs_params[] = {
|
| + NO_ISOLATE_PARAMETER,
|
| + new MethodParameter("fsName", true),
|
| + NULL,
|
| +};
|
| +
|
| +
|
| +static bool DeleteDevFS(Thread* thread, JSONStream* js) {
|
| + const char* fs_name = js->LookupParam("fsName");
|
| + DevFS::DeleteFileSystem(js, fs_name);
|
| + return true;
|
| +}
|
| +
|
| +
|
| +static const MethodParameter* list_dev_fs_params[] = {
|
| + NO_ISOLATE_PARAMETER,
|
| + NULL,
|
| +};
|
| +
|
| +
|
| +static bool ListDevFS(Thread* thread, JSONStream* js) {
|
| + DevFS::ListFileSystems(js);
|
| + return true;
|
| +}
|
| +
|
| +
|
| +static const MethodParameter* write_dev_fs_file_params[] = {
|
| + NO_ISOLATE_PARAMETER,
|
| + new MethodParameter("fsName", true),
|
| + new MethodParameter("path", true),
|
| + new MethodParameter("fileContents", true),
|
| + NULL,
|
| +};
|
| +
|
| +
|
| +static bool WriteDevFSFile(Thread* thread, JSONStream* js) {
|
| + const char* fs_name = js->LookupParam("fsName");
|
| + const char* path_param = js->LookupParam("path");
|
| + const char* contents_param = js->LookupParam("fileContents");
|
| + DevFS::WriteFile(js, fs_name, path_param, contents_param);
|
| + return true;
|
| +}
|
| +
|
| +
|
| +static const MethodParameter* read_dev_fs_file_params[] = {
|
| + NO_ISOLATE_PARAMETER,
|
| + new MethodParameter("fsName", true),
|
| + new MethodParameter("path", true),
|
| + NULL,
|
| +};
|
| +
|
| +
|
| +static bool ReadDevFSFile(Thread* thread, JSONStream* js) {
|
| + const char* fs_name = js->LookupParam("fsName");
|
| + const char* path_param = js->LookupParam("path");
|
| + DevFS::ReadFile(js, fs_name, path_param);
|
| + return true;
|
| +}
|
| +
|
| +
|
| static const ServiceMethodDescriptor service_methods_[] = {
|
| { "_dumpIdZone", DumpIdZone, NULL },
|
| { "_echo", Echo,
|
| @@ -4044,6 +4120,16 @@ static const ServiceMethodDescriptor service_methods_[] = {
|
| set_vm_name_params },
|
| { "_setVMTimelineFlags", SetVMTimelineFlags,
|
| set_vm_timeline_flags_params },
|
| + { "_createDevFS", CreateDevFS,
|
| + create_dev_fs_params },
|
| + { "_deleteDevFS", DeleteDevFS,
|
| + delete_dev_fs_params },
|
| + { "_listDevFS", ListDevFS,
|
| + list_dev_fs_params },
|
| + { "_writeDevFSFile", WriteDevFSFile,
|
| + write_dev_fs_file_params },
|
| + { "_readDevFSFile", ReadDevFSFile,
|
| + read_dev_fs_file_params },
|
| };
|
|
|
|
|
|
|