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

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

Issue 1537523002: Add dart:developer.postEvent for posting events to the service protocol from Dart code (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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.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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 } 255 }
256 } 256 }
257 257
258 258
259 void JSONStream::AppendSerializedObject(const char* serialized_object) { 259 void JSONStream::AppendSerializedObject(const char* serialized_object) {
260 PrintCommaIfNeeded(); 260 PrintCommaIfNeeded();
261 buffer_.AddString(serialized_object); 261 buffer_.AddString(serialized_object);
262 } 262 }
263 263
264 264
265 void JSONStream::AppendSerializedObject(const char* property_name,
266 const char* serialized_object) {
267 PrintCommaIfNeeded();
268 PrintPropertyName(property_name);
269 buffer_.AddString(serialized_object);
270 }
271
265 void JSONStream::Clear() { 272 void JSONStream::Clear() {
266 buffer_.Clear(); 273 buffer_.Clear();
267 open_objects_ = 0; 274 open_objects_ = 0;
268 } 275 }
269 276
270 277
271 void JSONStream::OpenObject(const char* property_name) { 278 void JSONStream::OpenObject(const char* property_name) {
272 PrintCommaIfNeeded(); 279 PrintCommaIfNeeded();
273 open_objects_++; 280 open_objects_++;
274 if (property_name != NULL) { 281 if (property_name != NULL) {
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 intptr_t len2 = OS::VSNPrint(p, len+1, format, args); 835 intptr_t len2 = OS::VSNPrint(p, len+1, format, args);
829 va_end(args); 836 va_end(args);
830 ASSERT(len == len2); 837 ASSERT(len == len2);
831 stream_->buffer_.AddChar('"'); 838 stream_->buffer_.AddChar('"');
832 stream_->AddEscapedUTF8String(p); 839 stream_->AddEscapedUTF8String(p);
833 stream_->buffer_.AddChar('"'); 840 stream_->buffer_.AddChar('"');
834 free(p); 841 free(p);
835 } 842 }
836 843
837 } // namespace dart 844 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/json_stream.h ('k') | runtime/vm/service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698