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 #include "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/exceptions.h" | 10 #include "vm/exceptions.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 level.Value(), | 53 level.Value(), |
54 name, | 54 name, |
55 message, | 55 message, |
56 dart_zone, | 56 dart_zone, |
57 error, | 57 error, |
58 stack_trace); | 58 stack_trace); |
59 return Object::null(); | 59 return Object::null(); |
60 } | 60 } |
61 | 61 |
62 | 62 |
| 63 DEFINE_NATIVE_ENTRY(Developer_postEvent, 2) { |
| 64 GET_NON_NULL_NATIVE_ARGUMENT(String, event_kind, arguments->NativeArgAt(0)); |
| 65 GET_NON_NULL_NATIVE_ARGUMENT(String, event_data, arguments->NativeArgAt(1)); |
| 66 Service::SendExtensionEvent(isolate, event_kind, event_data); |
| 67 return Object::null(); |
| 68 } |
| 69 |
| 70 |
63 DEFINE_NATIVE_ENTRY(Developer_lookupExtension, 1) { | 71 DEFINE_NATIVE_ENTRY(Developer_lookupExtension, 1) { |
64 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); | 72 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); |
65 return isolate->LookupServiceExtensionHandler(name); | 73 return isolate->LookupServiceExtensionHandler(name); |
66 } | 74 } |
67 | 75 |
68 | 76 |
69 DEFINE_NATIVE_ENTRY(Developer_registerExtension, 2) { | 77 DEFINE_NATIVE_ENTRY(Developer_registerExtension, 2) { |
70 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); | 78 GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0)); |
71 GET_NON_NULL_NATIVE_ARGUMENT(Instance, handler, arguments->NativeArgAt(1)); | 79 GET_NON_NULL_NATIVE_ARGUMENT(Instance, handler, arguments->NativeArgAt(1)); |
72 isolate->RegisterServiceExtensionHandler(name, handler); | 80 isolate->RegisterServiceExtensionHandler(name, handler); |
73 return Object::null(); | 81 return Object::null(); |
74 } | 82 } |
75 | 83 |
76 } // namespace dart | 84 } // namespace dart |
OLD | NEW |