summaryrefslogtreecommitdiffstats
path: root/ios
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2016-01-13 20:41:45 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-14 04:43:33 +0000
commit5e05b437032ffeb7bf9da7dcf1355fc668a33a9d (patch)
tree5ce11c333ab085b2bb85cb8c989225f504c0c293 /ios
parente8ecfb59d4f906e0ab40b6046406b8af1366cb10 (diff)
downloadchromium_src-5e05b437032ffeb7bf9da7dcf1355fc668a33a9d.zip
chromium_src-5e05b437032ffeb7bf9da7dcf1355fc668a33a9d.tar.gz
chromium_src-5e05b437032ffeb7bf9da7dcf1355fc668a33a9d.tar.bz2
Convert Pass()→std::move() for iOS build.
BUG=557422 R=rickyz@chromium.org TBR=jam@chromium.org Review URL: https://codereview.chromium.org/1586833002 Cr-Commit-Position: refs/heads/master@{#369328}
Diffstat (limited to 'ios')
-rw-r--r--ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc4
-rw-r--r--ios/chrome/browser/autofill/personal_data_manager_factory.cc4
-rw-r--r--ios/chrome/browser/bookmarks/bookmark_client_factory.cc2
-rw-r--r--ios/chrome/browser/bookmarks/bookmark_model_factory.cc4
-rw-r--r--ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.cc36
-rw-r--r--ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc24
-rw-r--r--ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm12
-rw-r--r--ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_io_data.cc2
-rw-r--r--ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_settings.cc5
-rw-r--r--ios/chrome/browser/dom_distiller/distiller_viewer.cc3
-rw-r--r--ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc20
-rw-r--r--ios/chrome/browser/favicon/large_icon_cache.cc2
-rw-r--r--ios/chrome/browser/history/history_service_factory.cc4
-rw-r--r--ios/chrome/browser/infobars/infobar.mm5
-rw-r--r--ios/chrome/browser/infobars/infobar_manager_impl.cc4
-rw-r--r--ios/chrome/browser/infobars/infobar_utils.mm6
-rw-r--r--ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.cc6
-rw-r--r--ios/chrome/browser/ios_chrome_io_thread.cc16
-rw-r--r--ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc5
-rw-r--r--ios/chrome/browser/net/proxy_service_factory.cc8
-rw-r--r--ios/chrome/browser/passwords/credential_manager.mm4
-rw-r--r--ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm4
-rw-r--r--ios/chrome/browser/passwords/ios_chrome_password_store_factory.cc4
-rw-r--r--ios/chrome/browser/passwords/password_controller.mm3
-rw-r--r--ios/chrome/browser/prefs/ios_chrome_pref_service_factory.cc2
-rw-r--r--ios/chrome/browser/safe_browsing/ping_manager.cc4
-rw-r--r--ios/chrome/browser/signin/about_signin_internals_factory.cc4
-rw-r--r--ios/chrome/browser/signin/account_fetcher_service_factory.cc4
-rw-r--r--ios/chrome/browser/signin/account_reconcilor_factory.cc4
-rw-r--r--ios/chrome/browser/signin/account_tracker_service_factory.cc4
-rw-r--r--ios/chrome/browser/signin/fake_signin_manager_builder.cc4
-rw-r--r--ios/chrome/browser/signin/signin_client_impl.cc4
-rw-r--r--ios/chrome/browser/signin/signin_manager_factory.cc4
-rw-r--r--ios/chrome/browser/sync/ios_chrome_sync_client.cc4
-rw-r--r--ios/chrome/browser/translate/chrome_ios_translate_client.mm5
-rw-r--r--ios/chrome/browser/ui/autofill/autofill_client_ios.mm4
-rw-r--r--ios/chrome/browser/web_resource/web_resource_util_unittest.cc3
-rw-r--r--ios/crnet/crnet_environment.mm12
-rw-r--r--ios/net/crn_http_protocol_handler.mm3
-rw-r--r--ios/net/http_cache_helper.cc4
-rw-r--r--ios/net/protocol_handler_util_unittest.mm7
-rw-r--r--ios/web/app/web_main_loop.mm4
-rw-r--r--ios/web/interstitials/html_web_interstitial_impl.mm6
-rw-r--r--ios/web/interstitials/native_web_interstitial_impl.mm6
-rw-r--r--ios/web/navigation/crw_session_controller.mm7
-rw-r--r--ios/web/navigation/crw_session_controller_unittest.mm15
-rw-r--r--ios/web/navigation/crw_session_entry_unittest.mm7
-rw-r--r--ios/web/navigation/navigation_item_impl.mm4
-rw-r--r--ios/web/navigation/navigation_manager_impl.mm6
-rw-r--r--ios/web/net/cert_verifier_block_adapter.cc4
-rw-r--r--ios/web/public/web_controller_factory.mm12
-rw-r--r--ios/web/shell/shell_url_request_context_getter.cc16
-rw-r--r--ios/web/shell/view_controller.mm5
-rw-r--r--ios/web/test/web_test.mm8
-rw-r--r--ios/web/web_state/js/credential_util_unittest.mm18
-rw-r--r--ios/web/web_state/ui/crw_ui_web_view_web_controller.mm4
-rw-r--r--ios/web/web_state/ui/crw_web_controller.mm12
-rw-r--r--ios/web/web_state/ui/crw_web_controller_unittest.mm4
-rw-r--r--ios/web/web_state/ui/crw_wk_web_view_web_controller.mm6
-rw-r--r--ios/web/webui/crw_web_ui_manager.mm2
60 files changed, 253 insertions, 156 deletions
diff --git a/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc b/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc
index dcf734d..4ee7417 100644
--- a/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc
+++ b/ios/chrome/browser/autocomplete/in_memory_url_index_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/autocomplete/in_memory_url_index_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "base/prefs/pref_service.h"
#include "components/keyed_service/core/service_access_type.h"
@@ -39,7 +41,7 @@ scoped_ptr<KeyedService> BuildInMemoryURLIndex(web::BrowserState* context) {
browser_state->GetPrefs()->GetString(prefs::kAcceptLanguages),
schemes_to_whilelist));
in_memory_url_index->Init();
- return in_memory_url_index.Pass();
+ return std::move(in_memory_url_index);
}
} // namespace
diff --git a/ios/chrome/browser/autofill/personal_data_manager_factory.cc b/ios/chrome/browser/autofill/personal_data_manager_factory.cc
index 585f69e..178ea78 100644
--- a/ios/chrome/browser/autofill/personal_data_manager_factory.cc
+++ b/ios/chrome/browser/autofill/personal_data_manager_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
@@ -55,5 +57,5 @@ scoped_ptr<KeyedService> PersonalDataManagerFactory::BuildServiceInstanceFor(
chrome_browser_state),
ios::SigninManagerFactory::GetForBrowserState(chrome_browser_state),
chrome_browser_state->IsOffTheRecord());
- return service.Pass();
+ return std::move(service);
}
diff --git a/ios/chrome/browser/bookmarks/bookmark_client_factory.cc b/ios/chrome/browser/bookmarks/bookmark_client_factory.cc
index 15eb424..08f5c54 100644
--- a/ios/chrome/browser/bookmarks/bookmark_client_factory.cc
+++ b/ios/chrome/browser/bookmarks/bookmark_client_factory.cc
@@ -49,7 +49,7 @@ BookmarkClientFactory::~BookmarkClientFactory() {}
scoped_ptr<KeyedService> BookmarkClientFactory::BuildServiceInstanceFor(
web::BrowserState* context) const {
- return BuildBookmarkClientImpl(context).Pass();
+ return BuildBookmarkClientImpl(context);
}
web::BrowserState* BookmarkClientFactory::GetBrowserStateToUse(
diff --git a/ios/chrome/browser/bookmarks/bookmark_model_factory.cc b/ios/chrome/browser/bookmarks/bookmark_model_factory.cc
index 640dd1f..e386e8c 100644
--- a/ios/chrome/browser/bookmarks/bookmark_model_factory.cc
+++ b/ios/chrome/browser/bookmarks/bookmark_model_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "base/prefs/pref_service.h"
#include "components/bookmarks/browser/bookmark_model.h"
@@ -75,7 +77,7 @@ scoped_ptr<KeyedService> BookmarkModelFactory::BuildServiceInstanceFor(
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI));
ios::BookmarkUndoServiceFactory::GetForBrowserState(browser_state)
->Start(bookmark_model.get());
- return bookmark_model.Pass();
+ return std::move(bookmark_model);
}
web::BrowserState* BookmarkModelFactory::GetBrowserStateToUse(
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.cc b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.cc
index c009611..fb662f2 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.cc
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.cc
@@ -5,6 +5,7 @@
#include "ios/chrome/browser/browser_state/chrome_browser_state_impl_io_data.h"
#include <set>
+#include <utility>
#include "base/bind.h"
#include "base/callback.h"
@@ -67,7 +68,7 @@ ChromeBrowserStateImplIOData::Handle::~Handle() {
if (io_data_->data_reduction_proxy_io_data())
io_data_->data_reduction_proxy_io_data()->ShutdownOnUIThread();
- io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass());
+ io_data_->ShutdownOnUIThread(GetAllContextGetters());
}
void ChromeBrowserStateImplIOData::Handle::Init(
@@ -105,8 +106,7 @@ void ChromeBrowserStateImplIOData::Handle::Init(
browser_state_->GetPrefs(),
web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
- enable_quic_for_data_reduction_proxy)
- .Pass());
+ enable_quic_for_data_reduction_proxy));
base::SequencedWorkerPool* pool = web::WebThread::GetBlockingPool();
scoped_refptr<base::SequencedTaskRunner> db_task_runner =
@@ -118,7 +118,7 @@ void ChromeBrowserStateImplIOData::Handle::Init(
IOSChromeDataReductionProxySettingsFactory::GetForBrowserState(browser_state_)
->InitDataReductionProxySettings(
io_data_->data_reduction_proxy_io_data(), browser_state_->GetPrefs(),
- browser_state_->GetRequestContext(), store.Pass(),
+ browser_state_->GetRequestContext(), std::move(store),
web::WebThread::GetTaskRunnerForThread(web::WebThread::UI),
db_task_runner);
}
@@ -211,7 +211,7 @@ ChromeBrowserStateImplIOData::Handle::GetAllContextGetters() {
if (main_request_context_getter_.get())
context_getters->push_back(main_request_context_getter_);
- return context_getters.Pass();
+ return context_getters;
}
ChromeBrowserStateImplIOData::LazyParams::LazyParams() : cache_max_size(0) {}
@@ -254,10 +254,8 @@ void ChromeBrowserStateImplIOData::InitializeInternal(
main_context->set_net_log(io_thread->net_log());
- network_delegate_ =
- data_reduction_proxy_io_data()
- ->CreateNetworkDelegate(chrome_network_delegate.Pass(), true)
- .Pass();
+ network_delegate_ = data_reduction_proxy_io_data()->CreateNetworkDelegate(
+ std::move(chrome_network_delegate), true);
main_context->set_network_delegate(network_delegate_.get());
@@ -318,8 +316,8 @@ void ChromeBrowserStateImplIOData::InitializeInternal(
lazy_params_->cache_path, lazy_params_->cache_max_size,
web::WebThread::GetTaskRunnerForThread(web::WebThread::CACHE)));
http_network_session_ = CreateHttpNetworkSession(*profile_params);
- main_http_factory_ =
- CreateMainHttpFactory(http_network_session_.get(), main_backend.Pass());
+ main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(),
+ std::move(main_backend));
main_context->set_http_transaction_factory(main_http_factory_.get());
scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
@@ -332,8 +330,8 @@ void ChromeBrowserStateImplIOData::InitializeInternal(
request_interceptors.insert(
request_interceptors.begin(),
data_reduction_proxy_io_data()->CreateInterceptor().release());
- main_job_factory_ = SetUpJobFactoryDefaults(main_job_factory.Pass(),
- request_interceptors.Pass(),
+ main_job_factory_ = SetUpJobFactoryDefaults(std::move(main_job_factory),
+ std::move(request_interceptors),
main_context->network_delegate());
main_context->set_job_factory(main_job_factory_.get());
main_context->set_network_quality_estimator(
@@ -359,7 +357,7 @@ ChromeBrowserStateImplIOData::InitializeAppRequestContext(
scoped_ptr<net::HttpCache::BackendFactory> app_backend =
net::HttpCache::DefaultBackend::InMemory(0);
scoped_ptr<net::HttpCache> app_http_cache =
- CreateHttpFactory(http_network_session_.get(), app_backend.Pass());
+ CreateHttpFactory(http_network_session_.get(), std::move(app_backend));
cookie_util::CookieStoreConfig ios_cookie_config(
base::FilePath(),
@@ -370,7 +368,7 @@ ChromeBrowserStateImplIOData::InitializeAppRequestContext(
// Transfer ownership of the cookies and cache to AppRequestContext.
context->SetCookieStore(cookie_store.get());
- context->SetHttpTransactionFactory(app_http_cache.Pass());
+ context->SetHttpTransactionFactory(std::move(app_http_cache));
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
@@ -380,10 +378,10 @@ ChromeBrowserStateImplIOData::InitializeAppRequestContext(
request_interceptors.insert(
request_interceptors.begin(),
data_reduction_proxy_io_data()->CreateInterceptor().release());
- scoped_ptr<net::URLRequestJobFactory> top_job_factory(
- SetUpJobFactoryDefaults(job_factory.Pass(), request_interceptors.Pass(),
- main_context->network_delegate()));
- context->SetJobFactory(top_job_factory.Pass());
+ scoped_ptr<net::URLRequestJobFactory> top_job_factory(SetUpJobFactoryDefaults(
+ std::move(job_factory), std::move(request_interceptors),
+ main_context->network_delegate()));
+ context->SetJobFactory(std::move(top_job_factory));
return context;
}
diff --git a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc
index 10aa10c..8a965a8 100644
--- a/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc
+++ b/ios/chrome/browser/browser_state/chrome_browser_state_io_data.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -140,13 +141,13 @@ void ChromeBrowserStateIOData::AppRequestContext::SetCookieStore(
void ChromeBrowserStateIOData::AppRequestContext::SetHttpTransactionFactory(
scoped_ptr<net::HttpTransactionFactory> http_factory) {
- http_factory_ = http_factory.Pass();
+ http_factory_ = std::move(http_factory);
set_http_transaction_factory(http_factory_.get());
}
void ChromeBrowserStateIOData::AppRequestContext::SetJobFactory(
scoped_ptr<net::URLRequestJobFactory> job_factory) {
- job_factory_ = job_factory.Pass();
+ job_factory_ = std::move(job_factory);
set_job_factory(job_factory_.get());
}
@@ -308,7 +309,7 @@ bool ChromeBrowserStateIOData::IsDataReductionProxyEnabled() const {
void ChromeBrowserStateIOData::set_data_reduction_proxy_io_data(
scoped_ptr<data_reduction_proxy::DataReductionProxyIOData>
data_reduction_proxy_io_data) const {
- data_reduction_proxy_io_data_ = data_reduction_proxy_io_data.Pass();
+ data_reduction_proxy_io_data_ = std::move(data_reduction_proxy_io_data);
}
base::WeakPtr<net::HttpServerProperties>
@@ -318,7 +319,7 @@ ChromeBrowserStateIOData::http_server_properties() const {
void ChromeBrowserStateIOData::set_http_server_properties(
scoped_ptr<net::HttpServerProperties> http_server_properties) const {
- http_server_properties_ = http_server_properties.Pass();
+ http_server_properties_ = std::move(http_server_properties);
}
void ChromeBrowserStateIOData::Init(
@@ -352,7 +353,7 @@ void ChromeBrowserStateIOData::Init(
proxy_service_ = ios::ProxyServiceFactory::CreateProxyService(
io_thread->net_log(), nullptr,
io_thread_globals->system_network_delegate.get(),
- profile_params_->proxy_config_service.Pass(),
+ std::move(profile_params_->proxy_config_service),
true /* quick_check_enabled */);
transport_security_state_.reset(new net::TransportSecurityState());
base::SequencedWorkerPool* pool = web::WebThread::GetBlockingPool();
@@ -374,7 +375,7 @@ void ChromeBrowserStateIOData::Init(
main_request_context_->set_cert_verifier(
io_thread_globals->cert_verifier.get());
- InitializeInternal(network_delegate.Pass(), profile_params_.get(),
+ InitializeInternal(std::move(network_delegate), profile_params_.get(),
protocol_handlers);
profile_params_.reset();
@@ -410,15 +411,16 @@ ChromeBrowserStateIOData::SetUpJobFactoryDefaults(
make_scoped_ptr(new about_handler::AboutProtocolHandler()));
// Set up interceptors in the reverse order.
- scoped_ptr<net::URLRequestJobFactory> top_job_factory = job_factory.Pass();
+ scoped_ptr<net::URLRequestJobFactory> top_job_factory =
+ std::move(job_factory);
for (URLRequestInterceptorScopedVector::reverse_iterator i =
request_interceptors.rbegin();
i != request_interceptors.rend(); ++i) {
top_job_factory.reset(new net::URLRequestInterceptingJobFactory(
- top_job_factory.Pass(), make_scoped_ptr(*i)));
+ std::move(top_job_factory), make_scoped_ptr(*i)));
}
request_interceptors.weak_clear();
- return top_job_factory.Pass();
+ return top_job_factory;
}
void ChromeBrowserStateIOData::ShutdownOnUIThread(
@@ -479,12 +481,12 @@ scoped_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateMainHttpFactory(
net::HttpNetworkSession* session,
scoped_ptr<net::HttpCache::BackendFactory> main_backend) const {
return scoped_ptr<net::HttpCache>(
- new net::HttpCache(session, main_backend.Pass(), true));
+ new net::HttpCache(session, std::move(main_backend), true));
}
scoped_ptr<net::HttpCache> ChromeBrowserStateIOData::CreateHttpFactory(
net::HttpNetworkSession* shared_session,
scoped_ptr<net::HttpCache::BackendFactory> backend) const {
return scoped_ptr<net::HttpCache>(
- new net::HttpCache(shared_session, backend.Pass(), true));
+ new net::HttpCache(shared_session, std::move(backend), true));
}
diff --git a/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm b/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm
index 086f950..ca91041 100644
--- a/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm
+++ b/ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm
@@ -6,6 +6,8 @@
#import <UIKit/UIkit.h>
+#include <utility>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
@@ -88,7 +90,7 @@ OffTheRecordChromeBrowserStateIOData::Handle::~Handle() {
CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(), this,
nullptr, nullptr);
- io_data_->ShutdownOnUIThread(GetAllContextGetters().Pass());
+ io_data_->ShutdownOnUIThread(GetAllContextGetters());
}
scoped_refptr<IOSChromeURLRequestContextGetter>
@@ -136,7 +138,7 @@ OffTheRecordChromeBrowserStateIOData::Handle::GetAllContextGetters() {
if (main_request_context_getter_.get())
context_getters->push_back(main_request_context_getter_);
- return context_getters.Pass();
+ return context_getters;
}
OffTheRecordChromeBrowserStateIOData::OffTheRecordChromeBrowserStateIOData()
@@ -162,7 +164,7 @@ void OffTheRecordChromeBrowserStateIOData::InitializeInternal(
main_context->set_network_delegate(chrome_network_delegate.get());
- network_delegate_ = chrome_network_delegate.Pass();
+ network_delegate_ = std::move(chrome_network_delegate);
main_context->set_host_resolver(io_thread_globals->host_resolver.get());
main_context->set_http_auth_handler_factory(
@@ -211,8 +213,8 @@ void OffTheRecordChromeBrowserStateIOData::InitializeInternal(
InstallProtocolHandlers(main_job_factory.get(), protocol_handlers);
URLRequestInterceptorScopedVector empty_interceptors;
- main_job_factory_ = SetUpJobFactoryDefaults(main_job_factory.Pass(),
- empty_interceptors.Pass(),
+ main_job_factory_ = SetUpJobFactoryDefaults(std::move(main_job_factory),
+ std::move(empty_interceptors),
main_context->network_delegate());
main_context->set_job_factory(main_job_factory_.get());
diff --git a/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_io_data.cc b/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_io_data.cc
index e5e8e72..11380ce 100644
--- a/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_io_data.cc
+++ b/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_io_data.cc
@@ -45,5 +45,5 @@ CreateIOSChromeDataReductionProxyIOData(
data_reduction_proxy::DataReductionProxyConfigRetrievalParams::Create(
prefs));
- return data_reduction_proxy_io_data.Pass();
+ return data_reduction_proxy_io_data;
}
diff --git a/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_settings.cc b/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_settings.cc
index 7e4951a..a5d348f 100644
--- a/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_settings.cc
+++ b/ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_settings.cc
@@ -5,6 +5,7 @@
#include "ios/chrome/browser/data_reduction_proxy/ios_chrome_data_reduction_proxy_settings.h"
#include <string>
+#include <utility>
#include "base/base64.h"
#include "base/memory/ref_counted.h"
@@ -190,12 +191,12 @@ void IOSChromeDataReductionProxySettings::InitDataReductionProxySettings(
scoped_ptr<data_reduction_proxy::DataReductionProxyService> service =
make_scoped_ptr(new data_reduction_proxy::DataReductionProxyService(
- this, profile_prefs, request_context_getter, store.Pass(),
+ this, profile_prefs, request_context_getter, std::move(store),
ui_task_runner, io_data->io_task_runner(), db_task_runner,
commit_delay));
data_reduction_proxy::DataReductionProxySettings::
InitDataReductionProxySettings(prefs::kDataSaverEnabled, profile_prefs,
- io_data, service.Pass());
+ io_data, std::move(service));
io_data->SetDataReductionProxyService(
data_reduction_proxy_service()->GetWeakPtr());
diff --git a/ios/chrome/browser/dom_distiller/distiller_viewer.cc b/ios/chrome/browser/dom_distiller/distiller_viewer.cc
index 9ec3952..dd08d2c 100644
--- a/ios/chrome/browser/dom_distiller/distiller_viewer.cc
+++ b/ios/chrome/browser/dom_distiller/distiller_viewer.cc
@@ -5,6 +5,7 @@
#include "ios/chrome/browser/dom_distiller/distiller_viewer.h"
#include <string>
+#include <utility>
#include "components/dom_distiller/core/distilled_page_prefs.h"
#include "components/dom_distiller/core/dom_distiller_request_view_base.h"
@@ -34,7 +35,7 @@ DistillerViewer::DistillerViewer(ios::ChromeBrowserState* browser_state,
scoped_ptr<ViewerHandle> viewer_handle = distillerService->ViewUrl(
this, distillerService->CreateDefaultDistillerPage(gfx::Size()), url);
- TakeViewerHandle(viewer_handle.Pass());
+ TakeViewerHandle(std::move(viewer_handle));
}
DistillerViewer::~DistillerViewer() {
diff --git a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
index 5c4c22d0..79aa76d 100644
--- a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
+++ b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h"
+#include <utility>
+
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/memory/singleton.h"
@@ -34,10 +36,10 @@ class DomDistillerKeyedService
scoped_ptr<dom_distiller::DistillerFactory> distiller_factory,
scoped_ptr<dom_distiller::DistillerPageFactory> distiller_page_factory,
scoped_ptr<dom_distiller::DistilledPagePrefs> distilled_page_prefs)
- : DomDistillerService(store.Pass(),
- distiller_factory.Pass(),
- distiller_page_factory.Pass(),
- distilled_page_prefs.Pass()) {}
+ : DomDistillerService(std::move(store),
+ std::move(distiller_factory),
+ std::move(distiller_page_factory),
+ std::move(distilled_page_prefs)) {}
~DomDistillerKeyedService() override {}
@@ -83,7 +85,7 @@ scoped_ptr<KeyedService> DomDistillerServiceFactory::BuildServiceInstanceFor(
context->GetStatePath().Append(FILE_PATH_LITERAL("Articles")));
scoped_ptr<DomDistillerStore> dom_distiller_store(
- new DomDistillerStore(db.Pass(), database_dir));
+ new DomDistillerStore(std::move(db), database_dir));
scoped_ptr<DistillerPageFactory> distiller_page_factory(
new DistillerPageFactoryIOS(context));
@@ -91,14 +93,14 @@ scoped_ptr<KeyedService> DomDistillerServiceFactory::BuildServiceInstanceFor(
new DistillerURLFetcherFactory(context->GetRequestContext()));
dom_distiller::proto::DomDistillerOptions options;
- scoped_ptr<DistillerFactory> distiller_factory(
- new DistillerFactoryImpl(distiller_url_fetcher_factory.Pass(), options));
+ scoped_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl(
+ std::move(distiller_url_fetcher_factory), options));
scoped_ptr<DistilledPagePrefs> distilled_page_prefs(new DistilledPagePrefs(
ios::ChromeBrowserState::FromBrowserState(context)->GetPrefs()));
return make_scoped_ptr(new DomDistillerKeyedService(
- dom_distiller_store.Pass(), distiller_factory.Pass(),
- distiller_page_factory.Pass(), distilled_page_prefs.Pass()));
+ std::move(dom_distiller_store), std::move(distiller_factory),
+ std::move(distiller_page_factory), std::move(distilled_page_prefs)));
}
web::BrowserState* DomDistillerServiceFactory::GetBrowserStateToUse(
diff --git a/ios/chrome/browser/favicon/large_icon_cache.cc b/ios/chrome/browser/favicon/large_icon_cache.cc
index 6575d1e..2841a67 100644
--- a/ios/chrome/browser/favicon/large_icon_cache.cc
+++ b/ios/chrome/browser/favicon/large_icon_cache.cc
@@ -54,5 +54,5 @@ scoped_ptr<favicon_base::LargeIconResult> LargeIconCache::CloneLargeIconResult(
new favicon_base::LargeIconResult(new favicon_base::FallbackIconStyle(
*large_icon_result.fallback_icon_style.get())));
}
- return clone.Pass();
+ return clone;
}
diff --git a/ios/chrome/browser/history/history_service_factory.cc b/ios/chrome/browser/history/history_service_factory.cc
index 9514dd8..cebdaf5 100644
--- a/ios/chrome/browser/history/history_service_factory.cc
+++ b/ios/chrome/browser/history/history_service_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/history/history_service_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "base/prefs/pref_service.h"
#include "components/history/core/browser/history_database_params.h"
@@ -80,7 +82,7 @@ scoped_ptr<KeyedService> HistoryServiceFactory::BuildServiceInstanceFor(
browser_state->GetStatePath()))) {
return nullptr;
}
- return history_service.Pass();
+ return std::move(history_service);
}
web::BrowserState* HistoryServiceFactory::GetBrowserStateToUse(
diff --git a/ios/chrome/browser/infobars/infobar.mm b/ios/chrome/browser/infobars/infobar.mm
index b7f7453..00ae46b 100644
--- a/ios/chrome/browser/infobars/infobar.mm
+++ b/ios/chrome/browser/infobars/infobar.mm
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/infobars/infobar.h"
+#include <utility>
+
#include "base/logging.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/translate/core/browser/translate_infobar_delegate.h"
@@ -15,8 +17,7 @@ using infobars::InfoBar;
using infobars::InfoBarDelegate;
InfoBarIOS::InfoBarIOS(scoped_ptr<InfoBarDelegate> delegate)
- : InfoBar(delegate.Pass()) {
-}
+ : InfoBar(std::move(delegate)) {}
InfoBarIOS::~InfoBarIOS() {
DCHECK(controller_);
diff --git a/ios/chrome/browser/infobars/infobar_manager_impl.cc b/ios/chrome/browser/infobars/infobar_manager_impl.cc
index 551268b..57b95db 100644
--- a/ios/chrome/browser/infobars/infobar_manager_impl.cc
+++ b/ios/chrome/browser/infobars/infobar_manager_impl.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/infobars/infobar_manager_impl.h"
+#include <utility>
+
#include "components/infobars/core/confirm_infobar_delegate.h"
#include "components/infobars/core/infobar.h"
#include "components/infobars/core/infobar_delegate.h"
@@ -62,7 +64,7 @@ int InfoBarManagerImpl::GetActiveEntryID() {
scoped_ptr<infobars::InfoBar> InfoBarManagerImpl::CreateConfirmInfoBar(
scoped_ptr<ConfirmInfoBarDelegate> delegate) {
- return ::CreateConfirmInfoBar(delegate.Pass());
+ return ::CreateConfirmInfoBar(std::move(delegate));
}
void InfoBarManagerImpl::NavigationItemCommitted(
diff --git a/ios/chrome/browser/infobars/infobar_utils.mm b/ios/chrome/browser/infobars/infobar_utils.mm
index e4643df..f3e9a0b 100644
--- a/ios/chrome/browser/infobars/infobar_utils.mm
+++ b/ios/chrome/browser/infobars/infobar_utils.mm
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/infobars/infobar_utils.h"
+#include <utility>
+
#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "components/infobars/core/confirm_infobar_delegate.h"
@@ -12,9 +14,9 @@
scoped_ptr<infobars::InfoBar> CreateConfirmInfoBar(
scoped_ptr<ConfirmInfoBarDelegate> delegate) {
- scoped_ptr<InfoBarIOS> infobar(new InfoBarIOS(delegate.Pass()));
+ scoped_ptr<InfoBarIOS> infobar(new InfoBarIOS(std::move(delegate)));
base::scoped_nsobject<ConfirmInfoBarController> controller(
[[ConfirmInfoBarController alloc] initWithDelegate:infobar.get()]);
infobar->SetController(controller);
- return infobar.Pass();
+ return std::move(infobar);
}
diff --git a/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.cc b/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.cc
index 70b7a8f..132d02e 100644
--- a/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.cc
+++ b/ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/invalidation/ios_chrome_profile_invalidation_provider_factory.h"
+#include <utility>
+
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
@@ -68,7 +70,7 @@ IOSChromeProfileInvalidationProviderFactory::BuildServiceInstanceFor(
base::Closure()));
scoped_ptr<TiclInvalidationService> service(new TiclInvalidationService(
- web::GetWebClient()->GetUserAgent(false), identity_provider.Pass(),
+ web::GetWebClient()->GetUserAgent(false), std::move(identity_provider),
make_scoped_ptr(new invalidation::TiclProfileSettingsProvider(
browser_state->GetPrefs())),
IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state)
@@ -77,7 +79,7 @@ IOSChromeProfileInvalidationProviderFactory::BuildServiceInstanceFor(
service->Init(
make_scoped_ptr(new InvalidatorStorage(browser_state->GetPrefs())));
- return make_scoped_ptr(new ProfileInvalidationProvider(service.Pass()));
+ return make_scoped_ptr(new ProfileInvalidationProvider(std::move(service)));
}
void IOSChromeProfileInvalidationProviderFactory::RegisterBrowserStatePrefs(
diff --git a/ios/chrome/browser/ios_chrome_io_thread.cc b/ios/chrome/browser/ios_chrome_io_thread.cc
index 8fda0d9..4e3e557 100644
--- a/ios/chrome/browser/ios_chrome_io_thread.cc
+++ b/ios/chrome/browser/ios_chrome_io_thread.cc
@@ -6,6 +6,7 @@
#include <stddef.h>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -148,13 +149,13 @@ scoped_ptr<net::HostResolver> CreateGlobalHostResolver(net::NetLog* net_log) {
// rules on top of the real host resolver. This allows forwarding all requests
// through a designated test server.
if (!command_line.HasSwitch(switches::kIOSHostResolverRules))
- return global_host_resolver.Pass();
+ return global_host_resolver;
scoped_ptr<net::MappedHostResolver> remapped_resolver(
- new net::MappedHostResolver(global_host_resolver.Pass()));
+ new net::MappedHostResolver(std::move(global_host_resolver)));
remapped_resolver->SetRulesFromString(
command_line.GetSwitchValueASCII(switches::kIOSHostResolverRules));
- return remapped_resolver.Pass();
+ return std::move(remapped_resolver);
}
int GetSwitchValueAsInt(const base::CommandLine& command_line,
@@ -382,7 +383,7 @@ void IOSChromeIOThread::Init() {
scoped_ptr<IOSChromeNetworkDelegate> chrome_network_delegate(
new IOSChromeNetworkDelegate());
- globals_->system_network_delegate = chrome_network_delegate.Pass();
+ globals_->system_network_delegate = std::move(chrome_network_delegate);
globals_->host_resolver = CreateGlobalHostResolver(net_log_);
std::map<std::string, std::string> network_quality_estimator_params;
@@ -392,7 +393,7 @@ void IOSChromeIOThread::Init() {
scoped_ptr<net::ExternalEstimateProvider> external_estimate_provider;
// Pass ownership.
globals_->network_quality_estimator.reset(new net::NetworkQualityEstimator(
- external_estimate_provider.Pass(), network_quality_estimator_params));
+ std::move(external_estimate_provider), network_quality_estimator_params));
globals_->cert_verifier.reset(
new net::MultiThreadedCertVerifier(net::CertVerifyProc::CreateDefault()));
@@ -574,8 +575,7 @@ void IOSChromeIOThread::CreateDefaultAuthHandlerFactory() {
new net::HttpAuthPreferences(supported_schemes, std::string()));
globals_->http_auth_handler_factory =
net::HttpAuthHandlerRegistryFactory::Create(
- globals_->http_auth_preferences.get(), globals_->host_resolver.get())
- .Pass();
+ globals_->http_auth_preferences.get(), globals_->host_resolver.get());
}
void IOSChromeIOThread::ClearHostCache() {
@@ -692,7 +692,7 @@ void IOSChromeIOThread::InitSystemRequestContextOnIOThread() {
globals_->system_proxy_service = ios::ProxyServiceFactory::CreateProxyService(
net_log_, nullptr, globals_->system_network_delegate.get(),
- system_proxy_config_service_.Pass(), true /* quick_check_enabled */);
+ std::move(system_proxy_config_service_), true /* quick_check_enabled */);
globals_->system_request_context.reset(
ConstructSystemRequestContext(globals_, net_log_));
diff --git a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
index 8decbb8..c904249 100644
--- a/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
+++ b/ios/chrome/browser/metrics/ios_chrome_metrics_service_client.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -97,7 +98,7 @@ scoped_ptr<IOSChromeMetricsServiceClient> IOSChromeMetricsServiceClient::Create(
new IOSChromeMetricsServiceClient(state_manager));
client->Initialize();
- return client.Pass();
+ return client;
}
// static
@@ -254,7 +255,7 @@ void IOSChromeMetricsServiceClient::Initialize() {
new IOSStabilityMetricsProvider(metrics_service_.get()));
if (ios_stability_metrics_provider) {
metrics_service_->RegisterMetricsProvider(
- ios_stability_metrics_provider.Pass());
+ std::move(ios_stability_metrics_provider));
} else {
NOTREACHED() << "No IOSStabilityMetricsProvider registered.";
}
diff --git a/ios/chrome/browser/net/proxy_service_factory.cc b/ios/chrome/browser/net/proxy_service_factory.cc
index 3294394..456d8d9 100644
--- a/ios/chrome/browser/net/proxy_service_factory.cc
+++ b/ios/chrome/browser/net/proxy_service_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/net/proxy_service_factory.h"
+#include <utility>
+
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "ios/web/public/web_thread.h"
#include "net/proxy/proxy_config_service.h"
@@ -18,7 +20,7 @@ ProxyServiceFactory::CreateProxyConfigService(PrefProxyConfigTracker* tracker) {
net::ProxyService::CreateSystemProxyConfigService(
web::WebThread::GetTaskRunnerForThread(web::WebThread::IO),
web::WebThread::GetTaskRunnerForThread(web::WebThread::FILE)));
- return tracker->CreateTrackingProxyConfigService(base_service.Pass()).Pass();
+ return tracker->CreateTrackingProxyConfigService(std::move(base_service));
}
// static
@@ -50,9 +52,9 @@ scoped_ptr<net::ProxyService> ProxyServiceFactory::CreateProxyService(
DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO);
scoped_ptr<net::ProxyService> proxy_service(
net::ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service.Pass(), 0, net_log));
+ std::move(proxy_config_service), 0, net_log));
proxy_service->set_quick_check_enabled(quick_check_enabled);
- return proxy_service.Pass();
+ return proxy_service;
}
} // namespace ios
diff --git a/ios/chrome/browser/passwords/credential_manager.mm b/ios/chrome/browser/passwords/credential_manager.mm
index 405e22f..de20528 100644
--- a/ios/chrome/browser/passwords/credential_manager.mm
+++ b/ios/chrome/browser/passwords/credential_manager.mm
@@ -4,6 +4,8 @@
#import "ios/chrome/browser/passwords/credential_manager.h"
+#include <utility>
+
#include "base/ios/ios_util.h"
#import "base/ios/weak_nsobject.h"
#include "base/mac/bind_objc_block.h"
@@ -302,7 +304,7 @@ void CredentialManager::OnProvisionalSaveComplete() {
if (client_->IsSavingAndFillingEnabledForCurrentPage() &&
!form_manager_->IsBlacklisted()) {
client_->PromptUserToSaveOrUpdatePassword(
- form_manager_.Pass(),
+ std::move(form_manager_),
password_manager::CredentialSourceType::CREDENTIAL_SOURCE_API, false);
}
}
diff --git a/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm b/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm
index 73d1144..913e54a 100644
--- a/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm
+++ b/ios/chrome/browser/passwords/ios_chrome_password_manager_client.mm
@@ -4,6 +4,8 @@
#import "ios/chrome/browser/passwords/ios_chrome_password_manager_client.h"
+#include <utility>
+
#include "base/memory/scoped_ptr.h"
#include "components/autofill/core/common/password_form.h"
#include "components/browser_sync/browser/profile_sync_service.h"
@@ -72,7 +74,7 @@ bool IOSChromePasswordManagerClient::PromptUserToSaveOrUpdatePassword(
bool update_password) {
if (form_to_save->IsBlacklisted())
return false;
- [delegate_ showSavePasswordInfoBar:form_to_save.Pass()];
+ [delegate_ showSavePasswordInfoBar:std::move(form_to_save)];
return true;
}
diff --git a/ios/chrome/browser/passwords/ios_chrome_password_store_factory.cc b/ios/chrome/browser/passwords/ios_chrome_password_store_factory.cc
index 259e28d..0bf7e82 100644
--- a/ios/chrome/browser/passwords/ios_chrome_password_store_factory.cc
+++ b/ios/chrome/browser/passwords/ios_chrome_password_store_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/passwords/ios_chrome_password_store_factory.h"
+#include <utility>
+
#include "base/command_line.h"
#include "base/memory/singleton.h"
#include "components/browser_sync/browser/profile_sync_service.h"
@@ -81,7 +83,7 @@ IOSChromePasswordStoreFactory::BuildServiceInstanceFor(
scoped_refptr<password_manager::PasswordStore> store =
new password_manager::PasswordStoreDefault(
- main_thread_runner, db_thread_runner, login_db.Pass());
+ main_thread_runner, db_thread_runner, std::move(login_db));
if (!store->Init(ios::sync_start_util::GetFlareForSyncableService(
context->GetStatePath()))) {
// TODO(crbug.com/479725): Remove the LOG once this error is visible in the
diff --git a/ios/chrome/browser/passwords/password_controller.mm b/ios/chrome/browser/passwords/password_controller.mm
index 9b7c585..c4738b0 100644
--- a/ios/chrome/browser/passwords/password_controller.mm
+++ b/ios/chrome/browser/passwords/password_controller.mm
@@ -314,7 +314,8 @@ bool GetPageURLAndCheckTrustLevel(web::WebState* web_state, GURL* page_url) {
// InitPasswordFormFillData() that the preferred match (3rd parameter)
// should be one of the |matches|.
auto scoped_form = make_scoped_ptr(new autofill::PasswordForm(form));
- matches.insert(std::make_pair(form.username_value, scoped_form.Pass()));
+ matches.insert(
+ std::make_pair(form.username_value, std::move(scoped_form)));
autofill::InitPasswordFormFillData(form, matches, &form, false, false,
&formData);
[self fillPasswordForm:formData
diff --git a/ios/chrome/browser/prefs/ios_chrome_pref_service_factory.cc b/ios/chrome/browser/prefs/ios_chrome_pref_service_factory.cc
index 4a0aa50..3f0b416 100644
--- a/ios/chrome/browser/prefs/ios_chrome_pref_service_factory.cc
+++ b/ios/chrome/browser/prefs/ios_chrome_pref_service_factory.cc
@@ -68,7 +68,7 @@ scoped_ptr<syncable_prefs::PrefServiceSyncable> CreateBrowserStatePrefs(
scoped_ptr<syncable_prefs::PrefServiceSyncable> pref_service =
factory.CreateSyncable(pref_registry.get());
ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get());
- return pref_service.Pass();
+ return pref_service;
}
scoped_ptr<syncable_prefs::PrefServiceSyncable>
diff --git a/ios/chrome/browser/safe_browsing/ping_manager.cc b/ios/chrome/browser/safe_browsing/ping_manager.cc
index ebeb344..4ffa0d3 100644
--- a/ios/chrome/browser/safe_browsing/ping_manager.cc
+++ b/ios/chrome/browser/safe_browsing/ping_manager.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/safe_browsing/ping_manager.h"
+#include <utility>
+
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/strings/string_util.h"
@@ -134,7 +136,7 @@ void SafeBrowsingPingManager::ReportInvalidCertificateChain(
void SafeBrowsingPingManager::SetCertificateErrorReporterForTesting(
scoped_ptr<certificate_reporting::ErrorReporter>
certificate_error_reporter) {
- certificate_error_reporter_ = certificate_error_reporter.Pass();
+ certificate_error_reporter_ = std::move(certificate_error_reporter);
}
GURL SafeBrowsingPingManager::SafeBrowsingHitUrl(
diff --git a/ios/chrome/browser/signin/about_signin_internals_factory.cc b/ios/chrome/browser/signin/about_signin_internals_factory.cc
index 26d9a75..ba97b34 100644
--- a/ios/chrome/browser/signin/about_signin_internals_factory.cc
+++ b/ios/chrome/browser/signin/about_signin_internals_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/signin/about_signin_internals_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/signin/core/browser/about_signin_internals.h"
@@ -56,7 +58,7 @@ scoped_ptr<KeyedService> AboutSigninInternalsFactory::BuildServiceInstanceFor(
chrome_browser_state)));
service->Initialize(
SigninClientFactory::GetForBrowserState(chrome_browser_state));
- return service.Pass();
+ return std::move(service);
}
void AboutSigninInternalsFactory::RegisterBrowserStatePrefs(
diff --git a/ios/chrome/browser/signin/account_fetcher_service_factory.cc b/ios/chrome/browser/signin/account_fetcher_service_factory.cc
index 10b78e7..a539ec5 100644
--- a/ios/chrome/browser/signin/account_fetcher_service_factory.cc
+++ b/ios/chrome/browser/signin/account_fetcher_service_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/signin/account_fetcher_service_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/signin/core/browser/account_fetcher_service.h"
@@ -52,7 +54,7 @@ scoped_ptr<KeyedService> AccountFetcherServiceFactory::BuildServiceInstanceFor(
SigninClientFactory::GetForBrowserState(browser_state),
OAuth2TokenServiceFactory::GetForBrowserState(browser_state),
ios::AccountTrackerServiceFactory::GetForBrowserState(browser_state));
- return service.Pass();
+ return std::move(service);
}
} // namespace ios
diff --git a/ios/chrome/browser/signin/account_reconcilor_factory.cc b/ios/chrome/browser/signin/account_reconcilor_factory.cc
index 8023c8e..2685f48 100644
--- a/ios/chrome/browser/signin/account_reconcilor_factory.cc
+++ b/ios/chrome/browser/signin/account_reconcilor_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/signin/account_reconcilor_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/signin/core/browser/account_reconcilor.h"
@@ -50,7 +52,7 @@ scoped_ptr<KeyedService> AccountReconcilorFactory::BuildServiceInstanceFor(
GaiaCookieManagerServiceFactory::GetForBrowserState(
chrome_browser_state)));
reconcilor->Initialize(true /* start_reconcile_if_tokens_available */);
- return reconcilor.Pass();
+ return std::move(reconcilor);
}
} // namespace ios
diff --git a/ios/chrome/browser/signin/account_tracker_service_factory.cc b/ios/chrome/browser/signin/account_tracker_service_factory.cc
index df4918a..c3fbc48 100644
--- a/ios/chrome/browser/signin/account_tracker_service_factory.cc
+++ b/ios/chrome/browser/signin/account_tracker_service_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/signin/account_tracker_service_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "components/keyed_service/ios/browser_state_dependency_manager.h"
#include "components/signin/core/browser/account_tracker_service.h"
@@ -45,7 +47,7 @@ scoped_ptr<KeyedService> AccountTrackerServiceFactory::BuildServiceInstanceFor(
scoped_ptr<AccountTrackerService> service(new AccountTrackerService());
service->Initialize(
SigninClientFactory::GetForBrowserState(chrome_browser_state));
- return service.Pass();
+ return std::move(service);
}
} // namespace ios
diff --git a/ios/chrome/browser/signin/fake_signin_manager_builder.cc b/ios/chrome/browser/signin/fake_signin_manager_builder.cc
index e206cdf..c15cc57 100644
--- a/ios/chrome/browser/signin/fake_signin_manager_builder.cc
+++ b/ios/chrome/browser/signin/fake_signin_manager_builder.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/signin/fake_signin_manager_builder.h"
+#include <utility>
+
#include "components/signin/core/browser/fake_signin_manager.h"
#include "ios/chrome/browser/signin/account_tracker_service_factory.h"
#include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h"
@@ -28,7 +30,7 @@ scoped_ptr<KeyedService> BuildFakeSigninManager(
manager->Initialize(nullptr);
ios::SigninManagerFactory::GetInstance()
->NotifyObserversOfSigninManagerCreationForTesting(manager.get());
- return manager.Pass();
+ return std::move(manager);
}
} // namespace ios
diff --git a/ios/chrome/browser/signin/signin_client_impl.cc b/ios/chrome/browser/signin/signin_client_impl.cc
index 1295668..5a18bba 100644
--- a/ios/chrome/browser/signin/signin_client_impl.cc
+++ b/ios/chrome/browser/signin/signin_client_impl.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/command_line.h"
#include "base/guid.h"
#include "base/logging.h"
@@ -142,7 +144,7 @@ SigninClientImpl::AddCookieChangedCallback(
DCHECK(context_getter.get());
scoped_ptr<SigninCookieChangedSubscription> subscription(
new SigninCookieChangedSubscription(context_getter, url, name, callback));
- return subscription.Pass();
+ return std::move(subscription);
}
void SigninClientImpl::OnSignedIn(const std::string& account_id,
diff --git a/ios/chrome/browser/signin/signin_manager_factory.cc b/ios/chrome/browser/signin/signin_manager_factory.cc
index da3802a..c38756e 100644
--- a/ios/chrome/browser/signin/signin_manager_factory.cc
+++ b/ios/chrome/browser/signin/signin_manager_factory.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/signin/signin_manager_factory.h"
+#include <utility>
+
#include "base/memory/singleton.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/time/time.h"
@@ -91,7 +93,7 @@ scoped_ptr<KeyedService> SigninManagerFactory::BuildServiceInstanceFor(
service->Initialize(GetApplicationContext()->GetLocalState());
FOR_EACH_OBSERVER(SigninManagerFactoryObserver, observer_list_,
SigninManagerCreated(service.get()));
- return service.Pass();
+ return std::move(service);
}
void SigninManagerFactory::BrowserStateShutdown(web::BrowserState* context) {
diff --git a/ios/chrome/browser/sync/ios_chrome_sync_client.cc b/ios/chrome/browser/sync/ios_chrome_sync_client.cc
index b6f7858..164a04d 100644
--- a/ios/chrome/browser/sync/ios_chrome_sync_client.cc
+++ b/ios/chrome/browser/sync/ios_chrome_sync_client.cc
@@ -4,6 +4,8 @@
#include "ios/chrome/browser/sync/ios_chrome_sync_client.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/macros.h"
@@ -377,5 +379,5 @@ void IOSChromeSyncClient::ClearBrowsingData(base::Time start, base::Time end) {
void IOSChromeSyncClient::SetSyncApiComponentFactoryForTesting(
scoped_ptr<sync_driver::SyncApiComponentFactory> component_factory) {
- component_factory_ = component_factory.Pass();
+ component_factory_ = std::move(component_factory);
}
diff --git a/ios/chrome/browser/translate/chrome_ios_translate_client.mm b/ios/chrome/browser/translate/chrome_ios_translate_client.mm
index bc15df2..19fe8c0 100644
--- a/ios/chrome/browser/translate/chrome_ios_translate_client.mm
+++ b/ios/chrome/browser/translate/chrome_ios_translate_client.mm
@@ -4,6 +4,7 @@
#include "ios/chrome/browser/translate/chrome_ios_translate_client.h"
+#include <utility>
#include <vector>
#include "base/logging.h"
@@ -61,7 +62,7 @@ scoped_ptr<infobars::InfoBar> ChromeIOSTranslateClient::CreateInfoBar(
scoped_ptr<translate::TranslateInfoBarDelegate> delegate) const {
translate::TranslateStep step = delegate->translate_step();
- scoped_ptr<InfoBarIOS> infobar(new InfoBarIOS(delegate.Pass()));
+ scoped_ptr<InfoBarIOS> infobar(new InfoBarIOS(std::move(delegate)));
base::scoped_nsobject<InfoBarController> controller;
switch (step) {
case translate::TRANSLATE_STEP_AFTER_TRANSLATE:
@@ -85,7 +86,7 @@ scoped_ptr<infobars::InfoBar> ChromeIOSTranslateClient::CreateInfoBar(
NOTREACHED();
}
infobar->SetController(controller);
- return infobar.Pass();
+ return std::move(infobar);
}
void ChromeIOSTranslateClient::ShowTranslateUI(
diff --git a/ios/chrome/browser/ui/autofill/autofill_client_ios.mm b/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
index 37387a8..34d9d1c 100644
--- a/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_client_ios.mm
@@ -4,6 +4,8 @@
#import "ios/chrome/browser/ui/autofill/autofill_client_ios.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/prefs/pref_service.h"
#include "components/autofill/core/browser/autofill_cc_infobar_delegate.h"
@@ -31,7 +33,7 @@ AutofillClientIOS::AutofillClientIOS(
infobar_manager_(infobar_manager),
bridge_(bridge),
password_generation_manager_(password_generation_manager),
- identity_provider_(identity_provider.Pass()),
+ identity_provider_(std::move(identity_provider)),
unmask_controller_(browser_state->GetPrefs(),
browser_state->IsOffTheRecord()) {}
diff --git a/ios/chrome/browser/web_resource/web_resource_util_unittest.cc b/ios/chrome/browser/web_resource/web_resource_util_unittest.cc
index 92a1585..b01f6d9 100644
--- a/ios/chrome/browser/web_resource/web_resource_util_unittest.cc
+++ b/ios/chrome/browser/web_resource/web_resource_util_unittest.cc
@@ -5,6 +5,7 @@
#include "ios/chrome/browser/web_resource/web_resource_util.h"
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -34,7 +35,7 @@ class WebResourceUtilTest : public testing::Test {
// Called on success.
void OnParseSuccess(scoped_ptr<base::Value> value) {
success_called_ = true;
- value_ = value.Pass();
+ value_ = std::move(value);
}
// Called on error.
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm
index 3e5650f..0118dd7 100644
--- a/ios/crnet/crnet_environment.mm
+++ b/ios/crnet/crnet_environment.mm
@@ -6,6 +6,8 @@
#import <Foundation/Foundation.h>
+#include <utility>
+
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -198,7 +200,7 @@ void CrNetEnvironment::StartNetLogInternal(
net_log_observer_.reset(new net::WriteToFileNetLogObserver());
net_log_observer_->set_capture_mode(capture_mode);
- net_log_observer_->StartObserving(net_log_.get(), file.Pass(), nullptr,
+ net_log_observer_->StartObserving(net_log_.get(), std::move(file), nullptr,
nullptr);
}
@@ -407,7 +409,7 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
.release());
main_context_->set_proxy_service(
net::ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service_.Pass(), 0, nullptr)
+ std::move(proxy_config_service_), 0, nullptr)
.release());
// Cache
@@ -455,9 +457,9 @@ void CrNetEnvironment::InitializeOnNetworkThread() {
// See https://crbug.com/523858.
net::HttpNetworkSession* http_network_session =
new net::HttpNetworkSession(params);
- net::HttpCache* main_cache = new net::HttpCache(
- http_network_session, main_backend.Pass(),
- true /* set_up_quic_server_info */);
+ net::HttpCache* main_cache =
+ new net::HttpCache(http_network_session, std::move(main_backend),
+ true /* set_up_quic_server_info */);
main_context_->set_http_transaction_factory(main_cache);
// Cookies
diff --git a/ios/net/crn_http_protocol_handler.mm b/ios/net/crn_http_protocol_handler.mm
index 0f1a596..155829d 100644
--- a/ios/net/crn_http_protocol_handler.mm
+++ b/ios/net/crn_http_protocol_handler.mm
@@ -6,6 +6,7 @@
#include <stdint.h>
+#include <utility>
#include <vector>
#include "base/command_line.h"
@@ -724,7 +725,7 @@ void HttpProtocolHandlerCore::Start(id<CRNNetworkClientProtocol> base_client) {
scoped_ptr<UploadElementReader> reader(
new UploadOwnedBytesElementReader(&owned_data));
net_request_->set_upload(
- ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
+ ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
}
net_request_->Start();
diff --git a/ios/net/http_cache_helper.cc b/ios/net/http_cache_helper.cc
index 4e67b98..1702cac 100644
--- a/ios/net/http_cache_helper.cc
+++ b/ios/net/http_cache_helper.cc
@@ -4,6 +4,8 @@
#include "ios/net/http_cache_helper.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/callback.h"
@@ -67,7 +69,7 @@ void ClearHttpCacheOnIOThread(
scoped_ptr<disk_cache::Backend*> backend(new disk_cache::Backend*(nullptr));
disk_cache::Backend** backend_ptr = backend.get();
net::CompletionCallback doom_callback =
- base::Bind(&DoomHttpCache, base::Passed(backend.Pass()),
+ base::Bind(&DoomHttpCache, base::Passed(std::move(backend)),
client_task_runner, callback);
int rv = http_cache->GetBackend(backend_ptr, doom_callback);
diff --git a/ios/net/protocol_handler_util_unittest.mm b/ios/net/protocol_handler_util_unittest.mm
index 1193dc7..5e7226f 100644
--- a/ios/net/protocol_handler_util_unittest.mm
+++ b/ios/net/protocol_handler_util_unittest.mm
@@ -2,12 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "ios/net/protocol_handler_util.h"
+
+#include <utility>
+
#include "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/strings/sys_string_conversions.h"
-#import "ios/net/protocol_handler_util.h"
#include "net/base/elements_upload_data_stream.h"
#import "net/base/mac/url_conversions.h"
#include "net/base/upload_bytes_element_reader.h"
@@ -261,7 +264,7 @@ TEST_F(ProtocolHandlerUtilTest, AddMissingHeaders) {
scoped_ptr<UploadElementReader> reader(
new UploadBytesElementReader(nullptr, 0));
out_request->set_upload(
- ElementsUploadDataStream::CreateWithReader(reader.Pass(), 0));
+ ElementsUploadDataStream::CreateWithReader(std::move(reader), 0));
CopyHttpHeaders(in_request, out_request.get());
// Some headers are added by default if missing.
diff --git a/ios/web/app/web_main_loop.mm b/ios/web/app/web_main_loop.mm
index 8381158..05b3ee2 100644
--- a/ios/web/app/web_main_loop.mm
+++ b/ios/web/app/web_main_loop.mm
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/logging.h"
@@ -79,7 +81,7 @@ void WebMainLoop::MainMessageLoopStart() {
// TODO(rohitrao): Do we need PowerMonitor on iOS, or can we get rid of it?
scoped_ptr<base::PowerMonitorSource> power_monitor_source(
new base::PowerMonitorDeviceSource());
- power_monitor_.reset(new base::PowerMonitor(power_monitor_source.Pass()));
+ power_monitor_.reset(new base::PowerMonitor(std::move(power_monitor_source)));
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
if (parts_) {
diff --git a/ios/web/interstitials/html_web_interstitial_impl.mm b/ios/web/interstitials/html_web_interstitial_impl.mm
index 98439fe..f7f3f4f 100644
--- a/ios/web/interstitials/html_web_interstitial_impl.mm
+++ b/ios/web/interstitials/html_web_interstitial_impl.mm
@@ -4,6 +4,8 @@
#import "ios/web/interstitials/html_web_interstitial_impl.h"
+#include <utility>
+
#include "base/logging.h"
#include "base/strings/sys_string_conversions.h"
#include "ios/web/interstitials/web_interstitial_facade_delegate.h"
@@ -67,7 +69,7 @@ WebInterstitial* WebInterstitial::CreateHtmlInterstitial(
scoped_ptr<HtmlWebInterstitialDelegate> delegate) {
WebStateImpl* web_state_impl = static_cast<WebStateImpl*>(web_state);
return new HtmlWebInterstitialImpl(web_state_impl, new_navigation, url,
- delegate.Pass());
+ std::move(delegate));
}
HtmlWebInterstitialImpl::HtmlWebInterstitialImpl(
@@ -76,7 +78,7 @@ HtmlWebInterstitialImpl::HtmlWebInterstitialImpl(
const GURL& url,
scoped_ptr<HtmlWebInterstitialDelegate> delegate)
: WebInterstitialImpl(web_state, new_navigation, url),
- delegate_(delegate.Pass()) {
+ delegate_(std::move(delegate)) {
DCHECK(delegate_);
}
diff --git a/ios/web/interstitials/native_web_interstitial_impl.mm b/ios/web/interstitials/native_web_interstitial_impl.mm
index ea76b30..438705e 100644
--- a/ios/web/interstitials/native_web_interstitial_impl.mm
+++ b/ios/web/interstitials/native_web_interstitial_impl.mm
@@ -4,6 +4,8 @@
#include "ios/web/interstitials/native_web_interstitial_impl.h"
+#include <utility>
+
#include "base/logging.h"
#include "ios/web/public/interstitials/web_interstitial_delegate.h"
#import "ios/web/public/web_state/ui/crw_generic_content_view.h"
@@ -20,7 +22,7 @@ WebInterstitial* WebInterstitial::CreateNativeInterstitial(
scoped_ptr<NativeWebInterstitialDelegate> delegate) {
WebStateImpl* web_state_impl = static_cast<WebStateImpl*>(web_state);
return new NativeWebInterstitialImpl(web_state_impl, new_navigation, url,
- delegate.Pass());
+ std::move(delegate));
}
NativeWebInterstitialImpl::NativeWebInterstitialImpl(
@@ -29,7 +31,7 @@ NativeWebInterstitialImpl::NativeWebInterstitialImpl(
const GURL& url,
scoped_ptr<NativeWebInterstitialDelegate> delegate)
: web::WebInterstitialImpl(web_state, new_navigation, url),
- delegate_(delegate.Pass()) {
+ delegate_(std::move(delegate)) {
DCHECK(delegate_);
}
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index 71cc610..ba45a32 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <algorithm>
+#include <utility>
#include <vector>
#include "base/format_macros.h"
@@ -189,7 +190,7 @@ NSString* const kXCallbackParametersKey = @"xCallbackParameters";
for (size_t i = 0; i < items.size(); ++i) {
scoped_ptr<web::NavigationItem> item(items[i]);
base::scoped_nsobject<CRWSessionEntry> entry(
- [[CRWSessionEntry alloc] initWithNavigationItem:item.Pass()]);
+ [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]);
[_entries addObject:entry];
}
self.currentNavigationIndex = currentIndex;
@@ -889,8 +890,8 @@ NSString* const kXCallbackParametersKey = @"xCallbackParameters";
item->SetTransitionType(transition);
item->SetIsOverridingUserAgent(useDesktopUserAgent);
item->set_is_renderer_initiated(rendererInitiated);
- return [
- [[CRWSessionEntry alloc] initWithNavigationItem:item.Pass()] autorelease];
+ return [[[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]
+ autorelease];
}
@end
diff --git a/ios/web/navigation/crw_session_controller_unittest.mm b/ios/web/navigation/crw_session_controller_unittest.mm
index 8a9171c..807eff3 100644
--- a/ios/web/navigation/crw_session_controller_unittest.mm
+++ b/ios/web/navigation/crw_session_controller_unittest.mm
@@ -2,14 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "ios/web/navigation/crw_session_controller.h"
+
#import <Foundation/Foundation.h>
+#include <utility>
+
#include "base/logging.h"
#import "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/web/navigation/crw_session_controller+private_constructors.h"
-#import "ios/web/navigation/crw_session_controller.h"
#include "ios/web/navigation/crw_session_entry.h"
#include "ios/web/navigation/navigation_item_impl.h"
#include "ios/web/public/referrer.h"
@@ -754,7 +757,7 @@ web::NavigationItem* CreateNavigationItem(const std::string& url,
TEST_F(CRWSessionControllerTest, CreateWithEmptyNavigations) {
ScopedVector<web::NavigationItem> items;
base::scoped_nsobject<CRWSessionController> controller(
- [[CRWSessionController alloc] initWithNavigationItems:items.Pass()
+ [[CRWSessionController alloc] initWithNavigationItems:std::move(items)
currentIndex:0
browserState:&browser_state_]);
EXPECT_EQ(controller.get().entries.count, 0U);
@@ -772,7 +775,7 @@ TEST_F(CRWSessionControllerTest, CreateWithNavList) {
items.push_back(CreateNavigationItem("http://www.espn.com",
"http://www.nothing.com", @"ESPN"));
base::scoped_nsobject<CRWSessionController> controller(
- [[CRWSessionController alloc] initWithNavigationItems:items.Pass()
+ [[CRWSessionController alloc] initWithNavigationItems:std::move(items)
currentIndex:1
browserState:&browser_state_]);
@@ -831,7 +834,7 @@ TEST_F(CRWSessionControllerTest, PushNewEntry) {
items.push_back(CreateNavigationItem("http://www.thirdpage.com",
"http://www.secondpage.com", @"Third"));
base::scoped_nsobject<CRWSessionController> controller(
- [[CRWSessionController alloc] initWithNavigationItems:items.Pass()
+ [[CRWSessionController alloc] initWithNavigationItems:std::move(items)
currentIndex:0
browserState:&browser_state_]);
@@ -883,7 +886,7 @@ TEST_F(CRWSessionControllerTest, IsPushStateNavigation) {
items.push_back(CreateNavigationItem("http://foo.com/bar#bar",
"http://foo.com/bar", @"Sixth"));
base::scoped_nsobject<CRWSessionController> controller(
- [[CRWSessionController alloc] initWithNavigationItems:items.Pass()
+ [[CRWSessionController alloc] initWithNavigationItems:std::move(items)
currentIndex:0
browserState:&browser_state_]);
CRWSessionEntry* entry0 = [controller.get().entries objectAtIndex:0];
@@ -919,7 +922,7 @@ TEST_F(CRWSessionControllerTest, UpdateCurrentEntry) {
items.push_back(CreateNavigationItem("http://www.thirdpage.com",
"http://www.secondpage.com", @"Third"));
base::scoped_nsobject<CRWSessionController> controller(
- [[CRWSessionController alloc] initWithNavigationItems:items.Pass()
+ [[CRWSessionController alloc] initWithNavigationItems:std::move(items)
currentIndex:0
browserState:&browser_state_]);
diff --git a/ios/web/navigation/crw_session_entry_unittest.mm b/ios/web/navigation/crw_session_entry_unittest.mm
index de5f7e7..3d7aae9 100644
--- a/ios/web/navigation/crw_session_entry_unittest.mm
+++ b/ios/web/navigation/crw_session_entry_unittest.mm
@@ -2,13 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#import "ios/web/navigation/crw_session_entry.h"
+
#import <Foundation/Foundation.h>
#include <stdint.h>
+#include <utility>
+
#include "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#import "ios/testing/ocmock_complex_type_helper.h"
-#import "ios/web/navigation/crw_session_entry.h"
#include "ios/web/navigation/navigation_item_impl.h"
#include "ios/web/public/referrer.h"
#import "net/base/mac/url_conversions.h"
@@ -42,7 +45,7 @@ class CRWSessionEntryTest : public PlatformTest {
item->SetTimestamp(base::Time::Now());
item->SetPostData([@"Test data" dataUsingEncoding:NSUTF8StringEncoding]);
sessionEntry_.reset(
- [[CRWSessionEntry alloc] initWithNavigationItem:item.Pass()]);
+ [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]);
}
void TearDown() override { sessionEntry_.reset(); }
diff --git a/ios/web/navigation/navigation_item_impl.mm b/ios/web/navigation/navigation_item_impl.mm
index 9d5e3a0..121323f 100644
--- a/ios/web/navigation/navigation_item_impl.mm
+++ b/ios/web/navigation/navigation_item_impl.mm
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "components/url_formatter/url_formatter.h"
@@ -70,7 +72,7 @@ NavigationItemImpl::NavigationItemImpl(const NavigationItemImpl& item)
void NavigationItemImpl::SetFacadeDelegate(
scoped_ptr<NavigationItemFacadeDelegate> facade_delegate) {
- facade_delegate_ = facade_delegate.Pass();
+ facade_delegate_ = std::move(facade_delegate);
}
NavigationItemFacadeDelegate* NavigationItemImpl::GetFacadeDelegate() const {
diff --git a/ios/web/navigation/navigation_manager_impl.mm b/ios/web/navigation/navigation_manager_impl.mm
index 647171b..4a5f4eb 100644
--- a/ios/web/navigation/navigation_manager_impl.mm
+++ b/ios/web/navigation/navigation_manager_impl.mm
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/logging.h"
#import "ios/web/navigation/crw_session_controller+private_constructors.h"
#import "ios/web/navigation/crw_session_controller.h"
@@ -74,7 +76,7 @@ void NavigationManagerImpl::ReplaceSessionHistory(
ScopedVector<web::NavigationItem> items,
int current_index) {
SetSessionController([[[CRWSessionController alloc]
- initWithNavigationItems:items.Pass()
+ initWithNavigationItems:std::move(items)
currentIndex:current_index
browserState:browser_state_] autorelease]);
}
@@ -273,7 +275,7 @@ void NavigationManagerImpl::Reload(bool check_for_reposts) {
scoped_ptr<std::vector<BrowserURLRewriter::URLRewriter>>
NavigationManagerImpl::GetTransientURLRewriters() {
- return transient_url_rewriters_.Pass();
+ return std::move(transient_url_rewriters_);
}
void NavigationManagerImpl::RemoveTransientURLRewriters() {
diff --git a/ios/web/net/cert_verifier_block_adapter.cc b/ios/web/net/cert_verifier_block_adapter.cc
index 932604b..dd3a836 100644
--- a/ios/web/net/cert_verifier_block_adapter.cc
+++ b/ios/web/net/cert_verifier_block_adapter.cc
@@ -4,6 +4,8 @@
#include "ios/web/net/cert_verifier_block_adapter.h"
+#include <utility>
+
#include "base/mac/bind_objc_block.h"
#include "net/base/net_errors.h"
#include "net/cert/crl_set.h"
@@ -94,7 +96,7 @@ void CertVerifierBlockAdapter::Verify(
// However, it guarantees that |callback| - and thus |completion_handler| -
// will always be called, which is a necessary part of the API contract of
// |CertVerifierBlockAdapter::Verify()|.
- context->request = request.Pass();
+ context->request = std::move(request);
// Completion handler will be called from |callback| when verification
// request is completed.
return;
diff --git a/ios/web/public/web_controller_factory.mm b/ios/web/public/web_controller_factory.mm
index fe4641b..0235ea7 100644
--- a/ios/web/public/web_controller_factory.mm
+++ b/ios/web/public/web_controller_factory.mm
@@ -4,6 +4,8 @@
#import "ios/web/public/web_controller_factory.h"
+#include <utility>
+
#include "ios/web/public/browser_state.h"
#import "ios/web/web_state/ui/crw_ui_web_view_web_controller.h"
#import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h"
@@ -15,11 +17,11 @@ CRWWebController* CreateWebController(WebViewType web_view_type,
scoped_ptr<WebStateImpl> web_state) {
switch (web_view_type) {
case UI_WEB_VIEW_TYPE:
- return
- [[CRWUIWebViewWebController alloc] initWithWebState:web_state.Pass()];
+ return [[CRWUIWebViewWebController alloc]
+ initWithWebState:std::move(web_state)];
case WK_WEB_VIEW_TYPE:
- return
- [[CRWWKWebViewWebController alloc] initWithWebState:web_state.Pass()];
+ return [[CRWWKWebViewWebController alloc]
+ initWithWebState:std::move(web_state)];
}
NOTREACHED();
return nil;
@@ -30,7 +32,7 @@ CRWWebController* CreateWebController(WebViewType web_view_type,
DCHECK(browser_state);
scoped_ptr<web::WebStateImpl> web_state(new web::WebStateImpl(browser_state));
web_state->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, -1);
- return CreateWebController(web_view_type, web_state.Pass());
+ return CreateWebController(web_view_type, std::move(web_state));
}
} // namespace web
diff --git a/ios/web/shell/shell_url_request_context_getter.cc b/ios/web/shell/shell_url_request_context_getter.cc
index c15db25..307e4b8 100644
--- a/ios/web/shell/shell_url_request_context_getter.cc
+++ b/ios/web/shell/shell_url_request_context_getter.cc
@@ -4,6 +4,8 @@
#include "ios/web/shell/shell_url_request_context_getter.h"
+#include <utility>
+
#include "base/base_paths.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
@@ -87,7 +89,8 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
new net::StaticHttpUserAgentSettings("en-us,en", user_agent)));
storage_->set_proxy_service(
net::ProxyService::CreateUsingSystemProxyResolver(
- proxy_config_service_.Pass(), 0, url_request_context_->net_log()));
+ std::move(proxy_config_service_), 0,
+ url_request_context_->net_log()));
storage_->set_ssl_config_service(new net::SSLConfigServiceDefaults);
storage_->set_cert_verifier(net::CertVerifier::CreateDefault());
@@ -107,7 +110,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
url_request_context_->net_log()));
storage_->set_http_auth_handler_factory(
net::HttpAuthHandlerFactory::CreateDefault(host_resolver.get()));
- storage_->set_host_resolver(host_resolver.Pass());
+ storage_->set_host_resolver(std::move(host_resolver));
net::HttpNetworkSession::Params network_session_params;
network_session_params.cert_verifier =
@@ -137,10 +140,9 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
storage_->set_http_network_session(
make_scoped_ptr(new net::HttpNetworkSession(network_session_params)));
- storage_->set_http_transaction_factory(make_scoped_ptr(
- new net::HttpCache(storage_->http_network_session(),
- main_backend.Pass(),
- true /* set_up_quic_server_info */)));
+ storage_->set_http_transaction_factory(make_scoped_ptr(new net::HttpCache(
+ storage_->http_network_session(), std::move(main_backend),
+ true /* set_up_quic_server_info */)));
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
@@ -148,7 +150,7 @@ net::URLRequestContext* ShellURLRequestContextGetter::GetURLRequestContext() {
"data", make_scoped_ptr(new net::DataProtocolHandler));
DCHECK(set_protocol);
- storage_->set_job_factory(job_factory.Pass());
+ storage_->set_job_factory(std::move(job_factory));
}
return url_request_context_.get();
diff --git a/ios/web/shell/view_controller.mm b/ios/web/shell/view_controller.mm
index 4bd2c10..3d3ce35 100644
--- a/ios/web/shell/view_controller.mm
+++ b/ios/web/shell/view_controller.mm
@@ -6,6 +6,8 @@
#include <stdint.h>
+#include <utility>
+
#include "base/mac/objc_property_releaser.h"
#import "base/mac/scoped_nsobject.h"
#include "base/memory/scoped_ptr.h"
@@ -126,7 +128,8 @@ NSString* const kWebShellAddressFieldAccessibilityLabel = @"Address field";
webState->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, 0);
web::WebViewType webViewType =
UseWKWebView() ? web::WK_WEB_VIEW_TYPE : web::UI_WEB_VIEW_TYPE;
- _webController.reset(web::CreateWebController(webViewType, webState.Pass()));
+ _webController.reset(
+ web::CreateWebController(webViewType, std::move(webState)));
[_webController setDelegate:self];
[_webController setUIDelegate:self];
[_webController setWebUsageEnabled:YES];
diff --git a/ios/web/test/web_test.mm b/ios/web/test/web_test.mm
index cc49404..f6c781c 100644
--- a/ios/web/test/web_test.mm
+++ b/ios/web/test/web_test.mm
@@ -4,6 +4,8 @@
#import "ios/web/test/web_test.h"
+#include <utility>
+
#include "base/base64.h"
#include "base/strings/stringprintf.h"
#import "base/test/ios/wait_util.h"
@@ -263,7 +265,7 @@ NSString* WebTestWithWebController::CreateLoadCheck() {
CRWWebController* WebTestWithUIWebViewWebController::CreateWebController() {
scoped_ptr<WebStateImpl> web_state_impl(new WebStateImpl(GetBrowserState()));
- return [[TestWebController alloc] initWithWebState:web_state_impl.Pass()];
+ return [[TestWebController alloc] initWithWebState:std::move(web_state_impl)];
}
void WebTestWithUIWebViewWebController::LoadCommands(NSString* commands,
@@ -279,8 +281,8 @@ void WebTestWithUIWebViewWebController::LoadCommands(NSString* commands,
CRWWebController* WebTestWithWKWebViewWebController::CreateWebController() {
scoped_ptr<WebStateImpl> web_state_impl(new WebStateImpl(GetBrowserState()));
- return [[CRWWKWebViewWebController alloc] initWithWebState:
- web_state_impl.Pass()];
+ return [[CRWWKWebViewWebController alloc]
+ initWithWebState:std::move(web_state_impl)];
}
} // namespace web
diff --git a/ios/web/web_state/js/credential_util_unittest.mm b/ios/web/web_state/js/credential_util_unittest.mm
index 7982ea1..50e05da 100644
--- a/ios/web/web_state/js/credential_util_unittest.mm
+++ b/ios/web/web_state/js/credential_util_unittest.mm
@@ -69,7 +69,7 @@ scoped_ptr<base::DictionaryValue> GetTestPasswordCredentialDictionaryValue() {
value->SetString("name", kTestCredentialName);
value->SetString("avatarURL", kTestCredentialAvatarURL);
value->SetString("password", kTestCredentialPassword);
- return value.Pass();
+ return value;
}
// Returns a value representing the credential returned by
@@ -81,7 +81,7 @@ scoped_ptr<base::DictionaryValue> GetTestFederatedCredentialDictionaryValue() {
value->SetString("name", kTestCredentialName);
value->SetString("avatarURL", kTestCredentialAvatarURL);
value->SetString("federation", kTestCredentialFederationURL);
- return value.Pass();
+ return value;
}
// Tests that parsing an empty value fails.
@@ -112,7 +112,7 @@ TEST(CredentialUtilTest, ParsingPasswordCredentialSucceeds) {
// specified fails.
TEST(CredentialUtilTest, ParsingPasswordCredentialWithNoIDFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestPasswordCredentialDictionaryValue().Pass());
+ GetTestPasswordCredentialDictionaryValue());
value->RemoveWithoutPathExpansion("id", nullptr);
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
@@ -122,7 +122,7 @@ TEST(CredentialUtilTest, ParsingPasswordCredentialWithNoIDFails) {
// formed avatarURL fails.
TEST(CredentialUtilTest, ParsingPasswordCredentialWithBadAvatarURLFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestPasswordCredentialDictionaryValue().Pass());
+ GetTestPasswordCredentialDictionaryValue());
value->SetString("avatarURL", "foo");
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
@@ -132,7 +132,7 @@ TEST(CredentialUtilTest, ParsingPasswordCredentialWithBadAvatarURLFails) {
// specified fails.
TEST(CredentialUtilTest, ParsingPasswordCredentialWithNoPasswordFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestPasswordCredentialDictionaryValue().Pass());
+ GetTestPasswordCredentialDictionaryValue());
value->Remove("password", nullptr);
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
@@ -151,7 +151,7 @@ TEST(CredentialUtilTest, ParsingFederatedCredentialSucceeds) {
// fails.
TEST(CredentialUtilTest, ParsingFederatedCredentialWithNoIDFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestFederatedCredentialDictionaryValue().Pass());
+ GetTestFederatedCredentialDictionaryValue());
value->RemoveWithoutPathExpansion("id", nullptr);
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
@@ -161,7 +161,7 @@ TEST(CredentialUtilTest, ParsingFederatedCredentialWithNoIDFails) {
// formed avatarURL fails.
TEST(CredentialUtilTest, ParsingFederatedCredentialWithBadAvatarURLFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestFederatedCredentialDictionaryValue().Pass());
+ GetTestFederatedCredentialDictionaryValue());
value->SetString("avatarURL", "foo");
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
@@ -171,7 +171,7 @@ TEST(CredentialUtilTest, ParsingFederatedCredentialWithBadAvatarURLFails) {
// federation URL fails.
TEST(CredentialUtilTest, ParsingFederatedValueWithNoFederationURLFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestFederatedCredentialDictionaryValue().Pass());
+ GetTestFederatedCredentialDictionaryValue());
value->Remove("federation", nullptr);
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
@@ -181,7 +181,7 @@ TEST(CredentialUtilTest, ParsingFederatedValueWithNoFederationURLFails) {
// formed federationURL fails.
TEST(CredentialUtilTest, ParsingFederatedValueWithBadFederationURLFails) {
scoped_ptr<base::DictionaryValue> value(
- GetTestFederatedCredentialDictionaryValue().Pass());
+ GetTestFederatedCredentialDictionaryValue());
value->SetString("federation", "bar");
Credential credential;
EXPECT_FALSE(DictionaryValueToCredential(*value, &credential));
diff --git a/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm b/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
index c9e836d..c78e0c0 100644
--- a/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_ui_web_view_web_controller.mm
@@ -7,6 +7,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <utility>
+
#import "base/ios/ios_util.h"
#import "base/ios/ns_error_util.h"
#import "base/ios/weak_nsobject.h"
@@ -328,7 +330,7 @@ const size_t kMaxMessageQueueSize = 262144;
@implementation CRWUIWebViewWebController
- (instancetype)initWithWebState:(scoped_ptr<web::WebStateImpl>)webState {
- self = [super initWithWebState:webState.Pass()];
+ self = [super initWithWebState:std::move(webState)];
if (self) {
_jsInvokeParameterQueue.reset([[CRWJSInvokeParameterQueue alloc] init]);
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 54449b7..18aaf16 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -6,7 +6,9 @@
#import <objc/runtime.h>
#include <stddef.h>
+
#include <cmath>
+#include <utility>
#include "base/ios/block_types.h"
#import "base/ios/ns_error_util.h"
@@ -585,7 +587,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
- (instancetype)initWithWebState:(scoped_ptr<WebStateImpl>)webState {
self = [super init];
if (self) {
- _webStateImpl = webState.Pass();
+ _webStateImpl = std::move(webState);
DCHECK(_webStateImpl);
_webStateImpl->SetWebController(self);
_webStateImpl->InitializeRequestTracker(self);
@@ -894,7 +896,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
}
- (void)setDOMElementForLastTouch:(scoped_ptr<base::DictionaryValue>)element {
- _DOMElementForLastTouch = element.Pass();
+ _DOMElementForLastTouch = std::move(element);
}
- (void)showContextMenu:(UIGestureRecognizer*)gestureRecognizer {
@@ -1884,7 +1886,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
if (handler) {
scoped_ptr<base::Value> result(
base::JSONReader::Read(base::SysNSStringToUTF8(stringResult)));
- handler(result.Pass(), error);
+ handler(std::move(result), error);
}
}];
}
@@ -2994,7 +2996,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
base::WeakNSObject<CRWWebController> weakSelf(self);
[self fetchDOMElementAtPoint:[touch locationInView:self.webView]
completionHandler:^(scoped_ptr<base::DictionaryValue> element) {
- [weakSelf setDOMElementForLastTouch:element.Pass()];
+ [weakSelf setDOMElementForLastTouch:std::move(element)];
}];
return YES;
}
@@ -3584,7 +3586,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
// |element| scoped_ptr.
elementAsDict.reset(elementAsDictPtr);
}
- handler(elementAsDict.Pass());
+ handler(std::move(elementAsDict));
}];
}];
}
diff --git a/ios/web/web_state/ui/crw_web_controller_unittest.mm b/ios/web/web_state/ui/crw_web_controller_unittest.mm
index ac5234d..c97ebe1 100644
--- a/ios/web/web_state/ui/crw_web_controller_unittest.mm
+++ b/ios/web/web_state/ui/crw_web_controller_unittest.mm
@@ -7,6 +7,8 @@
#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>
+#include <utility>
+
#include "base/callback_helpers.h"
#include "base/ios/ios_util.h"
#import "base/mac/bind_objc_block.h"
@@ -1118,7 +1120,7 @@ TEST_F(CRWUIWebViewWebControllerTest, POSTRequestCache) {
item->SetTransitionType(ui::PAGE_TRANSITION_FORM_SUBMIT);
item->set_is_renderer_initiated(true);
base::scoped_nsobject<CRWSessionEntry> currentEntry(
- [[CRWSessionEntry alloc] initWithNavigationItem:item.Pass()]);
+ [[CRWSessionEntry alloc] initWithNavigationItem:std::move(item)]);
base::scoped_nsobject<NSMutableURLRequest> request(
[[NSMutableURLRequest alloc] initWithURL:net::NSURLWithGURL(url)]);
[request setHTTPMethod:@"POST"];
diff --git a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
index 632cab3..5cedc12 100644
--- a/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
+++ b/ios/web/web_state/ui/crw_wk_web_view_web_controller.mm
@@ -4,8 +4,10 @@
#import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h"
-#include <stddef.h>
#import <WebKit/WebKit.h>
+#include <stddef.h>
+
+#include <utility>
#include "base/containers/mru_cache.h"
#include "base/ios/ios_util.h"
@@ -414,7 +416,7 @@ WKWebViewErrorSource WKWebViewErrorSourceFromError(NSError* error) {
- (instancetype)initWithWebState:(scoped_ptr<web::WebStateImpl>)webState {
DCHECK(webState);
web::BrowserState* browserState = webState->GetBrowserState();
- self = [super initWithWebState:webState.Pass()];
+ self = [super initWithWebState:std::move(webState)];
if (self) {
_certVerificationController.reset([[CRWCertVerificationController alloc]
initWithBrowserState:browserState]);
diff --git a/ios/web/webui/crw_web_ui_manager.mm b/ios/web/webui/crw_web_ui_manager.mm
index aeeaadd..99c437b 100644
--- a/ios/web/webui/crw_web_ui_manager.mm
+++ b/ios/web/webui/crw_web_ui_manager.mm
@@ -155,7 +155,7 @@ const char kScriptCommandPrefix[] = "webui";
};
_fetchers.push_back(
- [self fetcherForURL:URL completionHandler:fetcherCompletion].Pass());
+ [self fetcherForURL:URL completionHandler:fetcherCompletion]);
_fetchers.back()->Start();
}