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

Unified Diff: runtime/vm/service.cc

Issue 2050393002: WIP: DevFS initial implementation (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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/json_stream.cc ('k') | runtime/vm/service_isolate.h » ('j') | 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 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 },
};
« no previous file with comments | « runtime/vm/json_stream.cc ('k') | runtime/vm/service_isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698