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

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: Added new API Dart_PostCMessage Created 8 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
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);
+}

Powered by Google App Engine
This is Rietveld 408576698