Index: runtime/vm/dart_api_impl.cc |
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc |
index aff9955d0f6066674e0b6dc52f2389bf321cc290..78ed41099bfd09302eb8b5ea4bde3bb24d534912 100644 |
--- a/runtime/vm/dart_api_impl.cc |
+++ b/runtime/vm/dart_api_impl.cc |
@@ -1142,37 +1142,29 @@ DART_EXPORT const char* Dart_VersionString() { |
return Version::String(); |
} |
-DART_EXPORT char* Dart_Initialize( |
- const uint8_t* vm_isolate_snapshot, |
- const uint8_t* instructions_snapshot, |
- const uint8_t* data_snapshot, |
- Dart_IsolateCreateCallback create, |
- Dart_IsolateInterruptCallback interrupt, |
- Dart_IsolateUnhandledExceptionCallback unhandled, |
- Dart_IsolateShutdownCallback shutdown, |
- Dart_ThreadExitCallback thread_exit, |
- Dart_FileOpenCallback file_open, |
- Dart_FileReadCallback file_read, |
- Dart_FileWriteCallback file_write, |
- Dart_FileCloseCallback file_close, |
- Dart_EntropySource entropy_source, |
- Dart_GetVMServiceAssetsArchive get_service_assets) { |
- if (interrupt != NULL) { |
+DART_EXPORT char* Dart_Initialize(Dart_InitializeParams* params) { |
+ if (params == NULL) { |
return strdup("Dart_Initialize: " |
- "Setting of interrupt callback is not supported."); |
+ "Dart_InitializeParams is null."); |
} |
- if (unhandled != NULL) { |
+ |
+ if (params->version != DART_INITIALIZE_PARAMS_CURRENT_VERSION) { |
return strdup("Dart_Initialize: " |
- "Setting of unhandled exception callback is not supported."); |
- } |
- return Dart::InitOnce(vm_isolate_snapshot, |
- instructions_snapshot, |
- data_snapshot, |
- create, shutdown, |
- thread_exit, |
- file_open, file_read, file_write, file_close, |
- entropy_source, |
- get_service_assets); |
+ "Invalid Dart_InitializeParams version."); |
+ } |
+ |
+ return Dart::InitOnce(params->vm_isolate_snapshot, |
+ params->instructions_snapshot, |
+ params->data_snapshot, |
+ params->create, |
+ params->shutdown, |
+ params->thread_exit, |
+ params->file_open, |
+ params->file_read, |
+ params->file_write, |
+ params->file_close, |
+ params->entropy_source, |
+ params->get_service_assets); |
} |