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

Unified Diff: runtime/vm/dart_entry.cc

Issue 125103004: Move service into VM (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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/dart_entry.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_entry.cc
diff --git a/runtime/vm/dart_entry.cc b/runtime/vm/dart_entry.cc
index 97dd924a0c3b09cfd381dd555d11d4dcb81470f3..2587c6b5f3c335fabb8240761bcd86cacf1b1dd1 100644
--- a/runtime/vm/dart_entry.cc
+++ b/runtime/vm/dart_entry.cc
@@ -493,4 +493,16 @@ RawObject* DartLibraryCalls::PortGetId(const Instance& port) {
}
+bool DartLibraryCalls::IsSendPort(const Instance& send_port) {
+ // Get instance class.
+ const Class& cls = Class::Handle(send_port.clazz());
+ // Get send port class from isolate library.
+ const Library& isolate_lib = Library::Handle(Library::IsolateLibrary());
+ const Class& send_port_cls = Class::Handle(
+ isolate_lib.LookupClassAllowPrivate(Symbols::_SendPortImpl()));
+ // Check for the same class id.
+ ASSERT(!send_port_cls.IsNull());
+ return cls.id() == send_port_cls.id();
+}
+
} // namespace dart
« no previous file with comments | « runtime/vm/dart_entry.h ('k') | runtime/vm/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698