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

Unified Diff: sky/engine/bindings-dart/dart/scripts/templates/callback_interface_h.template

Issue 875013003: Import Dart bindings as of Blink r188698. This merely copies the files over and does not attach any… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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: sky/engine/bindings-dart/dart/scripts/templates/callback_interface_h.template
diff --git a/sky/engine/bindings-dart/dart/scripts/templates/callback_interface_h.template b/sky/engine/bindings-dart/dart/scripts/templates/callback_interface_h.template
new file mode 100644
index 0000000000000000000000000000000000000000..9f42574c62d9c2604e548c0a7722a20d741848f4
--- /dev/null
+++ b/sky/engine/bindings-dart/dart/scripts/templates/callback_interface_h.template
@@ -0,0 +1,62 @@
+// Copyright 2014 The Dartium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// This file has been auto-generated by {{code_generator_dart}}. DO NOT MODIFY!
+
+#ifndef {{dart_class}}_h
+#define {{dart_class}}_h
+
+{% filter conditional(conditional_string) %}
+{% for filename in header_includes %}
+#include "{{filename}}"
+{% endfor %}
+
+namespace blink {
+
+class {{dart_class}} : public {{cpp_class}}, public ActiveDOMCallback {
+public:
+ typedef {{dart_class}} NativeType;
+
+ static PassOwnPtr<NativeType> create(Dart_Handle object, Dart_Handle& exception)
+ {
+ return adoptPtr(new {{dart_class}}(object, exception, DartUtilities::scriptExecutionContext()));
+ }
+
+ static PassOwnPtr<NativeType> createWithNullCheck(Dart_Handle object, Dart_Handle& exception)
+ {
+ if (Dart_IsNull(object))
+ return PassOwnPtr<NativeType>();
+ return create(object, exception);
+ }
+
+ static PassOwnPtr<NativeType> create(Dart_NativeArguments args, int idx, Dart_Handle& exception)
+ {
+ Dart_Handle object = Dart_GetNativeArgument(args, idx);
+ return create(object, exception);
+ }
+
+ static PassOwnPtr<NativeType> createWithNullCheck(Dart_NativeArguments args, int idx, Dart_Handle& exception)
+ {
+ Dart_Handle object = Dart_GetNativeArgument(args, idx);
+ if (Dart_IsNull(object))
+ return PassOwnPtr<NativeType>();
+ return create(object, exception);
+ }
+
+{% for method in methods %}
+ virtual {{method.cpp_type}} {{method.name}}({{method.argument_declarations | join(', ')}}) OVERRIDE;
+{% endfor %}
+private:
+ {{dart_class}}(Dart_Handle object, Dart_Handle& exception, ExecutionContext* context)
+ : ActiveDOMCallback(context)
+ , m_callback(object, exception)
+ {
+ }
+
+ DartCallback m_callback;
+};
+
+}
+{% endfilter %}
+#endif // {{dart_class}}_h

Powered by Google App Engine
This is Rietveld 408576698