| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
| (...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 893 OS::PrintErr("%s expects argument 'handler' to be non-null.\n", | 893 OS::PrintErr("%s expects argument 'handler' to be non-null.\n", |
| 894 CURRENT_FUNC); | 894 CURRENT_FUNC); |
| 895 return kIllegalPort; | 895 return kIllegalPort; |
| 896 } | 896 } |
| 897 // Start the native port without a current isolate. | 897 // Start the native port without a current isolate. |
| 898 IsolateSaver saver(Isolate::Current()); | 898 IsolateSaver saver(Isolate::Current()); |
| 899 Isolate::SetCurrent(NULL); | 899 Isolate::SetCurrent(NULL); |
| 900 | 900 |
| 901 NativeMessageHandler* nmh = new NativeMessageHandler(name, handler); | 901 NativeMessageHandler* nmh = new NativeMessageHandler(name, handler); |
| 902 Dart_Port port_id = PortMap::CreatePort(nmh); | 902 Dart_Port port_id = PortMap::CreatePort(nmh); |
| 903 nmh->Run(Dart::thread_pool(), NULL, NULL, NULL); | 903 nmh->Run(Dart::thread_pool(), NULL, NULL, 0); |
| 904 return port_id; | 904 return port_id; |
| 905 } | 905 } |
| 906 | 906 |
| 907 | 907 |
| 908 DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id) { | 908 DART_EXPORT bool Dart_CloseNativePort(Dart_Port native_port_id) { |
| 909 // Close the native port without a current isolate. | 909 // Close the native port without a current isolate. |
| 910 IsolateSaver saver(Isolate::Current()); | 910 IsolateSaver saver(Isolate::Current()); |
| 911 Isolate::SetCurrent(NULL); | 911 Isolate::SetCurrent(NULL); |
| 912 | 912 |
| 913 // TODO(turnidge): Check that the port is native before trying to close. | 913 // TODO(turnidge): Check that the port is native before trying to close. |
| (...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3322 *buffer = NULL; | 3322 *buffer = NULL; |
| 3323 } | 3323 } |
| 3324 delete debug_region; | 3324 delete debug_region; |
| 3325 } else { | 3325 } else { |
| 3326 *buffer = NULL; | 3326 *buffer = NULL; |
| 3327 *buffer_size = 0; | 3327 *buffer_size = 0; |
| 3328 } | 3328 } |
| 3329 } | 3329 } |
| 3330 | 3330 |
| 3331 } // namespace dart | 3331 } // namespace dart |
| OLD | NEW |