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

Side by Side Diff: runtime/vm/json_stream.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 unified diff | Download patch
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 6
7 #include "vm/dart_entry.h" 7 #include "vm/dart_entry.h"
8 #include "vm/debugger.h" 8 #include "vm/debugger.h"
9 #include "vm/json_stream.h" 9 #include "vm/json_stream.h"
10 #include "vm/message.h" 10 #include "vm/message.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 method_ = method.ToCString(); 76 method_ = method.ToCString();
77 77
78 String& string_iterator = String::Handle(); 78 String& string_iterator = String::Handle();
79 if (param_keys.Length() > 0) { 79 if (param_keys.Length() > 0) {
80 ASSERT(param_keys.Length() == param_values.Length()); 80 ASSERT(param_keys.Length() == param_values.Length());
81 const char** param_keys_native = 81 const char** param_keys_native =
82 zone->Alloc<const char*>(param_keys.Length()); 82 zone->Alloc<const char*>(param_keys.Length());
83 const char** param_values_native = 83 const char** param_values_native =
84 zone->Alloc<const char*>(param_keys.Length()); 84 zone->Alloc<const char*>(param_keys.Length());
85 for (intptr_t i = 0; i < param_keys.Length(); i++) { 85 for (intptr_t i = 0; i < param_keys.Length(); i++) {
86 // fprintf(stderr, "Param %" Pd " is %s\n", i, param_values[
86 string_iterator ^= param_keys.At(i); 87 string_iterator ^= param_keys.At(i);
87 param_keys_native[i] = 88 param_keys_native[i] =
88 zone->MakeCopyOfString(string_iterator.ToCString()); 89 zone->MakeCopyOfString(string_iterator.ToCString());
89 string_iterator ^= param_values.At(i); 90 string_iterator ^= param_values.At(i);
90 param_values_native[i] = 91 param_values_native[i] =
91 zone->MakeCopyOfString(string_iterator.ToCString()); 92 zone->MakeCopyOfString(string_iterator.ToCString());
92 } 93 }
93 SetParams(param_keys_native, param_values_native, param_keys.Length()); 94 SetParams(param_keys_native, param_values_native, param_keys.Length());
94 } 95 }
95 if (FLAG_trace_service) { 96 if (FLAG_trace_service) {
(...skipping 27 matching lines...) Expand all
123 case kInternalError: 124 case kInternalError:
124 return "Internal error"; 125 return "Internal error";
125 case kFeatureDisabled: 126 case kFeatureDisabled:
126 return "Feature is disabled"; 127 return "Feature is disabled";
127 case kCannotAddBreakpoint: 128 case kCannotAddBreakpoint:
128 return "Cannot add breakpoint"; 129 return "Cannot add breakpoint";
129 case kIsolateMustBeRunnable: 130 case kIsolateMustBeRunnable:
130 return "Isolate must be runnable"; 131 return "Isolate must be runnable";
131 case kIsolateMustBePaused: 132 case kIsolateMustBePaused:
132 return "Isolate must be paused"; 133 return "Isolate must be paused";
134 case kIsolateIsReloading:
135 return "Isolate is reloading";
136 case kFileSystemAlreadyExists:
137 return "File system already exists";
138 case kFileSystemDoesNotExist:
139 return "File system does not exist";
140 case kFileDoesNotExist:
141 return "File does not exist";
133 default: 142 default:
134 return "Extension error"; 143 return "Extension error";
135 } 144 }
136 } 145 }
137 146
138 147
139 static void PrintRequest(JSONObject* obj, JSONStream* js) { 148 static void PrintRequest(JSONObject* obj, JSONStream* js) {
140 JSONObject jsobj(obj, "request"); 149 JSONObject jsobj(obj, "request");
141 jsobj.AddProperty("method", js->method()); 150 jsobj.AddProperty("method", js->method());
142 { 151 {
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
891 ASSERT(len == len2); 900 ASSERT(len == len2);
892 stream_->buffer_.AddChar('"'); 901 stream_->buffer_.AddChar('"');
893 stream_->AddEscapedUTF8String(p); 902 stream_->AddEscapedUTF8String(p);
894 stream_->buffer_.AddChar('"'); 903 stream_->buffer_.AddChar('"');
895 free(p); 904 free(p);
896 } 905 }
897 906
898 #endif // !PRODUCT 907 #endif // !PRODUCT
899 908
900 } // namespace dart 909 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698