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

Side by Side Diff: runtime/vm/json_stream.cc

Issue 271153002: Add pause/resume for isolates in vmservice/observatory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/message_handler.h » ('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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 o.PrintJSON(this, ref); 240 o.PrintJSON(this, ref);
241 } 241 }
242 242
243 243
244 void JSONStream::PrintValue(SourceBreakpoint* bpt) { 244 void JSONStream::PrintValue(SourceBreakpoint* bpt) {
245 PrintCommaIfNeeded(); 245 PrintCommaIfNeeded();
246 bpt->PrintJSON(this); 246 bpt->PrintJSON(this);
247 } 247 }
248 248
249 249
250 void JSONStream::PrintValue(const DebuggerEvent* event) {
251 PrintCommaIfNeeded();
252 event->PrintJSON(this);
253 }
254
255
250 void JSONStream::PrintValue(Isolate* isolate, bool ref) { 256 void JSONStream::PrintValue(Isolate* isolate, bool ref) {
251 PrintCommaIfNeeded(); 257 PrintCommaIfNeeded();
252 isolate->PrintJSON(this, ref); 258 isolate->PrintJSON(this, ref);
253 } 259 }
254 260
255 261
256 void JSONStream::PrintPropertyBool(const char* name, bool b) { 262 void JSONStream::PrintPropertyBool(const char* name, bool b) {
257 PrintPropertyName(name); 263 PrintPropertyName(name);
258 PrintValueBool(b); 264 PrintValueBool(b);
259 } 265 }
(...skipping 16 matching lines...) Expand all
276 PrintValue(d); 282 PrintValue(d);
277 } 283 }
278 284
279 285
280 void JSONStream::PrintProperty(const char* name, const char* s) { 286 void JSONStream::PrintProperty(const char* name, const char* s) {
281 PrintPropertyName(name); 287 PrintPropertyName(name);
282 PrintValue(s); 288 PrintValue(s);
283 } 289 }
284 290
285 291
292 void JSONStream::PrintProperty(const char* name, const DebuggerEvent* event) {
293 PrintPropertyName(name);
294 PrintValue(event);
295 }
296
297
298 void JSONStream::PrintProperty(const char* name, Isolate* isolate) {
299 PrintPropertyName(name);
300 PrintValue(isolate);
301 }
302
303
286 void JSONStream::PrintfProperty(const char* name, const char* format, ...) { 304 void JSONStream::PrintfProperty(const char* name, const char* format, ...) {
287 PrintPropertyName(name); 305 PrintPropertyName(name);
288 va_list args; 306 va_list args;
289 va_start(args, format); 307 va_start(args, format);
290 intptr_t len = OS::VSNPrint(NULL, 0, format, args); 308 intptr_t len = OS::VSNPrint(NULL, 0, format, args);
291 va_end(args); 309 va_end(args);
292 char* p = reinterpret_cast<char*>(malloc(len+1)); 310 char* p = reinterpret_cast<char*>(malloc(len+1));
293 va_start(args, format); 311 va_start(args, format);
294 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 312 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
295 va_end(args); 313 va_end(args);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 429 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
412 va_end(args); 430 va_end(args);
413 ASSERT(len == len2); 431 ASSERT(len == len2);
414 stream_->buffer_.AddChar('"'); 432 stream_->buffer_.AddChar('"');
415 stream_->AddEscapedUTF8String(p); 433 stream_->AddEscapedUTF8String(p);
416 stream_->buffer_.AddChar('"'); 434 stream_->buffer_.AddChar('"');
417 free(p); 435 free(p);
418 } 436 }
419 437
420 } // namespace dart 438 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698