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

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

Issue 1550733002: Convert Pass()→std::move() in generated Mojo bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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_macros.tmpl
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
index ff9bb12ec8bbe1d062160a709e046a0db3478e2c..47068c533077dc691ed8737a04f562ead0bd5b59 100644
--- a/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
+++ b/mojo/public/tools/bindings/generators/cpp_templates/struct_macros.tmpl
@@ -87,7 +87,7 @@
{%- endif %}
{%- elif kind|is_any_handle_kind or kind|is_interface_kind %}
{%- if kind|is_interface_kind %}
- mojo::internal::InterfacePointerToData({{input_field}}.Pass(), &{{output}}->{{name}});
+ mojo::internal::InterfacePointerToData(std::move({{input_field}}), &{{output}}->{{name}});
{%- elif kind|is_interface_request_kind %}
{{output}}->{{name}} = {{input_field}}.PassMessagePipe().release();
{%- else %}
@@ -106,7 +106,7 @@
{%- elif kind|is_associated_kind %}
// TODO(yzshen): add some DCHECKs for non-nullable, is_local, correct router, etc.
{%- if kind|is_associated_interface_kind %}
- mojo::internal::AssociatedInterfacePtrInfoToData({{input_field}}.Pass(), &{{output}}->{{name}});
+ mojo::internal::AssociatedInterfacePtrInfoToData(std::move({{input_field}}), &{{output}}->{{name}});
{%- else %}
{{output}}->{{name}} = mojo::internal::AssociatedInterfaceRequestHelper::PassHandle(&{{input_field}}).release();
{%- endif %}

Powered by Google App Engine
This is Rietveld 408576698