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

Unified Diff: runtime/bin/dartutils.cc

Issue 11275035: Introduce (private) ZLibFilter to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add InternalError class and LICENSE file. Created 8 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
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 3e40dede01210da3967bd79913c3e1a24ae54969..06e478b30cf9677c95e061de5a46b9bf3be5da06 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -509,6 +509,23 @@ Dart_Handle DartUtils::NewDartOSError(OSError* os_error) {
}
+Dart_Handle DartUtils::NewInternalError(const char* message) {
+ Dart_Handle url = Dart_NewString("dart:io");
+ if (Dart_IsError(url)) return url;
+ Dart_Handle lib = Dart_LookupLibrary(url);
+ if (Dart_IsError(lib)) return lib;
+ Dart_Handle class_name = Dart_NewString("InternalError");
+ if (Dart_IsError(class_name)) return class_name;
+ Dart_Handle clazz = Dart_GetClass(lib, class_name);
+ if (Dart_IsError(clazz)) return clazz;
+ Dart_Handle args[1];
+ args[0] = Dart_NewString(message);
+ if (Dart_IsError(args[0])) return args[0];
+ Dart_Handle err = Dart_New(clazz, Dart_Null(), 1, args);
+ return err;
+}
+
+
void DartUtils::SetOriginalWorkingDirectory() {
original_working_directory = Directory::Current();
}
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/filter.h » ('j') | runtime/third_party/zlib/LICENSE » ('J')

Powered by Google App Engine
This is Rietveld 408576698