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

Side by Side Diff: runtime/lib/developer.dart

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/lib/developer.cc ('k') | runtime/observatory/lib/src/service/object.dart » ('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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:isolate'; 5 import 'dart:isolate';
6 6
7 patch bool debugger({bool when: true, 7 patch bool debugger({bool when: true,
8 String message}) native "Developer_debugger"; 8 String message}) native "Developer_debugger";
9 9
10 patch Object inspect(Object object) native "Developer_inspect"; 10 patch Object inspect(Object object) native "Developer_inspect";
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 45
46 _log(String message, 46 _log(String message,
47 int timestamp, 47 int timestamp,
48 int sequenceNumber, 48 int sequenceNumber,
49 int level, 49 int level,
50 String name, 50 String name,
51 Zone zone, 51 Zone zone,
52 Object error, 52 Object error,
53 StackTrace stackTrace) native "Developer_log"; 53 StackTrace stackTrace) native "Developer_log";
54 54
55 patch void _postEvent(String eventKind, String eventData)
56 native "Developer_postEvent";
57
55 patch ServiceExtensionHandler _lookupExtension(String method) 58 patch ServiceExtensionHandler _lookupExtension(String method)
56 native "Developer_lookupExtension"; 59 native "Developer_lookupExtension";
57 60
58 patch _registerExtension(String method, ServiceExtensionHandler handler) 61 patch _registerExtension(String method, ServiceExtensionHandler handler)
59 native "Developer_registerExtension"; 62 native "Developer_registerExtension";
60 63
61 // This code is only invoked when there is no other Dart code on the stack. 64 // This code is only invoked when there is no other Dart code on the stack.
62 _runExtension(ServiceExtensionHandler handler, 65 _runExtension(ServiceExtensionHandler handler,
63 String method, 66 String method,
64 List<String> parameterKeys, 67 List<String> parameterKeys,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 sb.write('"result":'); 130 sb.write('"result":');
128 } 131 }
129 sb.write('${response._toString()},'); 132 sb.write('${response._toString()},');
130 if (id is String) { 133 if (id is String) {
131 sb.write('"id":"$id"}'); 134 sb.write('"id":"$id"}');
132 } else { 135 } else {
133 sb.write('"id":$id}'); 136 sb.write('"id":$id}');
134 } 137 }
135 replyPort.send(sb.toString()); 138 replyPort.send(sb.toString());
136 } 139 }
OLDNEW
« no previous file with comments | « runtime/lib/developer.cc ('k') | runtime/observatory/lib/src/service/object.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698