OLD | NEW |
1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #include <assert.h> | 5 #include <assert.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include "include/dart_api.h" | 10 #include "include/dart_api.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 request_type->type == Dart_CObject_kInt32) { | 26 request_type->type == Dart_CObject_kInt32) { |
27 switch (request_type->value.as_int32) { | 27 switch (request_type->value.as_int32) { |
28 case kEchoRequest: | 28 case kEchoRequest: |
29 if (message->value.as_array.length == 3) { | 29 if (message->value.as_array.length == 3) { |
30 Dart_CObject* argument = message->value.as_array.values[2]; | 30 Dart_CObject* argument = message->value.as_array.values[2]; |
31 HandleEcho(reply_port->value.as_send_port.id, argument); | 31 HandleEcho(reply_port->value.as_send_port.id, argument); |
32 return; | 32 return; |
33 } | 33 } |
34 | 34 |
35 case kLookupRequest: | 35 case kLookupRequest: |
36 if (message->value.as_array.length == 4) { | 36 if (message->value.as_array.length == 5) { |
37 Dart_CObject* type = message->value.as_array.values[2]; | 37 Dart_CObject* type = message->value.as_array.values[2]; |
38 Dart_CObject* name = message->value.as_array.values[3]; | 38 Dart_CObject* name = message->value.as_array.values[3]; |
| 39 Dart_CObject* timeout = message->value.as_array.values[4]; |
39 if (type->type == Dart_CObject_kInt32 && | 40 if (type->type == Dart_CObject_kInt32 && |
40 name->type == Dart_CObject_kString) { | 41 name->type == Dart_CObject_kString && |
| 42 timeout->type == Dart_CObject_kInt32) { |
41 HandleLookup(reply_port->value.as_send_port.id, | 43 HandleLookup(reply_port->value.as_send_port.id, |
42 type->value.as_int32, | 44 type->value.as_int32, |
43 name->value.as_string); | 45 name->value.as_string, |
| 46 timeout->value.as_int32); |
44 } | 47 } |
45 return; | 48 return; |
46 } | 49 } |
47 | 50 |
48 default: | 51 default: |
49 break; | 52 break; |
50 // Ignore invalid requests. | 53 // Ignore invalid requests. |
51 } | 54 } |
52 } | 55 } |
53 Dart_CObject result; | 56 Dart_CObject result; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 return parent_library; | 109 return parent_library; |
107 } | 110 } |
108 | 111 |
109 result_code = Dart_SetNativeResolver(parent_library, ResolveName, NULL); | 112 result_code = Dart_SetNativeResolver(parent_library, ResolveName, NULL); |
110 if (Dart_IsError(result_code)) { | 113 if (Dart_IsError(result_code)) { |
111 return result_code; | 114 return result_code; |
112 } | 115 } |
113 | 116 |
114 return parent_library; | 117 return parent_library; |
115 } | 118 } |
OLD | NEW |