OLD | NEW |
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 "bin/vmservice_impl.h" | 5 #include "bin/vmservice_impl.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 | 8 |
9 #include "bin/builtin.h" | 9 #include "bin/builtin.h" |
10 #include "bin/dartutils.h" | 10 #include "bin/dartutils.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (Dart_IsError(port_arg)) { | 108 if (Dart_IsError(port_arg)) { |
109 VmService::SetServerIPAndPort("", 0); | 109 VmService::SetServerIPAndPort("", 0); |
110 Dart_ExitScope(); | 110 Dart_ExitScope(); |
111 return; | 111 return; |
112 } | 112 } |
113 int64_t port = DartUtils::GetInt64ValueCheckRange(port_arg, 0, 65535); | 113 int64_t port = DartUtils::GetInt64ValueCheckRange(port_arg, 0, 65535); |
114 VmService::SetServerIPAndPort(ip_chars, port); | 114 VmService::SetServerIPAndPort(ip_chars, port); |
115 Dart_ExitScope(); | 115 Dart_ExitScope(); |
116 } | 116 } |
117 | 117 |
| 118 |
| 119 static void Shutdown(Dart_NativeArguments args) { |
| 120 // NO-OP. |
| 121 } |
| 122 |
118 struct VmServiceIONativeEntry { | 123 struct VmServiceIONativeEntry { |
119 const char* name; | 124 const char* name; |
120 int num_arguments; | 125 int num_arguments; |
121 Dart_NativeFunction function; | 126 Dart_NativeFunction function; |
122 }; | 127 }; |
123 | 128 |
124 | 129 |
125 static VmServiceIONativeEntry _VmServiceIONativeEntries[] = { | 130 static VmServiceIONativeEntry _VmServiceIONativeEntries[] = { |
126 {"VMServiceIO_NotifyServerState", 2, NotifyServerState}, | 131 {"VMServiceIO_NotifyServerState", 2, NotifyServerState}, |
| 132 {"VMServiceIO_Shutdown", 0, Shutdown }, |
127 }; | 133 }; |
128 | 134 |
129 | 135 |
130 static Dart_NativeFunction VmServiceIONativeResolver(Dart_Handle name, | 136 static Dart_NativeFunction VmServiceIONativeResolver(Dart_Handle name, |
131 int num_arguments, | 137 int num_arguments, |
132 bool* auto_setup_scope) { | 138 bool* auto_setup_scope) { |
133 const char* function_name = NULL; | 139 const char* function_name = NULL; |
134 Dart_Handle result = Dart_StringToCString(name, &function_name); | 140 Dart_Handle result = Dart_StringToCString(name, &function_name); |
135 ASSERT(!Dart_IsError(result)); | 141 ASSERT(!Dart_IsError(result)); |
136 ASSERT(function_name != NULL); | 142 ASSERT(function_name != NULL); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 Dart_Handle source = GetSource(url_string); | 356 Dart_Handle source = GetSource(url_string); |
351 if (Dart_IsError(source)) { | 357 if (Dart_IsError(source)) { |
352 return source; | 358 return source; |
353 } | 359 } |
354 return Dart_LoadSource(library, url, source, 0, 0); | 360 return Dart_LoadSource(library, url, source, 0, 0); |
355 } | 361 } |
356 | 362 |
357 | 363 |
358 } // namespace bin | 364 } // namespace bin |
359 } // namespace dart | 365 } // namespace dart |
OLD | NEW |