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

Unified Diff: runtime/bin/vmservice_impl.cc

Issue 22607005: Remove race(s) in vmservice tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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/bin/vmservice_impl.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/vmservice_impl.cc
diff --git a/runtime/bin/vmservice_impl.cc b/runtime/bin/vmservice_impl.cc
index 9036f9e780737b39fd7f52a48d2d8e819b5ac17b..a1a8e2cb08b1925fd832feb7ffd8e427e0884929 100644
--- a/runtime/bin/vmservice_impl.cc
+++ b/runtime/bin/vmservice_impl.cc
@@ -387,26 +387,34 @@ void VmService::ThreadMain(uword parameters) {
}
-static Dart_Handle MakeServiceControlMessage(Dart_Port port) {
- Dart_Handle list = Dart_NewList(2);
+static Dart_Handle MakeServiceControlMessage(Dart_Port port, intptr_t code) {
+ Dart_Handle result;
+ Dart_Handle list = Dart_NewList(3);
ASSERT(!Dart_IsError(list));
+ Dart_Handle codeHandle = Dart_NewInteger(code);
+ ASSERT(!Dart_IsError(codeHandle));
+ result = Dart_ListSetAt(list, 0, codeHandle);
+ ASSERT(!Dart_IsError(result));
Dart_Handle sendPort = Dart_NewSendPort(port);
ASSERT(!Dart_IsError(sendPort));
- Dart_ListSetAt(list, 1, sendPort);
+ result = Dart_ListSetAt(list, 1, sendPort);
+ ASSERT(!Dart_IsError(result));
return list;
}
-bool VmService::SendIsolateStartupMessage(Dart_Port port) {
+bool VmService::SendIsolateStartupMessage(Dart_Port port, Dart_Handle name) {
if (!IsRunning()) {
return false;
}
Dart_Isolate isolate = Dart_CurrentIsolate();
ASSERT(isolate != NULL);
ASSERT(Dart_GetMainPortId() == port);
- Dart_Handle list = MakeServiceControlMessage(port);
- Dart_ListSetAt(list, 0,
- Dart_NewInteger(VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID));
+ Dart_Handle list =
+ MakeServiceControlMessage(port, VM_SERVICE_ISOLATE_STARTUP_MESSAGE_ID);
+ ASSERT(!Dart_IsError(list));
+ Dart_Handle result = Dart_ListSetAt(list, 2, name);
+ ASSERT(!Dart_IsError(result));
return Dart_Post(port_, list);
}
@@ -418,9 +426,9 @@ bool VmService::SendIsolateShutdownMessage(Dart_Port port) {
Dart_Isolate isolate = Dart_CurrentIsolate();
ASSERT(isolate != NULL);
ASSERT(Dart_GetMainPortId() == port);
- Dart_Handle list = MakeServiceControlMessage(port);
- Dart_ListSetAt(list, 0,
- Dart_NewInteger(VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID));
+ Dart_Handle list =
+ MakeServiceControlMessage(port, VM_SERVICE_ISOLATE_SHUTDOWN_MESSAGE_ID);
+ ASSERT(!Dart_IsError(list));
return Dart_Post(port_, list);
}
« no previous file with comments | « runtime/bin/vmservice_impl.h ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698