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/file.h" | 5 #include "bin/file.h" |
6 | 6 |
7 #include "bin/builtin.h" | 7 #include "bin/builtin.h" |
8 #include "bin/dartutils.h" | 8 #include "bin/dartutils.h" |
9 #include "bin/io_buffer.h" | 9 #include "bin/io_buffer.h" |
10 #include "bin/thread.h" | 10 #include "bin/thread.h" |
(...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 CObjectArray* wrapper = new CObjectArray(CObject::NewArray(2)); | 1141 CObjectArray* wrapper = new CObjectArray(CObject::NewArray(2)); |
1142 wrapper->SetAt(0, new CObjectInt32(CObject::NewInt32(CObject::kSuccess))); | 1142 wrapper->SetAt(0, new CObjectInt32(CObject::NewInt32(CObject::kSuccess))); |
1143 wrapper->SetAt(1, result); | 1143 wrapper->SetAt(1, result); |
1144 return wrapper; | 1144 return wrapper; |
1145 } | 1145 } |
1146 return CObject::IllegalArgumentError(); | 1146 return CObject::IllegalArgumentError(); |
1147 } | 1147 } |
1148 | 1148 |
1149 | 1149 |
1150 static void FileService(Dart_Port dest_port_id, | 1150 static void FileService(Dart_Port dest_port_id, |
1151 Dart_Port reply_port_id, | 1151 Dart_Port reply_port_id, |
1152 Dart_CObject* message) { | 1152 Dart_CObject* message) { |
1153 CObject* response = CObject::IllegalArgumentError(); | 1153 CObject* response = CObject::IllegalArgumentError(); |
1154 CObjectArray request(message); | 1154 CObjectArray request(message); |
1155 if (message->type == Dart_CObject_kArray) { | 1155 if (message->type == Dart_CObject_kArray) { |
1156 if (request.Length() > 1 && request[0]->IsInt32()) { | 1156 if (request.Length() > 1 && request[0]->IsInt32()) { |
1157 CObjectInt32 requestType(request[0]); | 1157 CObjectInt32 requestType(request[0]); |
1158 switch (requestType.Value()) { | 1158 switch (requestType.Value()) { |
1159 case File::kExistsRequest: | 1159 case File::kExistsRequest: |
1160 response = FileExistsRequest(request); | 1160 response = FileExistsRequest(request); |
1161 break; | 1161 break; |
1162 case File::kCreateRequest: | 1162 case File::kCreateRequest: |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 if (service_port != ILLEGAL_PORT) { | 1250 if (service_port != ILLEGAL_PORT) { |
1251 // Return a send port for the service port. | 1251 // Return a send port for the service port. |
1252 Dart_Handle send_port = Dart_NewSendPort(service_port); | 1252 Dart_Handle send_port = Dart_NewSendPort(service_port); |
1253 Dart_SetReturnValue(args, send_port); | 1253 Dart_SetReturnValue(args, send_port); |
1254 } | 1254 } |
1255 Dart_ExitScope(); | 1255 Dart_ExitScope(); |
1256 } | 1256 } |
1257 | 1257 |
1258 } // namespace bin | 1258 } // namespace bin |
1259 } // namespace dart | 1259 } // namespace dart |
OLD | NEW |