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

Unified Diff: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl

Issue 1526533002: [mojo] Add pickling support for native-only structs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindings-4-bool-deserialize
Patch Set: merge Created 5 years 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: mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
index 8c61c86ab18527ffdcb80e789d8aee1a44c4e6a2..279665296f1f6e2d82c6dc3f569e057b1baa9586 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/wrapper_class_definition.tmpl
@@ -37,8 +37,13 @@
bool {{struct.name}}::Equals(const {{struct.name}}& other) const {
{%- for field in struct.fields %}
+{%- if field.kind|is_typemapped_kind %}
+{# TODO(rockot): Consider adding support for native equality testing. #}
+ NOTREACHED() << "Equality testing not supported with typemapped fields.";
+{%- else %}
if (!mojo::internal::ValueTraits<{{field.kind|cpp_wrapper_type}}>::Equals(this->{{field.name}}, other.{{field.name}}))
return false;
+{%- endif %}
{%- endfor %}
return true;
}

Powered by Google App Engine
This is Rietveld 408576698