| 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 part of dart.developer; | 5 part of dart.developer; |
| 6 | 6 |
| 7 /// A response to a service protocol extension RPC. | 7 /// A response to a service protocol extension RPC. |
| 8 /// | 8 /// |
| 9 /// If the RPC was successful, use [ServiceExtensionResponse.result], otherwise | 9 /// If the RPC was successful, use [ServiceExtensionResponse.result], otherwise |
| 10 /// use [ServiceExtensionResponse.error]. | 10 /// use [ServiceExtensionResponse.error]. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 if (eventData is! Map) { | 160 if (eventData is! Map) { |
| 161 throw new ArgumentError.value(eventData, | 161 throw new ArgumentError.value(eventData, |
| 162 'eventData', | 162 'eventData', |
| 163 'Must be a Map'); | 163 'Must be a Map'); |
| 164 } | 164 } |
| 165 String eventDataAsString = JSON.encode(eventData); | 165 String eventDataAsString = JSON.encode(eventData); |
| 166 _postEvent(eventKind, eventDataAsString); | 166 _postEvent(eventKind, eventDataAsString); |
| 167 } | 167 } |
| 168 | 168 |
| 169 external _postEvent(String eventKind, String eventData); | 169 external void _postEvent(String eventKind, String eventData); |
| 170 | 170 |
| 171 // Both of these functions are written inside C++ to avoid updating the data | 171 // Both of these functions are written inside C++ to avoid updating the data |
| 172 // structures in Dart, getting an OOB, and observing stale state. Do not move | 172 // structures in Dart, getting an OOB, and observing stale state. Do not move |
| 173 // these into Dart code unless you can ensure that the operations will can be | 173 // these into Dart code unless you can ensure that the operations will can be |
| 174 // done atomically. Native code lives in vm/isolate.cc- | 174 // done atomically. Native code lives in vm/isolate.cc- |
| 175 // LookupServiceExtensionHandler and RegisterServiceExtensionHandler. | 175 // LookupServiceExtensionHandler and RegisterServiceExtensionHandler. |
| 176 external ServiceExtensionHandler _lookupExtension(String method); | 176 external ServiceExtensionHandler _lookupExtension(String method); |
| 177 external _registerExtension(String method, ServiceExtensionHandler handler); | 177 external _registerExtension(String method, ServiceExtensionHandler handler); |
| OLD | NEW |