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

Unified Diff: third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl

Issue 2494973002: bindings: Stop using Nullable<T> in dictionary impl (Closed)
Patch Set: Created 4 years, 1 month 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: third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl
index 3e612a1b6bfccce278b1a1d6195afb893f292426..71d235d372a21c2cbdf33b58c2eaadd9d3fe9855 100644
--- a/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/dictionary_impl.cpp.tmpl
@@ -18,6 +18,30 @@ namespace blink {
{{cpp_class}}::~{{cpp_class}}() {}
+{% for member in members %}
+bool {{cpp_class}}::{{member.has_method_name}}() const {
+ return {{member.has_method_expression}};
+}
+{{member.rvalue_cpp_type}} {{cpp_class}}::{{member.cpp_name}}() const {
+ return {{member.getter_expression}};
+}
+void {{cpp_class}}::{{member.setter_name}}({{member.rvalue_cpp_type}} value) {
+ m_{{member.cpp_name}} = value;
+ {% if member.has_flag_variable %}
+ {{member.has_flag_variable}} = true;
+ {% endif %}
+}
+{% if member.null_setter_name %}
+void {{cpp_class}}::{{member.null_setter_name}}() {
+ {% if member.has_flag_variable %}
+ {{member.has_flag_variable}} = false;
+ {% else %}
peria 2016/11/11 07:45:16 {%endif%} here. otherwise, it keeps unused m_{{me
bashi 2016/11/11 07:52:57 IIUC the purpose of this method is make hasXXX() r
+ m_{{member.cpp_name}} = {{member.member_cpp_type}}();
+ {% endif %}
+}
+{% endif %}
+{% endfor %}
+
DEFINE_TRACE({{cpp_class}}) {
{% for member in members if member.is_traceable %}
visitor->trace(m_{{member.cpp_name}});

Powered by Google App Engine
This is Rietveld 408576698