Commit f32f002b authored by Andrey Kosyakov's avatar Andrey Kosyakov Committed by Commit Bot

Mojo: pass arrays by value to setters and wrapper constructors

This changes the type for std::vector arguments passed in wrapper class
constructors and setters from reference to value (i.e. from
const std::vector<>& in_param to std::vector<> in_param), so that

std::move() that we invoke in the bodies of constructors and setters
are actually effective.

The effect of the change on generated files can be seen here:
https://paste.googleplex.com/5618555812839424?raw

Change-Id: Id9cfd3bf23257d2418d462f52a39f3b01e1de96c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1990446Reviewed-by: default avatarKen Rockot <rockot@google.com>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730067}
parent 9377c9f9
......@@ -710,6 +710,7 @@ class Generator(generator.Generator):
def _GetCppWrapperParamTypeNew(self, kind):
cpp_wrapper_type = self._GetCppWrapperType(kind)
return (cpp_wrapper_type if self._ShouldPassParamByValue(kind)
or mojom.IsArrayKind(kind)
else "const %s&" % cpp_wrapper_type)
def _GetCppFieldType(self, kind):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment