From 832f2f92f4b557e884bf2df30b3e500a0ef39737 Mon Sep 17 00:00:00 2001 From: dcheng Date: Mon, 28 Dec 2015 08:06:27 -0800 Subject: =?UTF-8?q?Convert=20Pass()=E2=86=92std::move()=20in=20generated?= =?UTF-8?q?=20JS=20schema=20bindings.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ❆(੭ु ◜◡‾)੭ु⁾☃❆ 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} --- tools/json_schema_compiler/cc_generator.py | 15 ++++++++------- 1 file 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 ') + .Append('#include ') .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 '', -- cgit v1.1