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

Unified Diff: mojo/dart/embedder/common.cc

Issue 1786473004: Rolls Dart runtime forward. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: whitespace Created 4 years, 9 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
« no previous file with comments | « mojo/dart/embedder/common.h ('k') | mojo/dart/embedder/io/filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/dart/embedder/common.cc
diff --git a/mojo/dart/embedder/common.cc b/mojo/dart/embedder/common.cc
index fe3eeb8243a6a29c49f30655ad33386bceea09c7..138dd83dc5ad2eb6a508c4fa3c3a2ed4430e56b2 100644
--- a/mojo/dart/embedder/common.cc
+++ b/mojo/dart/embedder/common.cc
@@ -124,6 +124,39 @@ void DartEmbedder::SetCStringReturn(Dart_NativeArguments arguments,
Dart_SetReturnValue(arguments, NewCString(str));
}
+bool DartEmbedder::GetBooleanArgument(Dart_NativeArguments args,
+ intptr_t index) {
+ bool result;
+ Dart_Handle err = Dart_GetNativeBooleanArgument(args, index, &result);
+ if (Dart_IsError(err)) {
+ Dart_PropagateError(err);
+ }
+ return result;
+}
+
+int64_t DartEmbedder::GetIntegerArgument(Dart_NativeArguments args,
+ intptr_t index) {
+ int64_t result;
+ Dart_Handle err = Dart_GetNativeIntegerArgument(args, index, &result);
+ if (Dart_IsError(err)) {
+ Dart_PropagateError(err);
+ }
+ return result;
+}
+
+intptr_t DartEmbedder::GetIntptrArgument(Dart_NativeArguments args,
+ intptr_t index) {
+ int64_t value = 0;
+ Dart_Handle result = Dart_GetNativeIntegerArgument(args, index, &value);
+ if (Dart_IsError(result)) {
+ Dart_PropagateError(result);
+ }
+ if (value < INTPTR_MIN || INTPTR_MAX < value) {
+ Dart_PropagateError(Dart_NewApiError("Value outside intptr_t range"));
+ }
+ return static_cast<intptr_t>(value);
+}
+
const char* DartEmbedder::GetStringArgument(Dart_NativeArguments arguments,
intptr_t index) {
Dart_Handle str_arg = Dart_GetNativeArgument(arguments, index);
« no previous file with comments | « mojo/dart/embedder/common.h ('k') | mojo/dart/embedder/io/filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698