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

Side by Side Diff: runtime/bin/fuchsia_test.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 unified diff | Download patch
« no previous file with comments | « no previous file | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include <dart_api.h> 5 #include <dart_api.h>
6 #include <stdio.h> 6 #include <stdio.h>
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "bin/log.h" 10 #include "bin/log.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 internal_library, print_closure_name, print_closure); 141 internal_library, print_closure_name, print_closure);
142 DART_CHECK_VALID(status); 142 DART_CHECK_VALID(status);
143 } 143 }
144 144
145 int Main() { 145 int Main() {
146 Log::Print("Calling Dart_SetVMFlags\n"); 146 Log::Print("Calling Dart_SetVMFlags\n");
147 if (!Dart_SetVMFlags(0, NULL)) { 147 if (!Dart_SetVMFlags(0, NULL)) {
148 FATAL("Failed to set flags\n"); 148 FATAL("Failed to set flags\n");
149 } 149 }
150 Log::Print("Calling Dart_Initialize\n"); 150 Log::Print("Calling Dart_Initialize\n");
151 char* error = Dart_Initialize( 151 Dart_InitializeParams init_params;
152 vm_isolate_snapshot_buffer, NULL, NULL, 152 memset(&init_params, 0, sizeof(init_params));
153 NULL, NULL, NULL, NULL, 153 init_params.version = DART_INITIALIZE_PARAMS_CURRENT_VERSION;
154 NULL, 154 init_params.vm_isolate_snapshot = vm_isolate_snapshot_buffer;
155 NULL, 155 char* error = Dart_Initialize(&init_params);
156 NULL,
157 NULL,
158 NULL,
159 NULL,
160 NULL);
161 if (error != NULL) { 156 if (error != NULL) {
162 FATAL1("VM initialization failed: %s\n", error); 157 FATAL1("VM initialization failed: %s\n", error);
163 } 158 }
164 159
165 Log::Print("Creating Isolate\n"); 160 Log::Print("Creating Isolate\n");
166 Dart_Isolate isolate = Dart_CreateIsolate( 161 Dart_Isolate isolate = Dart_CreateIsolate(
167 "script_uri", 162 "script_uri",
168 "main", 163 "main",
169 isolate_snapshot_buffer, 164 isolate_snapshot_buffer,
170 NULL, 165 NULL,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 Log::Print("Success!\n"); 207 Log::Print("Success!\n");
213 return 0; 208 return 0;
214 } 209 }
215 210
216 } // namespace bin 211 } // namespace bin
217 } // namespace dart 212 } // namespace dart
218 213
219 int main(void) { 214 int main(void) {
220 return dart::bin::Main(); 215 return dart::bin::Main();
221 } 216 }
OLDNEW
« no previous file with comments | « no previous file | runtime/bin/gen_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698