diff options
author | dcheng <dcheng@chromium.org> | 2015-12-28 08:06:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-28 16:07:52 +0000 |
commit | 832f2f92f4b557e884bf2df30b3e500a0ef39737 (patch) | |
tree | 1fa969a0de6b3802dc7e606dbd6ed924c75c5962 | |
parent | 686d21113c2362ecf7e75c8d88a47450bc9485a6 (diff) | |
download | chromium_src-832f2f92f4b557e884bf2df30b3e500a0ef39737.zip chromium_src-832f2f92f4b557e884bf2df30b3e500a0ef39737.tar.gz chromium_src-832f2f92f4b557e884bf2df30b3e500a0ef39737.tar.bz2 |
Convert Pass()→std::move() in generated JS schema bindings.
❆(੭ु ◜◡‾)੭ु⁾☃❆
BUG=557422
R=avi@chromium.org
TBR=rdevlin.cronin@chromium.org
Review URL: https://codereview.chromium.org/1549353002
Cr-Commit-Position: refs/heads/master@{#366978}
-rw-r--r-- | tools/json_schema_compiler/cc_generator.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/json_schema_compiler/cc_generator.py b/tools/json_schema_compiler/cc_generator.py index f93c4d9..ac1679b 100644 --- a/tools/json_schema_compiler/cc_generator.py +++ b/tools/json_schema_compiler/cc_generator.py @@ -48,6 +48,7 @@ class _Generator(object): .Append('#include "%s/%s.h"' % (self._namespace.source_file_dir, self._namespace.short_filename)) .Append('#include <set>') + .Append('#include <utility>') .Cblock(self._type_helper.GenerateIncludes(include_soft=True)) .Append() .Append('using base::UTF8ToUTF16;') @@ -331,7 +332,7 @@ class _Generator(object): .Append(' if (!Populate(%s))' % self._GenerateArgs( ('value', 'out.get()'))) .Append(' return scoped_ptr<%s>();' % classname) - .Append(' return out.Pass();') + .Append(' return out;') .Append('}') ) return c @@ -407,7 +408,7 @@ class _Generator(object): ) return (c.Append() - .Append('return value.Pass();') + .Append('return value;') .Eblock('}')) def _GenerateChoiceTypeToValue(self, cpp_namespace, type_): @@ -433,7 +434,7 @@ class _Generator(object): ) (c.Append('DCHECK(result) << "Must set at least one choice for %s";' % type_.unix_name) - .Append('return result.Pass();') + .Append('return result;') .Eblock('}') ) return c @@ -645,7 +646,7 @@ class _Generator(object): .Eblock('}')) c.Substitute({'value_var': value_var, 'i': i, 'key': param.name}) (c.Append() - .Append('return params.Pass();') + .Append('return params;') .Eblock('}') .Append() ) @@ -734,7 +735,7 @@ class _Generator(object): ) (c.Append('}') .Append('else') - .Append(' %(dst_var)s = temp.Pass();') + .Append(' %(dst_var)s = std::move(temp);') .Eblock('}') ) else: @@ -795,7 +796,7 @@ class _Generator(object): .Append('if (!%%(cpp_type)s::Populate(%s))' % self._GenerateArgs( ('*%(src_var)s', 'temp.get()'))) .Append(' return %(failure_value)s;') - .Append('%(dst_var)s = temp.Pass();') + .Append('%(dst_var)s = std::move(temp);') ) else: (c.Append('if (!%%(cpp_type)s::Populate(%s))' % self._GenerateArgs( @@ -1013,7 +1014,7 @@ class _Generator(object): param.name, param.type_, param.unix_name)) - c.Append('return create_results.Pass();') + c.Append('return create_results;') c.Eblock('}') c.Substitute({ 'function_scope': ('%s::' % function_scope) if function_scope else '', |