Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: runtime/bin/file.cc

Issue 13998008: Add support for even more typed data on native ports (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | sdk/lib/io/file_impl.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 951 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 } 962 }
963 } 963 }
964 return CObject::IllegalArgumentError(); 964 return CObject::IllegalArgumentError();
965 } 965 }
966 966
967 967
968 static int SizeInBytes(Dart_CObject::TypedDataType type) { 968 static int SizeInBytes(Dart_CObject::TypedDataType type) {
969 switch (type) { 969 switch (type) {
970 case Dart_CObject::kInt8Array: 970 case Dart_CObject::kInt8Array:
971 case Dart_CObject::kUint8Array: 971 case Dart_CObject::kUint8Array:
972 case Dart_CObject::kUint8ClampedArray:
972 return 1; 973 return 1;
973 case Dart_CObject::kInt16Array: 974 case Dart_CObject::kInt16Array:
974 case Dart_CObject::kUint16Array: 975 case Dart_CObject::kUint16Array:
975 return 2; 976 return 2;
977 case Dart_CObject::kInt32Array:
978 case Dart_CObject::kUint32Array:
979 case Dart_CObject::kFloat32Array:
980 return 4;
981 case Dart_CObject::kInt64Array:
982 case Dart_CObject::kUint64Array:
983 case Dart_CObject::kFloat64Array:
984 return 8;
976 default: 985 default:
977 break; 986 break;
978 } 987 }
979 UNREACHABLE(); 988 UNREACHABLE();
980 return -1; 989 return -1;
981 } 990 }
982 991
983 992
984 static CObject* FileWriteListRequest(const CObjectArray& request) { 993 static CObject* FileWriteListRequest(const CObjectArray& request) {
985 if (request.Length() == 5 && 994 if (request.Length() == 5 &&
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 Dart_EnterScope(); 1161 Dart_EnterScope();
1153 Dart_SetReturnValue(args, Dart_Null()); 1162 Dart_SetReturnValue(args, Dart_Null());
1154 Dart_Port service_port = File::GetServicePort(); 1163 Dart_Port service_port = File::GetServicePort();
1155 if (service_port != ILLEGAL_PORT) { 1164 if (service_port != ILLEGAL_PORT) {
1156 // Return a send port for the service port. 1165 // Return a send port for the service port.
1157 Dart_Handle send_port = Dart_NewSendPort(service_port); 1166 Dart_Handle send_port = Dart_NewSendPort(service_port);
1158 Dart_SetReturnValue(args, send_port); 1167 Dart_SetReturnValue(args, send_port);
1159 } 1168 }
1160 Dart_ExitScope(); 1169 Dart_ExitScope();
1161 } 1170 }
OLDNEW
« no previous file with comments | « no previous file | runtime/include/dart_api.h » ('j') | sdk/lib/io/file_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698