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

Unified Diff: runtime/bin/socket.cc

Issue 9657001: Start using Dart_PropagateError in the runtime/bin directory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
Index: runtime/bin/socket.cc
===================================================================
--- runtime/bin/socket.cc (revision 5191)
+++ runtime/bin/socket.cc (working copy)
@@ -48,7 +48,9 @@
DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3));
intptr_t buffer_len = 0;
Dart_Handle result = Dart_ListLength(buffer_obj, &buffer_len);
- ASSERT(!Dart_IsError(result));
+ if (Dart_IsError(result)) {
+ Dart_PropagateError(result);
+ }
ASSERT((offset + length) <= buffer_len);
if (Dart_IsVMFlagSet("short_socket_read")) {
@@ -61,7 +63,7 @@
Dart_Handle result =
Dart_ListSetAsBytes(buffer_obj, offset, buffer, bytes_read);
if (Dart_IsError(result)) {
Søren Gjesse 2012/03/08 21:18:46 Missing delete[] buffer
- bytes_read = -1;
+ Dart_PropagateError(result);
}
}
delete[] buffer;
@@ -83,7 +85,9 @@
DartUtils::GetIntegerValue(Dart_GetNativeArgument(args, 3));
intptr_t buffer_len = 0;
Dart_Handle result = Dart_ListLength(buffer_obj, &buffer_len);
- ASSERT(!Dart_IsError(result));
+ if (Dart_IsError(result)) {
+ Dart_PropagateError(result);
+ }
ASSERT((offset + length) <= buffer_len);
if (Dart_IsVMFlagSet("short_socket_write")) {
@@ -103,7 +107,9 @@
offset + total_bytes_written,
buffer,
chunk_length);
- ASSERT(!Dart_IsError(result));
+ if (Dart_IsError(result)) {
Søren Gjesse 2012/03/08 21:18:46 Missing delete[] buffer.
+ Dart_PropagateError(result);
+ }
bytes_written =
Socket::Write(socket, reinterpret_cast<void*>(buffer), chunk_length);
total_bytes_written += bytes_written;

Powered by Google App Engine
This is Rietveld 408576698