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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 1275353005: VM thread shutdown. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 5 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
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 037033173c6357f5528f18117de8af2d0a22685c..024fc55dcaaaa8aa1aa42c237dea638d026388e5 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1264,7 +1264,7 @@ DART_EXPORT const char* Dart_VersionString() {
return Version::String();
}
-DART_EXPORT bool Dart_Initialize(
+DART_EXPORT char* Dart_Initialize(
const uint8_t* vm_isolate_snapshot,
Dart_IsolateCreateCallback create,
Dart_IsolateInterruptCallback interrupt,
@@ -1280,21 +1280,19 @@ DART_EXPORT bool Dart_Initialize(
file_open, file_read, file_write,
file_close, entropy_source);
if (err_msg != NULL) {
- OS::PrintErr("Dart_Initialize: %s\n", err_msg);
- return false;
+ return strdup(err_msg);
Florian Schneider 2015/08/19 09:02:03 What the reason for strdup here? Could you just pa
}
- return true;
+ return NULL;
}
-DART_EXPORT bool Dart_Cleanup() {
+DART_EXPORT char* Dart_Cleanup() {
CHECK_NO_ISOLATE(Isolate::Current());
const char* err_msg = Dart::Cleanup();
if (err_msg != NULL) {
- OS::PrintErr("Dart_Cleanup: %s\n", err_msg);
- return false;
+ return strdup(err_msg);
}
- return true;
+ return NULL;
}
@@ -1365,6 +1363,10 @@ DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
}
Isolate* isolate = Dart::CreateIsolate(isolate_name, *flags);
free(isolate_name);
+ if (isolate == NULL) {
+ *error = strdup("Isolate creation failed");
Florian Schneider 2015/08/19 09:02:03 Same here.
Ivan Posva 2015/08/19 09:21:49 Needs the strdup because of the contract about err
+ return reinterpret_cast<Dart_Isolate>(NULL);
+ }
{
StackZone zone(isolate);
HANDLESCOPE(isolate);
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698