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

Unified Diff: sdk/lib/developer/service.dart

Issue 2542003002: Add getIsolateID to Service class in dart:developer (Closed)
Patch Set: fix test Created 4 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 | « sdk/lib/developer/developer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/developer/service.dart
diff --git a/sdk/lib/developer/service.dart b/sdk/lib/developer/service.dart
index 9ccf0dccc268ca48fda44572f341057987be6ff3..bbe954def25262a61c14bbf741ac8d7b2a2dfae3 100644
--- a/sdk/lib/developer/service.dart
+++ b/sdk/lib/developer/service.dart
@@ -73,13 +73,26 @@ class Service {
receivePort.close();
return new ServiceProtocolInfo(uri);
}
+
+ /// Returns a [String] token representing the ID of [isolate].
+ ///
+ /// Returns null if the running Dart environment does not support the service
+ /// protocol.
+ static String getIsolateID(Isolate isolate) {
+ if (isolate is! Isolate) {
+ throw new ArgumentError.value(isolate,
+ 'isolate',
+ 'Must be an Isolate');
+ }
+ return _getIsolateIDFromSendPort(isolate.controlPort);
+ }
}
-/// [sp] will receive a Uri or null.
-external void _getServerInfo(SendPort sp);
+/// [sendPort] will receive a Uri or null.
+external void _getServerInfo(SendPort sendPort);
-/// [sp] will receive a Uri or null.
-external void _webServerControl(SendPort sp, bool enable);
+/// [sendPort] will receive a Uri or null.
+external void _webServerControl(SendPort sendPort, bool enable);
/// Returns the major version of the service protocol.
external int _getServiceMajorVersion();
@@ -87,3 +100,5 @@ external int _getServiceMajorVersion();
/// Returns the minor version of the service protocol.
external int _getServiceMinorVersion();
+/// Returns the service id for the isolate that owns [sendPort].
+external String _getIsolateIDFromSendPort(SendPort sendPort);
« no previous file with comments | « sdk/lib/developer/developer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698