| 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 #if !defined(DART_IO_DISABLED) && !defined(DART_IO_SECURE_SOCKET_DISABLED) | 5 #if !defined(DART_IO_DISABLED) && !defined(DART_IO_SECURE_SOCKET_DISABLED) |
| 6 | 6 |
| 7 #include "bin/io_service.h" | 7 #include "bin/io_service.h" |
| 8 | 8 |
| 9 #include "bin/dartutils.h" | 9 #include "bin/dartutils.h" |
| 10 #include "bin/directory.h" | 10 #include "bin/directory.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 CObjectArray result(CObject::NewArray(2)); | 50 CObjectArray result(CObject::NewArray(2)); |
| 51 result.SetAt(0, request[0]); | 51 result.SetAt(0, request[0]); |
| 52 result.SetAt(1, response); | 52 result.SetAt(1, response); |
| 53 ASSERT(reply_port_id != ILLEGAL_PORT); | 53 ASSERT(reply_port_id != ILLEGAL_PORT); |
| 54 Dart_PostCObject(reply_port_id, result.AsApiCObject()); | 54 Dart_PostCObject(reply_port_id, result.AsApiCObject()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 | |
| 58 Dart_Port IOService::GetServicePort() { | 57 Dart_Port IOService::GetServicePort() { |
| 59 return Dart_NewNativePort("IOService", IOServiceCallback, true); | 58 return Dart_NewNativePort("IOService", IOServiceCallback, true); |
| 60 } | 59 } |
| 61 | 60 |
| 62 | |
| 63 void FUNCTION_NAME(IOService_NewServicePort)(Dart_NativeArguments args) { | 61 void FUNCTION_NAME(IOService_NewServicePort)(Dart_NativeArguments args) { |
| 64 Dart_SetReturnValue(args, Dart_Null()); | 62 Dart_SetReturnValue(args, Dart_Null()); |
| 65 Dart_Port service_port = IOService::GetServicePort(); | 63 Dart_Port service_port = IOService::GetServicePort(); |
| 66 if (service_port != ILLEGAL_PORT) { | 64 if (service_port != ILLEGAL_PORT) { |
| 67 // Return a send port for the service port. | 65 // Return a send port for the service port. |
| 68 Dart_Handle send_port = Dart_NewSendPort(service_port); | 66 Dart_Handle send_port = Dart_NewSendPort(service_port); |
| 69 Dart_SetReturnValue(args, send_port); | 67 Dart_SetReturnValue(args, send_port); |
| 70 } | 68 } |
| 71 } | 69 } |
| 72 | 70 |
| 73 } // namespace bin | 71 } // namespace bin |
| 74 } // namespace dart | 72 } // namespace dart |
| 75 | 73 |
| 76 #endif // !defined(DART_IO_DISABLED) && | 74 #endif // !defined(DART_IO_DISABLED) && |
| 77 // !defined(DART_IO_SECURE_SOCKET_DISABLED) | 75 // !defined(DART_IO_SECURE_SOCKET_DISABLED) |
| OLD | NEW |