OLD | NEW |
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"; |
11 | 11 |
12 patch void log(String message, | 12 @patch void log(String message, |
13 {DateTime time, | 13 {DateTime time, |
14 int sequenceNumber, | 14 int sequenceNumber, |
15 int level: 0, | 15 int level: 0, |
16 String name: '', | 16 String name: '', |
17 Zone zone, | 17 Zone zone, |
18 Object error, | 18 Object error, |
19 StackTrace stackTrace}) { | 19 StackTrace stackTrace}) { |
20 if (message is! String) { | 20 if (message is! String) { |
21 throw new ArgumentError(message, "message", "Must be a String"); | 21 throw new ArgumentError(message, "message", "Must be a String"); |
22 } | 22 } |
23 if (time == null) { | 23 if (time == null) { |
24 time = new DateTime.now(); | 24 time = new DateTime.now(); |
25 } | 25 } |
26 if (time is! DateTime) { | 26 if (time is! DateTime) { |
27 throw new ArgumentError(time, "time", "Must be a DateTime"); | 27 throw new ArgumentError(time, "time", "Must be a DateTime"); |
28 } | 28 } |
29 if (sequenceNumber == null) { | 29 if (sequenceNumber == null) { |
(...skipping 15 matching lines...) Expand all Loading... |
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) | 55 @patch void _postEvent(String eventKind, String eventData) |
56 native "Developer_postEvent"; | 56 native "Developer_postEvent"; |
57 | 57 |
58 patch ServiceExtensionHandler _lookupExtension(String method) | 58 @patch ServiceExtensionHandler _lookupExtension(String method) |
59 native "Developer_lookupExtension"; | 59 native "Developer_lookupExtension"; |
60 | 60 |
61 patch _registerExtension(String method, ServiceExtensionHandler handler) | 61 @patch _registerExtension(String method, ServiceExtensionHandler handler) |
62 native "Developer_registerExtension"; | 62 native "Developer_registerExtension"; |
63 | 63 |
64 // 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. |
65 _runExtension(ServiceExtensionHandler handler, | 65 _runExtension(ServiceExtensionHandler handler, |
66 String method, | 66 String method, |
67 List<String> parameterKeys, | 67 List<String> parameterKeys, |
68 List<String> parameterValues, | 68 List<String> parameterValues, |
69 SendPort replyPort, | 69 SendPort replyPort, |
70 Object id, | 70 Object id, |
71 bool trace_service) { | 71 bool trace_service) { |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 sb.write('"result":'); | 141 sb.write('"result":'); |
142 } | 142 } |
143 sb.write('${response._toString()},'); | 143 sb.write('${response._toString()},'); |
144 if (id is String) { | 144 if (id is String) { |
145 sb.write('"id":"$id"}'); | 145 sb.write('"id":"$id"}'); |
146 } else { | 146 } else { |
147 sb.write('"id":$id}'); | 147 sb.write('"id":$id}'); |
148 } | 148 } |
149 replyPort.send(sb.toString()); | 149 replyPort.send(sb.toString()); |
150 } | 150 } |
OLD | NEW |