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