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

Unified Diff: runtime/vm/service_isolate.cc

Issue 1130753006: Hide Isolate pointer from embedder (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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/port.cc ('k') | runtime/vm/unit_test.h » ('j') | 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 3665cf3da69f31e91b501b4d33a5fd6e844888df..ead50c8fec6e80d5be9394015db11a10bba5d63b 100644
--- a/runtime/vm/service_isolate.cc
+++ b/runtime/vm/service_isolate.cc
@@ -109,7 +109,7 @@ static uint8_t* allocator(uint8_t* ptr, intptr_t old_size, intptr_t new_size) {
static Dart_Port ExtractPort(Isolate* isolate, Dart_Handle receivePort) {
const ReceivePort& rp = Api::UnwrapReceivePortHandle(isolate, receivePort);
if (rp.IsNull()) {
- return ILLEGAL_PORT;
+ return DART_ILLEGAL_PORT;
}
return rp.Id();
}
@@ -147,9 +147,9 @@ static RawArray* MakeServiceExitMessage() {
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_Port ServiceIsolate::port_ = DART_ILLEGAL_PORT;
+Dart_Port ServiceIsolate::load_port_ = DART_ILLEGAL_PORT;
+Dart_Port ServiceIsolate::origin_ = DART_ILLEGAL_PORT;
Dart_IsolateCreateCallback ServiceIsolate::create_callback_ = NULL;
uint8_t* ServiceIsolate::exit_message_ = NULL;
intptr_t ServiceIsolate::exit_message_length_ = 0;
@@ -270,7 +270,7 @@ class ServiceIsolateNatives : public AllStatic {
Dart_Invoke(library, Dart_NewStringFromCString("boot"), 0, NULL);
ASSERT(!Dart_IsError(result));
Dart_Port port = ExtractPort(isolate, result);
- ASSERT(port != ILLEGAL_PORT);
+ ASSERT(port != DART_ILLEGAL_PORT);
ServiceIsolate::SetServicePort(port);
Dart_ExitScope();
}
@@ -356,7 +356,7 @@ bool ServiceIsolate::Exists() {
bool ServiceIsolate::IsRunning() {
MonitorLocker ml(monitor_);
- return (port_ != ILLEGAL_PORT) && (isolate_ != NULL);
+ return (port_ != DART_ILLEGAL_PORT) && (isolate_ != NULL);
}
@@ -381,7 +381,7 @@ Dart_Port ServiceIsolate::Port() {
Dart_Port ServiceIsolate::WaitForLoadPort() {
MonitorLocker ml(monitor_);
- while (initializing_ && (load_port_ == ILLEGAL_PORT)) {
+ while (initializing_ && (load_port_ == DART_ILLEGAL_PORT)) {
ml.Wait();
}
@@ -487,7 +487,7 @@ void ServiceIsolate::SetServiceIsolate(Isolate* isolate) {
isolate_->is_service_isolate_ = true;
origin_ = isolate_->origin_id();
} else {
- origin_ = ILLEGAL_PORT;
+ origin_ = DART_ILLEGAL_PORT;
}
}
@@ -601,12 +601,11 @@ class RunServiceTask : public ThreadPool::Task {
return;
}
- isolate =
- reinterpret_cast<Isolate*>(create_callback(ServiceIsolate::kName,
- NULL,
- NULL,
- NULL,
- &error));
+ isolate = Api::CastIsolate(create_callback(ServiceIsolate::kName,
+ NULL,
+ NULL,
+ NULL,
+ &error));
if (isolate == NULL) {
OS::PrintErr("vm-service: Isolate creation error: %s\n", error);
ServiceIsolate::FinishedInitializing();
@@ -650,7 +649,7 @@ class RunServiceTask : public ThreadPool::Task {
Dart::ShutdownIsolate();
}
ServiceIsolate::SetServiceIsolate(NULL);
- ServiceIsolate::SetServicePort(ILLEGAL_PORT);
+ ServiceIsolate::SetServicePort(DART_ILLEGAL_PORT);
if (FLAG_trace_service) {
OS::Print("vm-service: Shutdown.\n");
}
@@ -728,7 +727,7 @@ void ServiceIsolate::Shutdown() {
SendServiceExitMessage();
{
MonitorLocker ml(monitor_);
- while (shutting_down_ && (port_ != ILLEGAL_PORT)) {
+ while (shutting_down_ && (port_ != DART_ILLEGAL_PORT)) {
ml.Wait();
}
}
« no previous file with comments | « runtime/vm/port.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698