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

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: Comments 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..b1c55e02b0bc2472e26907bcc151312ee92fae18 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,33 @@ 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 {
+ {% if member.nullable_indicator_name %}
+ DCHECK({{member.nullable_indicator_name}});
+ {% endif %}
+ return {{member.getter_expression}};
+}
+void {{cpp_class}}::{{member.setter_name}}({{member.rvalue_cpp_type}} value) {
+ m_{{member.cpp_name}} = value;
+ {% if member.nullable_indicator_name %}
+ {{member.nullable_indicator_name}} = true;
+ {% endif %}
+}
+{% if member.null_setter_name %}
+void {{cpp_class}}::{{member.null_setter_name}}() {
+ {% if member.nullable_indicator_name %}
+ {{member.nullable_indicator_name}} = false;
+ {% else %}
+ 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