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

Unified Diff: runtime/lib/isolate.cc

Issue 771993003: Add Isolate.current getter, returning the current isolate as an Isolate object. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 6 years 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 | « no previous file | runtime/lib/isolate_patch.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/isolate.cc
diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc
index 82a0fc183b7c452bf0c8531bc913c5cd77a96323..d705a2ce5853e6478712b772642f5cee05b00c58 100644
--- a/runtime/lib/isolate.cc
+++ b/runtime/lib/isolate.cc
@@ -250,6 +250,17 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnUri, 5) {
}
+DEFINE_NATIVE_ENTRY(Isolate_getPortAndCapabilitiesOfCurrentIsolate, 0) {
+ const Array& result = Array::Handle(Array::New(3));
+ result.SetAt(0, SendPort::Handle(SendPort::New(isolate->main_port())));
+ result.SetAt(1, Capability::Handle(
+ Capability::New(isolate->pause_capability())));
+ result.SetAt(2, Capability::Handle(
+ Capability::New(isolate->terminate_capability())));
+ return result.raw();
+}
Lasse Reichstein Nielsen 2014/12/03 15:34:30 The problem with capabilities doesn't seem to orig
+
+
DEFINE_NATIVE_ENTRY(Isolate_sendOOB, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(SendPort, port, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Array, msg, arguments->NativeArgAt(1));
« no previous file with comments | « no previous file | runtime/lib/isolate_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698