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

Unified Diff: runtime/bin/main.cc

Issue 14927003: Revert 22380 to investigate windows build break. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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/gen_snapshot.cc ('k') | runtime/bin/run_vm_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
===================================================================
--- runtime/bin/main.cc (revision 22381)
+++ runtime/bin/main.cc (working copy)
@@ -262,6 +262,26 @@
}
+static void* OpenFile(const char* name) {
+ File* file = File::Open(name, File::kWriteTruncate);
+ ASSERT(file != NULL);
+ return reinterpret_cast<void*>(file);
+}
+
+
+static void WriteFile(const void* buffer, intptr_t num_bytes, void* stream) {
+ ASSERT(stream != NULL);
+ File* file_stream = reinterpret_cast<File*>(stream);
+ bool bytes_written = file_stream->WriteFully(buffer, num_bytes);
+ ASSERT(bytes_written);
+}
+
+
+static void CloseFile(void* stream) {
+ delete reinterpret_cast<File*>(stream);
+}
+
+
// Convert all the arguments to UTF8. On Windows, the arguments are
// encoded in the current code page and not UTF8.
//
@@ -712,10 +732,7 @@
// Initialize the Dart VM.
if (!Dart_Initialize(CreateIsolateAndSetup, NULL, NULL, ShutdownIsolate,
- DartUtils::OpenFile,
- DartUtils::ReadFile,
- DartUtils::WriteFile,
- DartUtils::CloseFile)) {
+ OpenFile, WriteFile, CloseFile)) {
fprintf(stderr, "%s", "VM initialization failed\n");
fflush(stderr);
return kErrorExitCode;
« no previous file with comments | « runtime/bin/gen_snapshot.cc ('k') | runtime/bin/run_vm_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698