| 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 0b2b01d4d4fa0f194aa05dfa2e56bcc4623cb6d3..7a6fbdcfd4ba5384ce4f00df95837fd79f013e50 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
|
| @@ -28,8 +28,7 @@ struct StructTraits<{{mojom_type}}, {{mojom_type}}Ptr> {
|
| {%- endif %}
|
| {%- endfor %}
|
|
|
| - static bool ReadFromDataView({{mojom_type}}DataView input,
|
| - {{mojom_type}}Ptr* output);
|
| + static bool Read({{mojom_type}}DataView input, {{mojom_type}}Ptr* output);
|
| };
|
|
|
| namespace internal {
|
| @@ -65,34 +64,9 @@ struct Serializer<{{mojom_type}}Ptr, MaybeConstUserType> {
|
| static bool Deserialize({{data_type}}* input,
|
| UserType* output,
|
| SerializationContext* context) {
|
| - return ReadCaller<Traits, HasReadFromDataViewMethod<Traits>::value>::Run(
|
| - input, output, context);
|
| + {{mojom_type}}DataView data_view(input, context);
|
| + return Traits::Read(data_view, output);
|
| }
|
| -
|
| -
|
| - public:
|
| - template <typename Traits, bool use_read_from_data_view>
|
| - struct ReadCaller;
|
| -
|
| - template <typename Traits>
|
| - struct ReadCaller<Traits, false> {
|
| - static bool Run({{data_type}}* input,
|
| - UserType* output,
|
| - SerializationContext* context) {
|
| - {{mojom_type}}_Reader reader(input, context);
|
| - return Traits::Read(reader, output);
|
| - }
|
| - };
|
| -
|
| - template <typename Traits>
|
| - struct ReadCaller<Traits, true> {
|
| - static bool Run({{data_type}}* input,
|
| - UserType* output,
|
| - SerializationContext* context) {
|
| - {{mojom_type}}DataView data_view(input, context);
|
| - return Traits::ReadFromDataView(data_view, output);
|
| - }
|
| - };
|
| };
|
|
|
| } // namespace internal
|
|
|