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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 8380020: Refactor the dart api a bit: (Closed) Base URL: http://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.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/gen_snapshot.cc
===================================================================
--- runtime/bin/gen_snapshot.cc (revision 775)
+++ runtime/bin/gen_snapshot.cc (working copy)
@@ -92,7 +92,7 @@
static void* SnapshotCreateCallback(void* data) {
const char* script_name = reinterpret_cast<const char*>(data);
- Dart_Result result;
+ Dart_Handle result;
Dart_EnterScope();
ASSERT(snapshot_filename != NULL);
@@ -101,15 +101,14 @@
// is created.
if (script_name != NULL) {
// Load the specified script.
- result = LoadScript(script_name);
- if (!Dart_IsValidResult(result)) {
- const char* err_msg = Dart_GetErrorCString(result);
+ Dart_Handle library = LoadScript(script_name);
+ if (!Dart_IsValid(library)) {
+ const char* err_msg = Dart_GetError(library);
fprintf(stderr, "Errors encountered while loading script: %s\n", err_msg);
Dart_ExitScope();
exit(255);
}
- Dart_Handle library = Dart_GetResult(result);
if (!Dart_IsLibrary(library)) {
fprintf(stderr,
"Expected a library when loading script: %s",
@@ -128,8 +127,8 @@
intptr_t size = 0;
// First create the snapshot.
result = Dart_CreateSnapshot(&buffer, &size);
- if (!Dart_IsValidResult(result)) {
- const char* err_msg = Dart_GetErrorCString(result);
+ if (!Dart_IsValid(result)) {
+ const char* err_msg = Dart_GetError(result);
fprintf(stderr, "Error while creating snapshot: %s\n", err_msg);
Dart_ExitScope();
exit(255);
« no previous file with comments | « runtime/bin/file.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698