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

Unified Diff: runtime/bin/file.cc

Issue 8383037: Improve error handling in the process library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 7f590beb71a2f91a3dd702945eee66c5c4eb755c..8f2f6531ee5b84ecd37c841eff18853dacba542a 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -45,7 +45,7 @@ bool File::WriteFully(const void* buffer, int64_t num_bytes) {
static File* GetFileHandle(Dart_Handle fileobj) {
Dart_Result result = Dart_GetNativeInstanceField(fileobj, kFileFieldIndex);
- assert(Dart_IsValidResult(result));
+ ASSERT(Dart_IsValidResult(result));
File* file = reinterpret_cast<File*>(Dart_GetResultAsCIntptr(result));
return file;
}
@@ -150,14 +150,14 @@ void FUNCTION_NAME(File_ReadList)(Dart_NativeArguments args) {
File* file = GetFileHandle(Dart_GetNativeArgument(args, 0));
if (file != NULL) {
Dart_Handle buffer_obj = Dart_GetNativeArgument(args, 1);
- assert(Dart_IsArray(buffer_obj));
+ ASSERT(Dart_IsArray(buffer_obj));
int64_t offset =
DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2));
int64_t length =
DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3));
Dart_Result result = Dart_GetLength(buffer_obj);
- assert(Dart_IsValidResult(result));
- assert((offset + length) <= Dart_GetResultAsCIntptr(result));
+ ASSERT(Dart_IsValidResult(result));
+ ASSERT((offset + length) <= Dart_GetResultAsCIntptr(result));
uint8_t* buffer = new uint8_t[length];
int total_bytes_read =
file->Read(reinterpret_cast<void*>(buffer), length);
@@ -183,14 +183,14 @@ void FUNCTION_NAME(File_WriteList)(Dart_NativeArguments args) {
File* file = GetFileHandle(Dart_GetNativeArgument(args, 0));
if (file != NULL) {
Dart_Handle buffer_obj = Dart_GetNativeArgument(args, 1);
- assert(Dart_IsArray(buffer_obj));
+ ASSERT(Dart_IsArray(buffer_obj));
int64_t offset =
DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 2));
int64_t length =
DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3));
Dart_Result result = Dart_GetLength(buffer_obj);
- assert(Dart_IsValidResult(result));
- assert((offset + length) <= Dart_GetResultAsCIntptr(result));
+ ASSERT(Dart_IsValidResult(result));
+ ASSERT((offset + length) <= Dart_GetResultAsCIntptr(result));
uint8_t* buffer = new uint8_t[length];
result = Dart_ArrayGet(buffer_obj, offset, buffer, length);
ASSERT(Dart_IsValidResult(result));
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698