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

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

Issue 2225673002: Support exporting Mojo bindings for the component build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improve comments and variable naming Created 4 years, 4 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: mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
index aede1a72a9a1a16ee573d17a136f4216b0b77e2f..4f2a056d78ec8329c6abc0121e88b474f4debce1 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_serialization_declaration.tmpl
@@ -3,7 +3,7 @@
{%- set data_type = struct|get_qualified_name_for_kind(internal=True) %}
template <>
-struct StructTraits<{{mojom_type}}, {{mojom_type}}Ptr> {
+struct {{export_attribute}} StructTraits<{{mojom_type}}, {{mojom_type}}Ptr> {
yzshen1 2016/08/08 17:07:32 Please also add export_attribute to - enum_seriali
jam 2016/08/08 17:36:08 Done
yzshen1 2016/08/08 17:42:16 Thanks! Is it because it is a non-template class a
static bool IsNull(const {{mojom_type}}Ptr& input) { return !input; }
static void SetToNull({{mojom_type}}Ptr* output) { output->reset(); }
@@ -29,7 +29,7 @@ struct StructTraits<{{mojom_type}}, {{mojom_type}}Ptr> {
namespace internal {
template <typename MaybeConstUserType>
-struct Serializer<{{mojom_type}}Ptr, MaybeConstUserType> {
+struct {{export_attribute}} Serializer<{{mojom_type}}Ptr, MaybeConstUserType> {
using UserType = typename std::remove_const<MaybeConstUserType>::type;
using Traits = StructTraits<{{mojom_type}}, UserType>;

Powered by Google App Engine
This is Rietveld 408576698