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

Unified Diff: sky/engine/bindings2/scripts/templates/global_cpp.template

Issue 914413004: Add a new bindings2/scripts directory for Dart bindings (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Remove idlrenderer.py it's not used 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
Index: sky/engine/bindings2/scripts/templates/global_cpp.template
diff --git a/sky/engine/bindings2/scripts/templates/global_cpp.template b/sky/engine/bindings2/scripts/templates/global_cpp.template
new file mode 100644
index 0000000000000000000000000000000000000000..f681c894259ade16585db09cd217398e2925eadd
--- /dev/null
+++ b/sky/engine/bindings2/scripts/templates/global_cpp.template
@@ -0,0 +1,38 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+#include "sky/engine/config.h"
+#include "gen/sky/bindings/DartGlobal.h"
+
+{% for interface in interfaces %}
+#include "gen/sky/bindings/Dart{{interface.name}}.h"
+{% endfor %}
+
+namespace blink {
+
+Dart_NativeFunction skySnapshotResolver(Dart_Handle name, int argumentCount, bool* autoSetupScope)
+{
+{% for interface in interfaces %}
+ {% if interface.has_resolver %}
+ if (Dart_NativeFunction func = Dart{{interface.name}}::Resolver(name, argumentCount, autoSetupScope))
+ return func;
+ {% endif %}
+{% endfor %}
+ return 0;
+}
+
+const uint8_t* skySnapshotSymbolizer(Dart_NativeFunction nf)
+{
+{% for interface in interfaces %}
+ {% if interface.has_resolver %}
+ if (const uint8_t* r = Dart{{interface.name}}::Symbolizer(nf))
+ return r;
+ {% endif %}
+{% endfor %}
+ return 0;
+}
+
+} // namespace blink
« no previous file with comments | « sky/engine/bindings2/scripts/templates/dart_blink.template ('k') | sky/engine/bindings2/scripts/templates/global_h.template » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698