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

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

Issue 1410053006: Move third_party/mojo/src/mojo/public to mojo/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 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 unified diff | Download patch
OLDNEW
1 {%- set class_name = union.name ~ "_Data" -%} 1 {%- set class_name = union.name ~ "_Data" -%}
2 {%- set enum_name = union.name ~ "_Tag" -%} 2 {%- set enum_name = union.name ~ "_Tag" -%}
3 {%- import "struct_macros.tmpl" as struct_macros %} 3 {%- import "struct_macros.tmpl" as struct_macros %}
4 4
5 class {{class_name}} { 5 class {{class_name}} {
6 public: 6 public:
7 // Used to identify Mojom Union Data Classes. 7 // Used to identify Mojom Union Data Classes.
8 typedef void MojomUnionDataType; 8 typedef void MojomUnionDataType;
9 static {{class_name}}* New(mojo::internal::Buffer* buf); 9 static {{class_name}}* New(mojo::internal::Buffer* buf);
10 {{class_name}}(); 10 {{class_name}}();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 {{enum_name}} tag; 45 {{enum_name}} tag;
46 Union_ data; 46 Union_ data;
47 47
48 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles); 48 void EncodePointersAndHandles(std::vector<mojo::Handle>* handles);
49 void DecodePointersAndHandles(std::vector<mojo::Handle>* handles); 49 void DecodePointersAndHandles(std::vector<mojo::Handle>* handles);
50 }; 50 };
51 static_assert(sizeof({{class_name}}) == 16, 51 static_assert(sizeof({{class_name}}) == 16,
52 "Bad sizeof({{class_name}})"); 52 "Bad sizeof({{class_name}})");
53 static_assert(sizeof({{class_name}}::Union_) == 8, 53 static_assert(sizeof({{class_name}}::Union_) == 8,
54 "Bad sizeof({{class_name}}::Union_)"); 54 "Bad sizeof({{class_name}}::Union_)");
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698