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

Unified Diff: runtime/vm/dart_api_impl.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/include/dart_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698