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

Unified Diff: Source/bindings/templates/web_modules_interface.h

Issue 1248043003: Initial patch for the web modules layered platform proposal. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 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: Source/bindings/templates/web_modules_interface.h
diff --git a/Source/bindings/templates/web_modules_interface.h b/Source/bindings/templates/web_modules_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..085c1eb66b8df5a7bda2f0a643fa11019a4bf129
--- /dev/null
+++ b/Source/bindings/templates/web_modules_interface.h
@@ -0,0 +1,34 @@
+{% include 'copyright_block.txt' %}
haraken 2016/07/30 15:35:02 You can add a test to bindings/tests/idls/.
+#ifndef {{class_name}}_h
+#define {{class_name}}_h
+
+#include "config.h"
+
+{% for filename in header_includes %}
+#include "{{filename}}"
+{% endfor %}
+
+namespace blink {
+
+class {{class_name}} {
+public:
+ explicit {{class_name}}({{interface_name}}* wrapped)
+ : m_wrapped(wrapped)
+ {
+ }
+
+ // TODO(ojan): Handle void return types.
+ {% for attribute in attributes %}
+ {{attribute.idl_type}} {{attribute.name}}()
+ {
+ return {{attribute.idl_type}}(m_wrapped->{{attribute.name}}());
+ }
+ {% endfor %}
+
+private:
+ {{interface_name}}* m_wrapped;
+};
+
+} // namespace blink
+
+#endif // {{class_name}}_h

Powered by Google App Engine
This is Rietveld 408576698