Chromium Code Reviews| Index: runtime/bin/file.cc |
| diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc |
| index feeb130fec57106d5851ef6b3fde0b32920e0b55..2c284efa17cff77b475015a14fe674bc37166823 100644 |
| --- a/runtime/bin/file.cc |
| +++ b/runtime/bin/file.cc |
| @@ -76,6 +76,19 @@ void FUNCTION_NAME(File_SetPointer)(Dart_NativeArguments args) { |
| } |
| +void FUNCTION_NAME(File_SetTranslation)(Dart_NativeArguments args) { |
| + File* file = GetFile(args); |
| + ASSERT(file != NULL); |
| + intptr_t translation = |
| + DartUtils::GetIntptrValue(Dart_GetNativeArgument(args, 1)); |
|
siva
2017/02/22 00:58:45
Dart_GetNativeIntegerArgument might work here, jus
zra
2017/02/22 05:07:15
Done.
|
| + if ((translation != File::kText) && (translation != File::kBinary)) { |
| + Dart_ThrowException(DartUtils::NewDartArgumentError( |
| + "The argument must be a FileTranslation mode")); |
| + } |
| + file->SetTranslation(static_cast<File::DartFileTranslation>(translation)); |
| +} |
| + |
| + |
| void FUNCTION_NAME(File_Open)(Dart_NativeArguments args) { |
| const char* filename = |
| DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0)); |