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

Side by Side Diff: mojo/public/bindings/generators/cpp_templates/wrapper_class_declaration.tmpl

Issue 99623010: Add support for enums within structs and interfaces to mojom. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 class {{struct.name}} { 1 class {{struct.name}} {
2 public: 2 public:
3 typedef internal::{{struct.name}}_Data Data; 3 typedef internal::{{struct.name}}_Data Data;
4 {%- for enum in struct.enums %}
5 typedef internal::{{enum.name}} {{enum.name}};
6 {%- endfor %}
4 7
5 {{struct.name}}() : data_(NULL) { 8 {{struct.name}}() : data_(NULL) {
6 } 9 }
7 10
8 template <typename U> 11 template <typename U>
9 {{struct.name}}(const U& u, mojo::Buffer* buf = mojo::Buffer::current()) { 12 {{struct.name}}(const U& u, mojo::Buffer* buf = mojo::Buffer::current()) {
10 *this = mojo::TypeConverter<{{struct.name}},U>::ConvertFrom(u, buf); 13 *this = mojo::TypeConverter<{{struct.name}},U>::ConvertFrom(u, buf);
11 } 14 }
12 15
13 template <typename U> 16 template <typename U>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 }; 74 };
72 75
73 private: 76 private:
74 friend class mojo::internal::WrapperHelper<{{struct.name}}>; 77 friend class mojo::internal::WrapperHelper<{{struct.name}}>;
75 78
76 struct Wrap {}; 79 struct Wrap {};
77 {{struct.name}}(Wrap, const Data* data) : data_(data) {} 80 {{struct.name}}(Wrap, const Data* data) : data_(data) {}
78 81
79 const Data* data_; 82 const Data* data_;
80 }; 83 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698