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

Unified Diff: runtime/vm/service_isolate.cc

Issue 1053713003: Do not register service isolate descendants with service (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/service_isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service_isolate.cc
diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc
index d823fe046b92c532dee76a6e01268be5eacb1806..76f5b993fea1dab0fd7ca842e9ed7b9f27a8c92f 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -149,6 +149,7 @@ const char* ServiceIsolate::kName = "vm-service";
Isolate* ServiceIsolate::isolate_ = NULL;
Dart_Port ServiceIsolate::port_ = ILLEGAL_PORT;
Dart_Port ServiceIsolate::load_port_ = ILLEGAL_PORT;
+Dart_Port ServiceIsolate::origin_ = ILLEGAL_PORT;
Dart_IsolateCreateCallback ServiceIsolate::create_callback_ = NULL;
uint8_t* ServiceIsolate::exit_message_ = NULL;
intptr_t ServiceIsolate::exit_message_length_ = 0;
@@ -180,9 +181,9 @@ class RegisterRunningIsolatesVisitor : public IsolateVisitor {
virtual void VisitIsolate(Isolate* isolate) {
ASSERT(ServiceIsolate::IsServiceIsolate(Isolate::Current()));
- if (ServiceIsolate::IsServiceIsolate(isolate) ||
+ if (ServiceIsolate::IsServiceIsolateDescendant(isolate) ||
(isolate == Dart::vm_isolate())) {
- // We do not register the service or vm isolate.
+ // We do not register the service (and descendants) or the vm-isolate.
return;
}
// Setup arguments for call.
@@ -377,6 +378,12 @@ bool ServiceIsolate::IsServiceIsolate(Isolate* isolate) {
}
+bool ServiceIsolate::IsServiceIsolateDescendant(Isolate* isolate) {
+ MonitorLocker ml(monitor_);
+ return isolate->origin_id() == origin_;
+}
+
+
Dart_Port ServiceIsolate::Port() {
MonitorLocker ml(monitor_);
return port_;
@@ -405,7 +412,7 @@ bool ServiceIsolate::SendIsolateStartupMessage() {
return false;
}
Isolate* isolate = Isolate::Current();
- if (IsServiceIsolate(isolate)) {
+ if (IsServiceIsolateDescendant(isolate)) {
return false;
}
ASSERT(isolate != NULL);
@@ -436,7 +443,7 @@ bool ServiceIsolate::SendIsolateShutdownMessage() {
return false;
}
Isolate* isolate = Isolate::Current();
- if (IsServiceIsolate(isolate)) {
+ if (IsServiceIsolateDescendant(isolate)) {
return false;
}
ASSERT(isolate != NULL);
@@ -490,6 +497,9 @@ void ServiceIsolate::SetServiceIsolate(Isolate* isolate) {
isolate_ = isolate;
if (isolate_ != NULL) {
isolate_->is_service_isolate_ = true;
+ origin_ = isolate_->origin_id();
+ } else {
+ origin_ = ILLEGAL_PORT;
}
}
« no previous file with comments | « runtime/vm/service_isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698