From 4911989e012bd8701a3fb67b3671b4b6e07636de Mon Sep 17 00:00:00 2001 From: Aleksey Khoroshilov Date: Tue, 13 Apr 2021 20:19:05 +0700 Subject: [PATCH] Fix std::move and use of the same object in statements. --- components/binance/browser/binance_service.cc | 6 +++--- .../brave_search/browser/brave_search_host.cc | 3 +-- .../browser/eth_json_rpc_controller.cc | 3 +-- .../browser/crypto_dot_com_service.cc | 6 +++--- components/gemini/browser/gemini_service.cc | 6 +++--- components/ipfs/ipfs_service.cc | 14 +++++++------- 6 files changed, 18 insertions(+), 20 deletions(-) diff --git a/components/binance/browser/binance_service.cc b/components/binance/browser/binance_service.cc index bcba14503cd..807f5749fa4 100644 --- a/components/binance/browser/binance_service.cc +++ b/components/binance/browser/binance_service.cc @@ -213,9 +213,9 @@ bool BinanceService::OAuthRequest(const GURL &url, default_storage_partition->GetURLLoaderFactoryForBrowserProcess().get(); iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, base::BindOnce( - &BinanceService::OnURLLoaderComplete, - base::Unretained(this), std::move(iter), std::move(callback))); + url_loader_factory, + base::BindOnce(&BinanceService::OnURLLoaderComplete, + base::Unretained(this), iter, std::move(callback))); return true; } diff --git a/components/brave_search/browser/brave_search_host.cc b/components/brave_search/browser/brave_search_host.cc index 634a9d8a95f..6080df3e1ba 100644 --- a/components/brave_search/browser/brave_search_host.cc +++ b/components/brave_search/browser/brave_search_host.cc @@ -82,8 +82,7 @@ void BraveSearchHost::FetchBackupResults(const std::string& query, iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( shared_url_loader_factory_.get(), base::BindOnce(&BraveSearchHost::OnURLLoaderComplete, - weak_factory_.GetWeakPtr(), std::move(iter), - std::move(callback))); + weak_factory_.GetWeakPtr(), iter, std::move(callback))); } void BraveSearchHost::OnURLLoaderComplete( diff --git a/components/brave_wallet/browser/eth_json_rpc_controller.cc b/components/brave_wallet/browser/eth_json_rpc_controller.cc index 55abca87ad8..cbb35ceeb96 100644 --- a/components/brave_wallet/browser/eth_json_rpc_controller.cc +++ b/components/brave_wallet/browser/eth_json_rpc_controller.cc @@ -103,8 +103,7 @@ void EthJsonRpcController::Request(const std::string& json_payload, iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory, base::BindOnce(&EthJsonRpcController::OnURLLoaderComplete, - base::Unretained(this), std::move(iter), - std::move(callback))); + base::Unretained(this), iter, std::move(callback))); } void EthJsonRpcController::OnURLLoaderComplete( diff --git a/components/crypto_dot_com/browser/crypto_dot_com_service.cc b/components/crypto_dot_com/browser/crypto_dot_com_service.cc index 673e10772f0..7484cf0db6f 100644 --- a/components/crypto_dot_com/browser/crypto_dot_com_service.cc +++ b/components/crypto_dot_com/browser/crypto_dot_com_service.cc @@ -199,9 +199,9 @@ bool CryptoDotComService::NetworkRequest(const GURL &url, default_storage_partition->GetURLLoaderFactoryForBrowserProcess().get(); iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, base::BindOnce( - &CryptoDotComService::OnURLLoaderComplete, - base::Unretained(this), std::move(iter), std::move(callback))); + url_loader_factory, + base::BindOnce(&CryptoDotComService::OnURLLoaderComplete, + base::Unretained(this), iter, std::move(callback))); return true; } diff --git a/components/gemini/browser/gemini_service.cc b/components/gemini/browser/gemini_service.cc index e13f1c087ff..f434864938f 100644 --- a/components/gemini/browser/gemini_service.cc +++ b/components/gemini/browser/gemini_service.cc @@ -478,9 +478,9 @@ bool GeminiService::OAuthRequest(const GURL &url, default_storage_partition->GetURLLoaderFactoryForBrowserProcess().get(); iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( - url_loader_factory, base::BindOnce( - &GeminiService::OnURLLoaderComplete, - base::Unretained(this), std::move(iter), std::move(callback))); + url_loader_factory, + base::BindOnce(&GeminiService::OnURLLoaderComplete, + base::Unretained(this), iter, std::move(callback))); return true; } diff --git a/components/ipfs/ipfs_service.cc b/components/ipfs/ipfs_service.cc index d1d5f66d510..ac2f05a40ae 100644 --- a/components/ipfs/ipfs_service.cc +++ b/components/ipfs/ipfs_service.cc @@ -293,7 +293,7 @@ void IpfsService::GetConnectedPeers(GetConnectedPeersCallback callback, iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory_.get(), base::BindOnce(&IpfsService::OnGetConnectedPeers, base::Unretained(this), - std::move(iter), std::move(callback), retries)); + iter, std::move(callback), retries)); } base::TimeDelta IpfsService::CalculatePeersRetryTime() { @@ -358,7 +358,7 @@ void IpfsService::GetAddressesConfig(GetAddressesConfigCallback callback) { iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory_.get(), base::BindOnce(&IpfsService::OnGetAddressesConfig, base::Unretained(this), - std::move(iter), std::move(callback))); + iter, std::move(callback))); } void IpfsService::OnGetAddressesConfig( @@ -513,8 +513,8 @@ void IpfsService::GetRepoStats(GetRepoStatsCallback callback) { iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory_.get(), - base::BindOnce(&IpfsService::OnRepoStats, base::Unretained(this), - std::move(iter), std::move(callback))); + base::BindOnce(&IpfsService::OnRepoStats, base::Unretained(this), iter, + std::move(callback))); } void IpfsService::OnRepoStats(SimpleURLLoaderList::iterator iter, @@ -552,8 +552,8 @@ void IpfsService::GetNodeInfo(GetNodeInfoCallback callback) { iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory_.get(), - base::BindOnce(&IpfsService::OnNodeInfo, base::Unretained(this), - std::move(iter), std::move(callback))); + base::BindOnce(&IpfsService::OnNodeInfo, base::Unretained(this), iter, + std::move(callback))); } void IpfsService::OnNodeInfo(SimpleURLLoaderList::iterator iter, @@ -593,7 +593,7 @@ void IpfsService::RunGarbageCollection(GarbageCollectionCallback callback) { iter->get()->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory_.get(), base::BindOnce(&IpfsService::OnGarbageCollection, base::Unretained(this), - std::move(iter), std::move(callback))); + iter, std::move(callback))); } void IpfsService::OnGarbageCollection(