Index: runtime/bin/dartutils.cc |
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc |
index 962748aec3bda762e6135ae4bf01e66c8c08024e..fe6a7799909ca75f7f46c0ae68aea63a8dfed2d8 100644 |
--- a/runtime/bin/dartutils.cc |
+++ b/runtime/bin/dartutils.cc |
@@ -5,6 +5,7 @@ |
#include "bin/dartutils.h" |
#include "bin/file.h" |
+#include "include/dart_api.h" |
#include "platform/assert.h" |
#include "platform/globals.h" |
@@ -229,3 +230,27 @@ const char* DartUtils::GetCanonicalPath(const char* reference_dir, |
free(absolute_filename); |
return canonical_filename; |
} |
+ |
+ |
+bool DartUtils::PostNull(Dart_Port port_id) { |
+ // Post a message with just the null object. |
+ Dart_CObject object; |
+ object.type = Dart_CObject::kNull; |
+ Dart_CMessage message; |
+ message.root = &object; |
+ return Dart_PostCMessage(port_id, &message); |
siva
2012/02/04 02:51:17
I have the same question that I had in the other C
Søren Gjesse
2012/02/06 15:35:49
Yes, Dart_CMessage is gone.
|
+} |
+ |
+ |
+bool DartUtils::PostInteger(Dart_Port port_id, intptr_t value) { |
+ // Post a message with the integer value. |
+ intptr_t min = 0xc0000000; // -1073741824 |
+ intptr_t max = 0x3fffffff; // 1073741823 |
+ ASSERT(min <= value && value < max); |
siva
2012/02/04 02:51:17
Would this work on a 64 bit system where value cou
Søren Gjesse
2012/02/06 15:35:49
Changed the method to PostInt32 and with int32_t p
|
+ Dart_CObject object; |
+ object.type = Dart_CObject::kInt32; |
+ object.value.as_int32 = value; |
+ Dart_CMessage message; |
+ message.root = &object; |
+ return Dart_PostCMessage(port_id, &message); |
+} |