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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1173 CObjectArray* wrapper = new CObjectArray(CObject::NewArray(2)); | 1173 CObjectArray* wrapper = new CObjectArray(CObject::NewArray(2)); |
1174 wrapper->SetAt(0, new CObjectInt32(CObject::NewInt32(CObject::kSuccess))); | 1174 wrapper->SetAt(0, new CObjectInt32(CObject::NewInt32(CObject::kSuccess))); |
1175 wrapper->SetAt(1, result); | 1175 wrapper->SetAt(1, result); |
1176 return wrapper; | 1176 return wrapper; |
1177 } | 1177 } |
1178 return CObject::IllegalArgumentError(); | 1178 return CObject::IllegalArgumentError(); |
1179 } | 1179 } |
1180 | 1180 |
1181 | 1181 |
1182 static void FileService(Dart_Port dest_port_id, | 1182 static void FileService(Dart_Port dest_port_id, |
1183 Dart_Port reply_port_id, | 1183 Dart_Port reply_port_id, |
1184 Dart_CObject* message) { | 1184 Dart_CObject* message) { |
1185 CObject* response = CObject::IllegalArgumentError(); | 1185 CObject* response = CObject::IllegalArgumentError(); |
1186 CObjectArray request(message); | 1186 CObjectArray request(message); |
1187 if (message->type == Dart_CObject_kArray) { | 1187 if (message->type == Dart_CObject_kArray) { |
1188 if (request.Length() > 1 && request[0]->IsInt32()) { | 1188 if (request.Length() > 1 && request[0]->IsInt32()) { |
1189 CObjectInt32 requestType(request[0]); | 1189 CObjectInt32 requestType(request[0]); |
1190 switch (requestType.Value()) { | 1190 switch (requestType.Value()) { |
1191 case File::kExistsRequest: | 1191 case File::kExistsRequest: |
1192 response = FileExistsRequest(request); | 1192 response = FileExistsRequest(request); |
1193 break; | 1193 break; |
1194 case File::kCreateRequest: | 1194 case File::kCreateRequest: |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1285 if (service_port != ILLEGAL_PORT) { | 1285 if (service_port != ILLEGAL_PORT) { |
1286 // Return a send port for the service port. | 1286 // Return a send port for the service port. |
1287 Dart_Handle send_port = Dart_NewSendPort(service_port); | 1287 Dart_Handle send_port = Dart_NewSendPort(service_port); |
1288 Dart_SetReturnValue(args, send_port); | 1288 Dart_SetReturnValue(args, send_port); |
1289 } | 1289 } |
1290 Dart_ExitScope(); | 1290 Dart_ExitScope(); |
1291 } | 1291 } |
1292 | 1292 |
1293 } // namespace bin | 1293 } // namespace bin |
1294 } // namespace dart | 1294 } // namespace dart |
OLD | NEW |