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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 148453016: Add new Dart API function Dart_IsolateData which returns the peer isolate data associated with an i… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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/include/dart_api.h ('k') | runtime/vm/dart_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
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 32396)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -920,6 +920,17 @@
}
+DART_EXPORT void* Dart_IsolateData(Dart_Isolate isolate) {
+ TRACE_API_CALL(CURRENT_FUNC);
+ if (isolate == NULL) {
+ FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
+ }
+ // TODO(16615): Validate isolate parameter.
+ Isolate* iso = reinterpret_cast<Isolate*>(isolate);
+ return iso->init_callback_data();
+}
+
+
DART_EXPORT Dart_Handle Dart_DebugName() {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
@@ -928,10 +939,11 @@
-DART_EXPORT void Dart_EnterIsolate(Dart_Isolate dart_isolate) {
+DART_EXPORT void Dart_EnterIsolate(Dart_Isolate isolate) {
CHECK_NO_ISOLATE(Isolate::Current());
- Isolate* isolate = reinterpret_cast<Isolate*>(dart_isolate);
- Isolate::SetCurrent(isolate);
+ // TODO(16615): Validate isolate parameter.
+ Isolate* iso = reinterpret_cast<Isolate*>(isolate);
+ Isolate::SetCurrent(iso);
}
@@ -1007,6 +1019,7 @@
if (isolate == NULL) {
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
}
+ // TODO(16615): Validate isolate parameter.
Isolate* iso = reinterpret_cast<Isolate*>(isolate);
iso->ScheduleInterrupts(Isolate::kApiInterrupt);
}
@@ -1017,6 +1030,7 @@
if (isolate == NULL) {
FATAL1("%s expects argument 'isolate' to be non-null.", CURRENT_FUNC);
}
+ // TODO(16615): Validate isolate parameter.
Isolate* iso = reinterpret_cast<Isolate*>(isolate);
return iso->MakeRunnable();
}
« no previous file with comments | « runtime/include/dart_api.h ('k') | runtime/vm/dart_api_impl_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698