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

Unified Diff: runtime/vm/native_api_impl.cc

Issue 1499853004: Adds a special case for sending an int over a port with the native API. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Cleanup Created 5 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 | « runtime/vm/message.h ('k') | runtime/vm/native_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/native_api_impl.cc
diff --git a/runtime/vm/native_api_impl.cc b/runtime/vm/native_api_impl.cc
index c707c9e9cf776f4b752becc58dedc150cdd3a504..f08daa231336a3fcb505db7dde4d07dab584c9da 100644
--- a/runtime/vm/native_api_impl.cc
+++ b/runtime/vm/native_api_impl.cc
@@ -56,6 +56,18 @@ DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject* message) {
}
+DART_EXPORT bool Dart_PostInteger(Dart_Port port_id, int64_t message) {
+ if (Smi::IsValid(message)) {
+ return PortMap::PostMessage(new Message(
+ port_id, Smi::New(message), Message::kNormalPriority));
+ }
+ Dart_CObject cobj;
+ cobj.type = Dart_CObject_kInt64;
+ cobj.value.as_int64 = message;
+ return Dart_PostCObject(port_id, &cobj);
Ivan Posva 2015/12/12 01:10:55 I noticed that you are calling Dart_PostCObject he
zra 2015/12/12 01:50:50 I won't be able to submit a fix for a couple hours
+}
+
+
DART_EXPORT Dart_Port Dart_NewNativePort(const char* name,
Dart_NativeMessageHandler handler,
bool handle_concurrently) {
« no previous file with comments | « runtime/vm/message.h ('k') | runtime/vm/native_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698