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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 25646004: Add Dart_PostPriority function to dart_api, and use it in runAsync to schedule immediate events in … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More cleanup Created 7 years, 2 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
Index: runtime/vm/dart_api_impl.cc
diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc
index 680476e543583d3dd6e116dafc14bdf22707cf94..9daf794ed040ce4abd3c8bcc747cbf8a5fa587de 100644
--- a/runtime/vm/dart_api_impl.cc
+++ b/runtime/vm/dart_api_impl.cc
@@ -1057,6 +1057,19 @@ DART_EXPORT bool Dart_Post(Dart_Port port_id, Dart_Handle handle) {
}
+DART_EXPORT bool Dart_PostPriority(Dart_Port port_id, Dart_Handle handle) {
+ Isolate* isolate = Isolate::Current();
+ DARTSCOPE(isolate);
+ const Object& object = Object::Handle(isolate, Api::UnwrapHandle(handle));
+ uint8_t* data = NULL;
+ MessageWriter writer(&data, &allocator);
+ writer.WriteMessage(object);
+ intptr_t len = writer.BytesWritten();
+ return PortMap::PostMessage(new Message(
+ port_id, Message::kIllegalPort, data, len, Message::kFirstPriority));
+}
+
+
DART_EXPORT Dart_Handle Dart_NewSendPort(Dart_Port port_id) {
Isolate* isolate = Isolate::Current();
DARTSCOPE(isolate);
« no previous file with comments | « runtime/lib/event_loop_patch.dart ('k') | runtime/vm/message.h » ('j') | runtime/vm/message.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698