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

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

Issue 289333002: Mojo cpp bindings: validation logic for incoming messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 6 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 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(__clang__) 5 #if defined(__clang__)
6 #pragma clang diagnostic push 6 #pragma clang diagnostic push
7 #pragma clang diagnostic ignored "-Wunused-private-field" 7 #pragma clang diagnostic ignored "-Wunused-private-field"
8 #endif 8 #endif
9 9
10 #include "{{module.path}}.h" 10 #include "{{module.path}}.h"
11 11
12 #include "mojo/public/cpp/bindings/lib/array_serialization.h" 12 #include "mojo/public/cpp/bindings/lib/array_serialization.h"
13 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h" 13 #include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
14 #include "mojo/public/cpp/bindings/lib/bounds_checker.h"
15 #include "mojo/public/cpp/bindings/lib/message_builder.h"
14 #include "mojo/public/cpp/bindings/lib/string_serialization.h" 16 #include "mojo/public/cpp/bindings/lib/string_serialization.h"
15 #include "mojo/public/cpp/bindings/lib/message_builder.h"
16 17
17 {%- for namespace in namespaces_as_array %} 18 {%- for namespace in namespaces_as_array %}
18 namespace {{namespace}} { 19 namespace {{namespace}} {
19 {%- endfor %} 20 {%- endfor %}
20 21
21 {#--- Constants #} 22 {#--- Constants #}
22 {% for constant in module.constants %} 23 {% for constant in module.constants %}
23 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant.value|expres sion_to_text(module)}}; 24 const {{constant.kind|cpp_pod_type}} {{constant.name}} = {{constant.value|expres sion_to_text(module)}};
24 {%- endfor %} 25 {%- endfor %}
25 26
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 {%- include "struct_serialization_definition.tmpl" %} 76 {%- include "struct_serialization_definition.tmpl" %}
76 {%- endfor %} 77 {%- endfor %}
77 78
78 {%- for namespace in namespaces_as_array|reverse %} 79 {%- for namespace in namespaces_as_array|reverse %}
79 } // namespace {{namespace}} 80 } // namespace {{namespace}}
80 {%- endfor %} 81 {%- endfor %}
81 82
82 #if defined(__clang__) 83 #if defined(__clang__)
83 #pragma clang diagnostic pop 84 #pragma clang diagnostic pop
84 #endif 85 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698