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

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: Merge Created 5 years, 3 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/vm/dart.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | 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 f3f1f5283960100646aefd336e8a1c9e4c9714f9..5e1105a2ef95e7460d93feee9f3c0531ecd32790 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1254,7 +1254,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,
const uint8_t* instructions_snapshot,
Dart_IsolateCreateCallback create,
@@ -1272,21 +1272,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);
}
- 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;
}
@@ -1357,6 +1355,10 @@ DART_EXPORT Dart_Isolate Dart_CreateIsolate(const char* script_uri,
}
Isolate* I = Dart::CreateIsolate(isolate_name, *flags);
free(isolate_name);
+ if (I == NULL) {
+ *error = strdup("Isolate creation failed");
+ return reinterpret_cast<Dart_Isolate>(NULL);
+ }
{
Thread* T = Thread::Current();
StackZone zone(T);
« no previous file with comments | « runtime/vm/dart.cc ('k') | runtime/vm/debugger_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698