From e59eca16010c109a5e3e4922189c8b264d34caa9 Mon Sep 17 00:00:00 2001 From: dcheng Date: Fri, 18 Dec 2015 09:48:00 -0800 Subject: =?UTF-8?q?Convert=20Pass()=E2=86=92std::move()=20in=20//extension?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG=557422 Review URL: https://codereview.chromium.org/1537893002 Cr-Commit-Position: refs/heads/master@{#366120} --- extensions/browser/api_test_utils.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'extensions/browser/api_test_utils.cc') diff --git a/extensions/browser/api_test_utils.cc b/extensions/browser/api_test_utils.cc index 83ed5fc..7d53624 100644 --- a/extensions/browser/api_test_utils.cc +++ b/extensions/browser/api_test_utils.cc @@ -4,6 +4,8 @@ #include "extensions/browser/api_test_utils.h" +#include + #include "base/json/json_reader.h" #include "base/memory/scoped_ptr.h" #include "base/values.h" @@ -131,7 +133,7 @@ base::Value* RunFunctionWithDelegateAndReturnSingleResult( content::BrowserContext* context, scoped_ptr dispatcher) { return RunFunctionWithDelegateAndReturnSingleResult( - function, args, context, dispatcher.Pass(), NONE); + function, args, context, std::move(dispatcher), NONE); } base::Value* RunFunctionWithDelegateAndReturnSingleResult( @@ -143,7 +145,7 @@ base::Value* RunFunctionWithDelegateAndReturnSingleResult( scoped_refptr function_owner(function); // Without a callback the function will not generate a result. function->set_has_callback(true); - RunFunction(function, args, context, dispatcher.Pass(), flags); + RunFunction(function, args, context, std::move(dispatcher), flags); EXPECT_TRUE(function->GetError().empty()) << "Unexpected error: " << function->GetError(); const base::Value* single_result = NULL; @@ -170,7 +172,7 @@ base::Value* RunFunctionAndReturnSingleResult( new ExtensionFunctionDispatcher(context)); return RunFunctionWithDelegateAndReturnSingleResult( - function, args, context, dispatcher.Pass(), flags); + function, args, context, std::move(dispatcher), flags); } std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function, @@ -188,7 +190,7 @@ std::string RunFunctionAndReturnError(UIThreadExtensionFunction* function, scoped_refptr function_owner(function); // Without a callback the function will not generate a result. function->set_has_callback(true); - RunFunction(function, args, context, dispatcher.Pass(), flags); + RunFunction(function, args, context, std::move(dispatcher), flags); EXPECT_FALSE(function->GetResultList()) << "Did not expect a result"; return function->GetError(); } @@ -198,7 +200,7 @@ bool RunFunction(UIThreadExtensionFunction* function, content::BrowserContext* context) { scoped_ptr dispatcher( new ExtensionFunctionDispatcher(context)); - return RunFunction(function, args, context, dispatcher.Pass(), NONE); + return RunFunction(function, args, context, std::move(dispatcher), NONE); } bool RunFunction(UIThreadExtensionFunction* function, @@ -209,8 +211,8 @@ bool RunFunction(UIThreadExtensionFunction* function, scoped_ptr parsed_args = ParseList(args); EXPECT_TRUE(parsed_args.get()) << "Could not parse extension function arguments: " << args; - return RunFunction( - function, parsed_args.Pass(), context, dispatcher.Pass(), flags); + return RunFunction(function, std::move(parsed_args), context, + std::move(dispatcher), flags); } bool RunFunction(UIThreadExtensionFunction* function, -- cgit v1.1