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

Unified Diff: runtime/bin/dartutils.cc

Issue 17589007: dart:io | Change names for SecureSocket exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix bad upload to review tool. Created 7 years, 6 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/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 0c06e266372477dd864293843370da016ffc5f48..3e107f8bbfc7e24e854c774bdad4dbc50deed64d 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -253,10 +253,10 @@ static Dart_Handle SingleArgDart_Invoke(Dart_Handle lib, const char* method,
// TODO(iposva): Allocate from the zone instead of leaking error string
-// here. On the other hand the binary is about the exit anyway.
+// here. On the other hand the binary is about to exit anyway.
#define SET_ERROR_MSG(error_msg, format, ...) \
intptr_t len = snprintf(NULL, 0, format, __VA_ARGS__); \
- char *msg = reinterpret_cast<char*>(malloc(len + 1)); \
+ char* msg = reinterpret_cast<char*>(malloc(len + 1)); \
snprintf(msg, len + 1, format, __VA_ARGS__); \
*error_msg = msg
@@ -785,10 +785,12 @@ Dart_Handle DartUtils::NewDartOSError(OSError* os_error) {
}
-Dart_Handle DartUtils::NewDartSocketException(const char* message,
- Dart_Handle os_error) {
- // Create a dart:io SocketException object.
- Dart_Handle type = GetDartType(kIOLibURL, "SocketException");
+Dart_Handle DartUtils::NewDartExceptionWithOSError(const char* library_url,
+ const char* exception_name,
+ const char* message,
+ Dart_Handle os_error) {
+ // Create a Dart Exception object with a message and an OSError.
+ Dart_Handle type = GetDartType(library_url, exception_name);
Dart_Handle args[2];
args[0] = NewString(message);
args[1] = os_error;
@@ -818,6 +820,17 @@ Dart_Handle DartUtils::NewDartArgumentError(const char* message) {
}
+Dart_Handle DartUtils::NewDartIOException(const char* exception_name,
+ const char* message,
+ Dart_Handle os_error) {
+ // Create a dart:io exception object of the given type.
+ return NewDartExceptionWithOSError(kIOLibURL,
+ exception_name,
+ message,
+ os_error);
+}
+
+
Dart_Handle DartUtils::NewInternalError(const char* message) {
return NewDartExceptionWithMessage(kCoreLibURL, "InternalError", message);
}

Powered by Google App Engine
This is Rietveld 408576698