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

Unified Diff: sky/engine/tonic/dart_converter.h

Issue 942993002: Add support for |any| to Sky's code generator (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
« no previous file with comments | « sky/engine/bindings/scripts/dart_types.py ('k') | sky/engine/tonic/dart_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/tonic/dart_converter.h
diff --git a/sky/engine/tonic/dart_converter.h b/sky/engine/tonic/dart_converter.h
index 2982589da56a95b3703c248bfb7d12825e1b16a8..c40fe5383dc69a0dd30bdf9df9d937c742430342 100644
--- a/sky/engine/tonic/dart_converter.h
+++ b/sky/engine/tonic/dart_converter.h
@@ -269,7 +269,7 @@ struct DartConverter<Vector<T>> {
// DartValue
template <>
-struct DartConverter<DartValue> {
+struct DartConverter<DartValue*> {
static Dart_Handle ToDart(DartState* state, DartValue* val) {
return val->dart_value();
}
@@ -277,6 +277,18 @@ struct DartConverter<DartValue> {
static void SetReturnValue(Dart_NativeArguments args, DartValue* val) {
Dart_SetReturnValue(args, val->dart_value());
}
+
+ static PassRefPtr<DartValue> FromDart(Dart_Handle handle) {
+ return DartValue::Create(DartState::Current(), handle);
+ }
+
+ static PassRefPtr<DartValue> FromArguments(Dart_NativeArguments args,
+ int index,
+ Dart_Handle& exception,
+ bool auto_scope = true) {
+ // TODO(abarth): What should we do with auto_scope?
+ return FromDart(Dart_GetNativeArgument(args, index));
+ }
};
////////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « sky/engine/bindings/scripts/dart_types.py ('k') | sky/engine/tonic/dart_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698