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

Unified Diff: runtime/bin/dartutils.cc

Issue 9104041: Added API Dart_PostCMessage for posting a Dart_CMessage structure (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed review comments from asiva@ Created 8 years, 10 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/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 962748aec3bda762e6135ae4bf01e66c8c08024e..6ac5079047f81f700aefeb2ae4ac83465b80db96 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,23 @@ 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;
+ return Dart_PostCObject(port_id, &object);
+}
+
+
+bool DartUtils::PostInt32(Dart_Port port_id, int32_t value) {
+ // Post a message with the integer value.
+ int32_t min = 0xc0000000; // -1073741824
+ int32_t max = 0x3fffffff; // 1073741823
+ ASSERT(min <= value && value < max);
+ Dart_CObject object;
+ object.type = Dart_CObject::kInt32;
+ object.value.as_int32 = value;
+ return Dart_PostCObject(port_id, &object);
+}

Powered by Google App Engine
This is Rietveld 408576698