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

Unified Diff: runtime/bin/gen_snapshot.cc

Issue 2223463003: Switch Dart_Initialize to use a struct (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: More typos Created 4 years, 4 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/fuchsia_test.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
diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc
index 8654e2842c82ee88019b30cc4b15872441c483db..319a322d4d1a8e7302ca2fe41849088ae4d687e8 100644
--- a/runtime/bin/gen_snapshot.cc
+++ b/runtime/bin/gen_snapshot.cc
@@ -1231,21 +1231,20 @@ int main(int argc, char** argv) {
// core library snapshot generation. However for the case when a full
// snasphot is generated from a script (app_script_name != NULL) we will
// need the service isolate to resolve URI and load code.
- char* error = Dart_Initialize(
- NULL,
- NULL,
- NULL,
- (app_script_name != NULL) ? CreateServiceIsolate : NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- DartUtils::OpenFile,
- DartUtils::ReadFile,
- DartUtils::WriteFile,
- DartUtils::CloseFile,
- DartUtils::EntropySource,
- NULL);
+
+ Dart_InitializeParams init_params;
+ memset(&init_params, 0, sizeof(init_params));
+ init_params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION;
+ if (app_script_name != NULL) {
+ init_params.create = CreateServiceIsolate;
+ }
+ init_params.file_open = DartUtils::OpenFile;
+ init_params.file_read = DartUtils::ReadFile;
+ init_params.file_write = DartUtils::WriteFile;
+ init_params.file_close = DartUtils::CloseFile;
+ init_params.entropy_source = DartUtils::EntropySource;
+
+ char* error = Dart_Initialize(&init_params);
if (error != NULL) {
Log::PrintErr("VM initialization failed: %s\n", error);
free(error);
« no previous file with comments | « runtime/bin/fuchsia_test.cc ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698