diff options
93 files changed, 422 insertions, 299 deletions
diff --git a/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc index eafc1e5..ecb8d09 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_service_client_apitest.cc @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "base/bind.h" #include "base/callback.h" #include "base/command_line.h" @@ -89,7 +91,7 @@ class NetworkingPrivateServiceClientApiTest : public ExtensionApiTest { scoped_ptr<wifi::FakeWiFiService> wifi_service(new wifi::FakeWiFiService()); scoped_ptr<CryptoVerifyStub> crypto_verify(new CryptoVerifyStub); return scoped_ptr<KeyedService>(new NetworkingPrivateServiceClient( - wifi_service.Pass(), crypto_verify.Pass())); + std::move(wifi_service), std::move(crypto_verify))); } void SetUpOnMainThread() override { diff --git a/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc b/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc index 112def1..1f58e3d 100644 --- a/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/iphoto_file_util.cc @@ -6,6 +6,7 @@ #include <set> #include <string> +#include <utility> #include <vector> #include "base/bind_helpers.h" @@ -84,7 +85,7 @@ void IPhotoFileUtil::GetFileInfoOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false); + GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false); } else { data_provider->RefreshData( base::Bind(&IPhotoFileUtil::GetFileInfoWithFreshDataProvider, @@ -101,7 +102,8 @@ void IPhotoFileUtil::ReadDirectoryOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false); + ReadDirectoryWithFreshDataProvider(std::move(context), url, callback, + false); } else { data_provider->RefreshData( base::Bind(&IPhotoFileUtil::ReadDirectoryWithFreshDataProvider, @@ -118,7 +120,7 @@ void IPhotoFileUtil::CreateSnapshotFileOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - CreateSnapshotFileWithFreshDataProvider(context.Pass(), url, callback, + CreateSnapshotFileWithFreshDataProvider(std::move(context), url, callback, false); } else { data_provider->RefreshData( @@ -142,7 +144,7 @@ void IPhotoFileUtil::GetFileInfoWithFreshDataProvider( } return; } - NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(context.Pass(), url, + NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url, callback); } @@ -160,7 +162,7 @@ void IPhotoFileUtil::ReadDirectoryWithFreshDataProvider( } return; } - NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(context.Pass(), url, + NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url, callback); } @@ -182,8 +184,8 @@ void IPhotoFileUtil::CreateSnapshotFileWithFreshDataProvider( } return; } - NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(context.Pass(), url, - callback); + NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(std::move(context), + url, callback); } // Begin actual implementation. diff --git a/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc index 0aa61c8..c912ef5 100644 --- a/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/iphoto_file_util_unittest.cc @@ -2,9 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h" + #include <map> #include <set> #include <string> +#include <utility> #include <vector> #include "base/bind.h" @@ -18,7 +21,6 @@ #include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "chrome/browser/media_galleries/fileapi/iphoto_data_provider.h" -#include "chrome/browser/media_galleries/fileapi/iphoto_file_util.h" #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" @@ -213,11 +215,8 @@ class IPhotoFileUtilTest : public testing::Test { base::ThreadTaskRunnerHandle::Get().get(), base::ThreadTaskRunnerHandle::Get().get(), storage::ExternalMountPoints::CreateRefCounted().get(), - storage_policy.get(), - NULL, - additional_providers.Pass(), - std::vector<storage::URLRequestAutoMountHandler>(), - profile_dir_.path(), + storage_policy.get(), NULL, std::move(additional_providers), + std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(), content::CreateAllowFileAccessOptions()); } diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util.cc index e3e7b13..9cce7a8 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util.cc @@ -8,6 +8,7 @@ #include <set> #include <string> +#include <utility> #include <vector> #include "base/bind_helpers.h" @@ -75,7 +76,7 @@ void ITunesFileUtil::GetFileInfoOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false); + GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false); } else { data_provider->RefreshData( base::Bind(&ITunesFileUtil::GetFileInfoWithFreshDataProvider, @@ -92,7 +93,8 @@ void ITunesFileUtil::ReadDirectoryOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false); + ReadDirectoryWithFreshDataProvider(std::move(context), url, callback, + false); } else { data_provider->RefreshData( base::Bind(&ITunesFileUtil::ReadDirectoryWithFreshDataProvider, @@ -109,7 +111,7 @@ void ITunesFileUtil::CreateSnapshotFileOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - CreateSnapshotFileWithFreshDataProvider(context.Pass(), url, callback, + CreateSnapshotFileWithFreshDataProvider(std::move(context), url, callback, false); } else { data_provider->RefreshData( @@ -363,7 +365,7 @@ void ITunesFileUtil::GetFileInfoWithFreshDataProvider( } return; } - NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(context.Pass(), url, + NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url, callback); } @@ -381,7 +383,7 @@ void ITunesFileUtil::ReadDirectoryWithFreshDataProvider( } return; } - NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(context.Pass(), url, + NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url, callback); } @@ -403,8 +405,8 @@ void ITunesFileUtil::CreateSnapshotFileWithFreshDataProvider( } return; } - NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(context.Pass(), url, - callback); + NativeMediaFileUtil::CreateSnapshotFileOnTaskRunnerThread(std::move(context), + url, callback); } ITunesDataProvider* ITunesFileUtil::GetDataProvider() { diff --git a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc index de5184b..377d333 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_file_util_unittest.cc @@ -2,8 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media_galleries/fileapi/itunes_file_util.h" + #include <set> #include <string> +#include <utility> #include <vector> #include "base/bind.h" @@ -17,7 +20,6 @@ #include "base/thread_task_runner_handle.h" #include "base/time/time.h" #include "chrome/browser/media_galleries/fileapi/itunes_data_provider.h" -#include "chrome/browser/media_galleries/fileapi/itunes_file_util.h" #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" @@ -181,11 +183,8 @@ class ItunesFileUtilTest : public testing::Test { base::ThreadTaskRunnerHandle::Get().get(), base::ThreadTaskRunnerHandle::Get().get(), storage::ExternalMountPoints::CreateRefCounted().get(), - storage_policy.get(), - NULL, - additional_providers.Pass(), - std::vector<storage::URLRequestAutoMountHandler>(), - profile_dir_.path(), + storage_policy.get(), NULL, std::move(additional_providers), + std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(), content::CreateAllowFileAccessOptions()); } diff --git a/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc b/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc index d8187e4..c869bcf 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_data_provider_browsertest.cc @@ -2,6 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" + +#include <utility> #include <vector> #include "base/files/file_enumerator.h" @@ -14,7 +17,6 @@ #include "base/run_loop.h" #include "build/build_config.h" #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" -#include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" #include "chrome/common/media_galleries/picasa_test_util.h" #include "chrome/common/media_galleries/picasa_types.h" #include "chrome/test/base/in_process_browser_test.h" @@ -156,7 +158,7 @@ class TestPicasaDataProvider : public PicasaDataProvider { private: void OnTempDirWatchStarted( scoped_ptr<base::FilePathWatcher> temp_dir_watcher) override { - PicasaDataProvider::OnTempDirWatchStarted(temp_dir_watcher.Pass()); + PicasaDataProvider::OnTempDirWatchStarted(std::move(temp_dir_watcher)); file_watch_request_returned_ = true; for (std::vector<ReadyCallback>::const_iterator it = diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util.cc b/chrome/browser/media_galleries/fileapi/picasa_file_util.cc index 6d2ca1c..2871aed 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util.cc @@ -5,6 +5,7 @@ #include "chrome/browser/media_galleries/fileapi/picasa_file_util.h" #include <string> +#include <utility> #include <vector> #include "base/bind_helpers.h" @@ -92,7 +93,7 @@ void PicasaFileUtil::GetFileInfoOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - GetFileInfoWithFreshDataProvider(context.Pass(), url, callback, false); + GetFileInfoWithFreshDataProvider(std::move(context), url, callback, false); } else { data_provider->RefreshData( GetDataTypeForURL(url), @@ -112,7 +113,8 @@ void PicasaFileUtil::ReadDirectoryOnTaskRunnerThread( // |data_provider| may be NULL if the file system was revoked before this // operation had a chance to run. if (!data_provider) { - ReadDirectoryWithFreshDataProvider(context.Pass(), url, callback, false); + ReadDirectoryWithFreshDataProvider(std::move(context), url, callback, + false); } else { data_provider->RefreshData( GetDataTypeForURL(url), @@ -374,8 +376,8 @@ void PicasaFileUtil::GetFileInfoWithFreshDataProvider( base::Bind(callback, base::File::FILE_ERROR_IO, base::File::Info())); return; } - NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread( - context.Pass(), url, callback); + NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread(std::move(context), url, + callback); } void PicasaFileUtil::ReadDirectoryWithFreshDataProvider( @@ -390,8 +392,8 @@ void PicasaFileUtil::ReadDirectoryWithFreshDataProvider( base::Bind(callback, base::File::FILE_ERROR_IO, EntryList(), false)); return; } - NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread( - context.Pass(), url, callback); + NativeMediaFileUtil::ReadDirectoryOnTaskRunnerThread(std::move(context), url, + callback); } PicasaDataProvider* PicasaFileUtil::GetDataProvider() { diff --git a/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc index ae8d7d3..51dda01 100644 --- a/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa_file_util_unittest.cc @@ -2,11 +2,14 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/browser/media_galleries/fileapi/picasa_file_util.h" + #include <stddef.h> #include <stdint.h> #include <set> #include <string> +#include <utility> #include <vector> #include "base/bind_helpers.h" @@ -25,7 +28,6 @@ #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" #include "chrome/browser/media_galleries/fileapi/picasa_data_provider.h" -#include "chrome/browser/media_galleries/fileapi/picasa_file_util.h" #include "chrome/browser/media_galleries/imported_media_gallery_registry.h" #include "chrome/common/media_galleries/picasa_types.h" #include "chrome/common/media_galleries/pmp_constants.h" @@ -251,11 +253,8 @@ class PicasaFileUtilTest : public testing::Test { base::ThreadTaskRunnerHandle::Get().get(), base::ThreadTaskRunnerHandle::Get().get(), storage::ExternalMountPoints::CreateRefCounted().get(), - storage_policy.get(), - NULL, - additional_providers.Pass(), - std::vector<storage::URLRequestAutoMountHandler>(), - profile_dir_.path(), + storage_policy.get(), NULL, std::move(additional_providers), + std::vector<storage::URLRequestAutoMountHandler>(), profile_dir_.path(), content::CreateAllowFileAccessOptions()); } diff --git a/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc b/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc index 5e7f042..827b295 100644 --- a/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc +++ b/chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.cc @@ -4,6 +4,8 @@ #include "chrome/browser/media_galleries/fileapi/safe_iapps_library_parser.h" +#include <utility> + #include "build/build_config.h" #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" #include "chrome/common/chrome_utility_messages.h" @@ -89,18 +91,16 @@ void SafeIAppsLibraryParser::OnUtilityProcessStarted() { } if (!itunes_callback_.is_null()) { - utility_process_host_->Send( - new ChromeUtilityMsg_ParseITunesLibraryXmlFile( - IPC::TakeFileHandleForProcess( - library_file_.Pass(), - utility_process_host_->GetData().handle))); + utility_process_host_->Send(new ChromeUtilityMsg_ParseITunesLibraryXmlFile( + IPC::TakeFileHandleForProcess( + std::move(library_file_), + utility_process_host_->GetData().handle))); } else if (!iphoto_callback_.is_null()) { #if defined(OS_MACOSX) - utility_process_host_->Send( - new ChromeUtilityMsg_ParseIPhotoLibraryXmlFile( - IPC::TakeFileHandleForProcess( - library_file_.Pass(), - utility_process_host_->GetData().handle))); + utility_process_host_->Send(new ChromeUtilityMsg_ParseIPhotoLibraryXmlFile( + IPC::TakeFileHandleForProcess( + std::move(library_file_), + utility_process_host_->GetData().handle))); #endif } diff --git a/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc b/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc index e5aaadc..ee68dae 100644 --- a/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc +++ b/chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.cc @@ -4,6 +4,8 @@ #include "chrome/browser/media_galleries/fileapi/safe_picasa_album_table_reader.h" +#include <utility> + #include "base/bind.h" #include "base/logging.h" #include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h" @@ -20,7 +22,7 @@ namespace picasa { SafePicasaAlbumTableReader::SafePicasaAlbumTableReader( AlbumTableFiles album_table_files) - : album_table_files_(album_table_files.Pass()), + : album_table_files_(std::move(album_table_files)), parser_state_(INITIAL_STATE) { // TODO(tommycli): Add DCHECK to make sure |album_table_files| are all // opened read-only once security adds ability to check PlatformFiles. @@ -85,26 +87,26 @@ void SafePicasaAlbumTableReader::OnProcessStarted() { } AlbumTableFilesForTransit files_for_transit; files_for_transit.indicator_file = IPC::TakeFileHandleForProcess( - album_table_files_.indicator_file.Pass(), - utility_process_host_->GetData().handle); - files_for_transit.category_file = IPC::TakeFileHandleForProcess( - album_table_files_.category_file.Pass(), - utility_process_host_->GetData().handle); - files_for_transit.date_file = IPC::TakeFileHandleForProcess( - album_table_files_.date_file.Pass(), - utility_process_host_->GetData().handle); - files_for_transit.filename_file = IPC::TakeFileHandleForProcess( - album_table_files_.filename_file.Pass(), - utility_process_host_->GetData().handle); - files_for_transit.name_file = IPC::TakeFileHandleForProcess( - album_table_files_.name_file.Pass(), - utility_process_host_->GetData().handle); - files_for_transit.token_file = IPC::TakeFileHandleForProcess( - album_table_files_.token_file.Pass(), - utility_process_host_->GetData().handle); - files_for_transit.uid_file = IPC::TakeFileHandleForProcess( - album_table_files_.uid_file.Pass(), + std::move(album_table_files_.indicator_file), utility_process_host_->GetData().handle); + files_for_transit.category_file = + IPC::TakeFileHandleForProcess(std::move(album_table_files_.category_file), + utility_process_host_->GetData().handle); + files_for_transit.date_file = + IPC::TakeFileHandleForProcess(std::move(album_table_files_.date_file), + utility_process_host_->GetData().handle); + files_for_transit.filename_file = + IPC::TakeFileHandleForProcess(std::move(album_table_files_.filename_file), + utility_process_host_->GetData().handle); + files_for_transit.name_file = + IPC::TakeFileHandleForProcess(std::move(album_table_files_.name_file), + utility_process_host_->GetData().handle); + files_for_transit.token_file = + IPC::TakeFileHandleForProcess(std::move(album_table_files_.token_file), + utility_process_host_->GetData().handle); + files_for_transit.uid_file = + IPC::TakeFileHandleForProcess(std::move(album_table_files_.uid_file), + utility_process_host_->GetData().handle); utility_process_host_->Send(new ChromeUtilityMsg_ParsePicasaPMPDatabase( files_for_transit)); parser_state_ = STARTED_PARSING_STATE; diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index 6730ae9..484f071 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc @@ -171,8 +171,8 @@ PasswordStoreFactory::BuildServiceInstanceFor( os_crypt::switches::kUseMockKeychain) ? new crypto::MockAppleKeychain() : new crypto::AppleKeychain()); - ps = new PasswordStoreProxyMac(main_thread_runner, keychain.Pass(), - login_db.Pass(), profile->GetPrefs()); + ps = new PasswordStoreProxyMac(main_thread_runner, std::move(keychain), + std::move(login_db), profile->GetPrefs()); #elif defined(OS_CHROMEOS) || defined(OS_ANDROID) // For now, we use PasswordStoreDefault. We might want to make a native // backend for PasswordStoreX (see below) in the future though. diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc index 15fa9ec..740c294 100644 --- a/chrome/browser/password_manager/password_store_mac.cc +++ b/chrome/browser/password_manager/password_store_mac.cc @@ -500,9 +500,9 @@ void ExtractNonKeychainForms(ScopedVector<autofill::PasswordForm>* forms, MoveAllFormsOut( forms, [&remaining, extracted](scoped_ptr<autofill::PasswordForm> form) { if (IsLoginDatabaseOnlyForm(*form)) - extracted->push_back(form.Pass()); + extracted->push_back(std::move(form)); else - remaining.push_back(form.Pass()); + remaining.push_back(std::move(form)); }); forms->swap(remaining); } @@ -539,9 +539,9 @@ void MergePasswordForms(ScopedVector<autofill::PasswordForm>* keychain_forms, if (best_match) { used_keychain_forms.insert(best_match); form->password_value = best_match->password_value; - merged_forms->push_back(form.Pass()); + merged_forms->push_back(std::move(form)); } else { - unused_database_forms.push_back(form.Pass()); + unused_database_forms.push_back(std::move(form)); } }); database_forms->swap(unused_database_forms); @@ -607,7 +607,7 @@ void GetPasswordsForForms(const AppleKeychain& keychain, ExtractPasswordsMergeableWithForm(keychain, item_form_pairs, *form); ScopedVector<autofill::PasswordForm> db_form_container; - db_form_container.push_back(form.Pass()); + db_form_container.push_back(std::move(form)); MergePasswordForms(&keychain_matches, &db_form_container, passwords); AppendSecondToFirst(&unused_db_forms, &db_form_container); }); @@ -691,10 +691,10 @@ ScopedVector<autofill::PasswordForm> ExtractPasswordsMergeableWithForm( true); // Load password attributes and data. // Do not include blacklisted items found in the keychain. if (!form_with_password->blacklisted_by_user) - matches.push_back(form_with_password.Pass()); + matches.push_back(std::move(form_with_password)); } } - return matches.Pass(); + return matches; } } // namespace internal_keychain_helpers @@ -841,12 +841,12 @@ MacKeychainPasswordFormAdapter::ConvertKeychainItemsToForms( scoped_ptr<PasswordForm> form(new PasswordForm()); if (internal_keychain_helpers::FillPasswordFormFromKeychainItem( *keychain_, item, form.get(), true)) { - forms.push_back(form.Pass()); + forms.push_back(std::move(form)); } keychain_->Free(item); } items->clear(); - return forms.Pass(); + return forms; } SecKeychainItemRef MacKeychainPasswordFormAdapter::KeychainItemForForm( @@ -958,7 +958,7 @@ PasswordStoreMac::PasswordStoreMac( scoped_refptr<base::SingleThreadTaskRunner> db_thread_runner, scoped_ptr<AppleKeychain> keychain) : password_manager::PasswordStore(main_thread_runner, db_thread_runner), - keychain_(keychain.Pass()), + keychain_(std::move(keychain)), login_metadata_db_(nullptr) { DCHECK(keychain_); } @@ -1151,7 +1151,7 @@ PasswordStoreChangeList PasswordStoreMac::RemoveLoginsByOriginAndTimeImpl( scoped_ptr<autofill::PasswordForm> form_to_consider) { if (origin.IsSameOriginWith(url::Origin(form_to_consider->origin)) && login_metadata_db_->RemoveLogin(*form_to_consider)) - forms_to_remove.push_back(form_to_consider.Pass()); + forms_to_remove.push_back(std::move(form_to_consider)); }); if (!forms_to_remove.empty()) { RemoveKeychainForms(forms_to_remove.get()); @@ -1254,7 +1254,7 @@ ScopedVector<autofill::PasswordForm> PasswordStoreMac::FillMatchingLogins( NotifyLoginsChanged(FormsToRemoveChangeList(database_forms.get())); } - return matched_forms.Pass(); + return matched_forms; } bool PasswordStoreMac::FillAutofillableLogins( @@ -1339,7 +1339,7 @@ void PasswordStoreMac::RemoveDatabaseForms( MoveAllFormsOut(forms, [this, &removed_forms]( scoped_ptr<autofill::PasswordForm> form) { if (login_metadata_db_->RemoveLogin(*form)) - removed_forms.push_back(form.Pass()); + removed_forms.push_back(std::move(form)); }); removed_forms.swap(*forms); } diff --git a/chrome/browser/password_manager/password_store_proxy_mac.cc b/chrome/browser/password_manager/password_store_proxy_mac.cc index 0124317..3a9fb69 100644 --- a/chrome/browser/password_manager/password_store_proxy_mac.cc +++ b/chrome/browser/password_manager/password_store_proxy_mac.cc @@ -5,6 +5,7 @@ #include "chrome/browser/password_manager/password_store_proxy_mac.h" #include <string> +#include <utility> #include "base/metrics/histogram_macros.h" #include "chrome/browser/password_manager/password_store_mac.h" @@ -21,7 +22,7 @@ PasswordStoreProxyMac::PasswordStoreProxyMac( scoped_ptr<password_manager::LoginDatabase> login_db, PrefService* prefs) : PasswordStore(main_thread_runner, nullptr), - login_metadata_db_(login_db.Pass()) { + login_metadata_db_(std::move(login_db)) { DCHECK(login_metadata_db_); migration_status_.Init(password_manager::prefs::kKeychainMigrationStatus, prefs); @@ -32,7 +33,7 @@ PasswordStoreProxyMac::PasswordStoreProxyMac( new SimplePasswordStoreMac(main_thread_runner, nullptr, nullptr); } else { password_store_mac_ = - new PasswordStoreMac(main_thread_runner, nullptr, keychain.Pass()); + new PasswordStoreMac(main_thread_runner, nullptr, std::move(keychain)); } } @@ -96,7 +97,7 @@ void PasswordStoreProxyMac::InitOnBackgroundThread(MigrationStatus status) { if (status == MigrationStatus::MIGRATED) { password_store_simple_->InitWithTaskRunner(GetBackgroundTaskRunner(), - login_metadata_db_.Pass()); + std::move(login_metadata_db_)); } else { password_store_mac_->set_login_metadata_db(login_metadata_db_.get()); password_store_mac_->InitWithTaskRunner(GetBackgroundTaskRunner()); @@ -114,7 +115,7 @@ void PasswordStoreProxyMac::InitOnBackgroundThread(MigrationStatus status) { DCHECK(!password_store_simple_); password_store_simple_ = new SimplePasswordStoreMac( main_thread_runner_, GetBackgroundTaskRunner(), - login_metadata_db_.Pass()); + std::move(login_metadata_db_)); } else { status = (status == MigrationStatus::FAILED_ONCE ? MigrationStatus::FAILED_TWICE diff --git a/chrome/browser/password_manager/password_store_proxy_mac_unittest.cc b/chrome/browser/password_manager/password_store_proxy_mac_unittest.cc index d4a0d56..2ea0d46 100644 --- a/chrome/browser/password_manager/password_store_proxy_mac_unittest.cc +++ b/chrome/browser/password_manager/password_store_proxy_mac_unittest.cc @@ -4,6 +4,8 @@ #include "chrome/browser/password_manager/password_store_proxy_mac.h" +#include <utility> + #include "base/files/scoped_temp_dir.h" #include "base/macros.h" #include "base/scoped_observer.h" @@ -145,7 +147,7 @@ PasswordStoreProxyMacTest::~PasswordStoreProxyMacTest() { void PasswordStoreProxyMacTest::SetUp() { scoped_ptr<password_manager::LoginDatabase> login_db( new password_manager::LoginDatabase(test_login_db_file_path())); - CreateAndInitPasswordStore(login_db.Pass()); + CreateAndInitPasswordStore(std::move(login_db)); } void PasswordStoreProxyMacTest::TearDown() { @@ -156,7 +158,7 @@ void PasswordStoreProxyMacTest::CreateAndInitPasswordStore( scoped_ptr<password_manager::LoginDatabase> login_db) { store_ = new PasswordStoreProxyMac( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), - make_scoped_ptr(new crypto::MockAppleKeychain), login_db.Pass(), + make_scoped_ptr(new crypto::MockAppleKeychain), std::move(login_db), &testing_prefs_); ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare())); } @@ -445,7 +447,7 @@ void PasswordStoreProxyMacMigrationTest::TestMigration(bool lock_keychain) { keychain_->set_locked(true); store_ = new PasswordStoreProxyMac( BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), - keychain_.Pass(), login_db_.Pass(), &testing_prefs_); + std::move(keychain_), std::move(login_db_), &testing_prefs_); ASSERT_TRUE(store_->Init(syncer::SyncableService::StartSyncFlare())); FinishAsyncProcessing(); diff --git a/chrome/browser/password_manager/simple_password_store_mac.cc b/chrome/browser/password_manager/simple_password_store_mac.cc index a16673d..8d4171c 100644 --- a/chrome/browser/password_manager/simple_password_store_mac.cc +++ b/chrome/browser/password_manager/simple_password_store_mac.cc @@ -4,12 +4,15 @@ #include "chrome/browser/password_manager/simple_password_store_mac.h" +#include <utility> + SimplePasswordStoreMac::SimplePasswordStoreMac( scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, scoped_refptr<base::SingleThreadTaskRunner> background_thread_runner, scoped_ptr<password_manager::LoginDatabase> login_db) - : PasswordStoreDefault(main_thread_runner, background_thread_runner, - login_db.Pass()) { + : PasswordStoreDefault(main_thread_runner, + background_thread_runner, + std::move(login_db)) { if (this->login_db()) this->login_db()->set_clear_password_values(false); } @@ -22,7 +25,7 @@ void SimplePasswordStoreMac::InitWithTaskRunner( scoped_ptr<password_manager::LoginDatabase> login_db) { db_thread_runner_ = background_task_runner; DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); - set_login_db(login_db.Pass()); + set_login_db(std::move(login_db)); if (this->login_db()) this->login_db()->set_clear_password_values(false); } diff --git a/chrome/browser/plugins/plugin_infobar_delegates.cc b/chrome/browser/plugins/plugin_infobar_delegates.cc index 2c457c0..84dc8a0 100644 --- a/chrome/browser/plugins/plugin_infobar_delegates.cc +++ b/chrome/browser/plugins/plugin_infobar_delegates.cc @@ -4,6 +4,8 @@ #include "chrome/browser/plugins/plugin_infobar_delegates.h" +#include <utility> + #include "base/bind.h" #include "base/path_service.h" #include "base/strings/utf_string_conversions.h" @@ -57,10 +59,11 @@ void OutdatedPluginInfoBarDelegate::Create( base::string16 name(plugin_metadata->name()); infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new OutdatedPluginInfoBarDelegate( - installer, plugin_metadata.Pass(), + installer, std::move(plugin_metadata), l10n_util::GetStringFUTF16( - (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) ? - IDS_PLUGIN_OUTDATED_PROMPT : IDS_PLUGIN_DOWNLOADING, + (installer->state() == PluginInstaller::INSTALLER_STATE_IDLE) + ? IDS_PLUGIN_OUTDATED_PROMPT + : IDS_PLUGIN_DOWNLOADING, name))))); } @@ -71,7 +74,7 @@ OutdatedPluginInfoBarDelegate::OutdatedPluginInfoBarDelegate( : ConfirmInfoBarDelegate(), WeakPluginInstallerObserver(installer), identifier_(plugin_metadata->identifier()), - plugin_metadata_(plugin_metadata.Pass()), + plugin_metadata_(std::move(plugin_metadata)), message_(message) { content::RecordAction(UserMetricsAction("OutdatedPluginInfobar.Shown")); std::string name = base::UTF16ToUTF8(plugin_metadata_->name()); @@ -208,7 +211,7 @@ void OutdatedPluginInfoBarDelegate::Replace( infobar, infobar->owner()->CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate>(new OutdatedPluginInfoBarDelegate( - installer, plugin_metadata.Pass(), message)))); + installer, std::move(plugin_metadata), message)))); } #if defined(OS_WIN) diff --git a/chrome/browser/plugins/plugin_installer.cc b/chrome/browser/plugins/plugin_installer.cc index bef3f4d..3c6204b 100644 --- a/chrome/browser/plugins/plugin_installer.cc +++ b/chrome/browser/plugins/plugin_installer.cc @@ -4,6 +4,8 @@ #include "chrome/browser/plugins/plugin_installer.h" +#include <utility> + #include "base/bind.h" #include "base/bind_helpers.h" #include "base/process/process.h" @@ -107,7 +109,7 @@ void PluginInstaller::StartInstallingWithDownloadManager( download_parameters->set_callback( base::Bind(&PluginInstaller::DownloadStarted, base::Unretained(this))); RecordDownloadSource(DOWNLOAD_INITIATED_BY_PLUGIN_INSTALLER); - download_manager->DownloadUrl(download_parameters.Pass()); + download_manager->DownloadUrl(std::move(download_parameters)); } void PluginInstaller::DownloadStarted( diff --git a/chrome/browser/plugins/plugin_installer_unittest.cc b/chrome/browser/plugins/plugin_installer_unittest.cc index 8a123a7..6938e24 100644 --- a/chrome/browser/plugins/plugin_installer_unittest.cc +++ b/chrome/browser/plugins/plugin_installer_unittest.cc @@ -51,7 +51,7 @@ PluginInstallerTest::CreateMockDownloadItem() { new testing::StrictMock<content::MockDownloadItem>()); ON_CALL(*mock_download_item, GetState()) .WillByDefault(testing::Return(content::DownloadItem::IN_PROGRESS)); - return mock_download_item.Pass(); + return mock_download_item; } class TestPluginInstallerObserver : public PluginInstallerObserver { diff --git a/chrome/browser/plugins/plugin_observer.cc b/chrome/browser/plugins/plugin_observer.cc index 8385774..10f80d6 100644 --- a/chrome/browser/plugins/plugin_observer.cc +++ b/chrome/browser/plugins/plugin_observer.cc @@ -4,6 +4,8 @@ #include "chrome/browser/plugins/plugin_observer.h" +#include <utility> + #include "base/auto_reset.h" #include "base/bind.h" #include "base/debug/crash_logging.h" @@ -87,8 +89,7 @@ ConfirmInstallDialogDelegate::ConfirmInstallDialogDelegate( : TabModalConfirmDialogDelegate(web_contents), WeakPluginInstallerObserver(installer), web_contents_(web_contents), - plugin_metadata_(plugin_metadata.Pass()) { -} + plugin_metadata_(std::move(plugin_metadata)) {} base::string16 ConfirmInstallDialogDelegate::GetTitle() { return l10n_util::GetStringFUTF16( @@ -379,8 +380,9 @@ void PluginObserver::OnBlockedOutdatedPlugin(int placeholder_id, if (finder->FindPluginWithIdentifier(identifier, &installer, &plugin)) { plugin_placeholders_[placeholder_id] = new PluginPlaceholderHost( this, placeholder_id, plugin->name(), installer); - OutdatedPluginInfoBarDelegate::Create(InfoBarService::FromWebContents( - web_contents()), installer, plugin.Pass()); + OutdatedPluginInfoBarDelegate::Create( + InfoBarService::FromWebContents(web_contents()), installer, + std::move(plugin)); } else { NOTREACHED(); } diff --git a/chrome/browser/policy/chrome_browser_policy_connector.cc b/chrome/browser/policy/chrome_browser_policy_connector.cc index e6d786b..b9d3dfe 100644 --- a/chrome/browser/policy/chrome_browser_policy_connector.cc +++ b/chrome/browser/policy/chrome_browser_policy_connector.cc @@ -103,7 +103,7 @@ ConfigurationPolicyProvider* BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE), GetManagedPolicyPath(), new MacPreferences())); - return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass()); + return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader)); #elif defined(OS_POSIX) && !defined(OS_ANDROID) base::FilePath config_dir_path; if (PathService::Get(chrome::DIR_POLICY_FILES, &config_dir_path)) { diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc index a6ad5f1..ab34959 100644 --- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc +++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_mac.cc @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/files/file_util.h" #include "base/mac/bundle_locations.h" #include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_incident.h" @@ -33,7 +35,7 @@ void VerifyBinaryIntegrityHelper(IncidentReceiver* incident_receiver, incident(new ClientIncidentReport_IncidentData_BinaryIntegrityIncident()); if (!evaluator.PerformEvaluation(incident.get())) { incident_receiver->AddIncidentForProcess( - make_scoped_ptr(new BinaryIntegrityIncident(incident.Pass()))); + make_scoped_ptr(new BinaryIntegrityIncident(std::move(incident)))); } else { // Clear past incidents involving this bundle if the signature is // now valid. diff --git a/chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.cc b/chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.cc index 81da207..8b1f9bb 100644 --- a/chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.cc +++ b/chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.cc @@ -4,6 +4,8 @@ #include "chrome/browser/safe_browsing/sandboxed_dmg_analyzer_mac.h" +#include <utility> + #include "base/bind.h" #include "chrome/common/chrome_utility_messages.h" #include "chrome/common/safe_browsing/zip_analyzer_results.h" @@ -92,7 +94,7 @@ void SandboxedDMGAnalyzer::OnUtilityProcessStarted() { utility_process_host_->Send( new ChromeUtilityMsg_AnalyzeDmgFileForDownloadProtection( - IPC::TakeFileHandleForProcess(file_.Pass(), utility_process))); + IPC::TakeFileHandleForProcess(std::move(file_), utility_process))); } void SandboxedDMGAnalyzer::OnAnalysisFinished( diff --git a/chrome/browser/ui/app_list/app_list_service_mac.mm b/chrome/browser/ui/app_list/app_list_service_mac.mm index 699dcfd..03a81b1 100644 --- a/chrome/browser/ui/app_list/app_list_service_mac.mm +++ b/chrome/browser/ui/app_list/app_list_service_mac.mm @@ -8,6 +8,8 @@ #import <Cocoa/Cocoa.h> #include <stddef.h> +#include <utility> + #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_util.h" @@ -151,7 +153,7 @@ void CreateAppListShim(const base::FilePath& profile_path) { if (installed_version == 0) shortcut_locations.in_quick_launch_bar = true; - web_app::CreateNonAppShortcut(shortcut_locations, shortcut_info.Pass()); + web_app::CreateNonAppShortcut(shortcut_locations, std::move(shortcut_info)); local_state->SetInteger(prefs::kAppLauncherShortcutVersion, kShortcutVersion); diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa.mm b/chrome/browser/ui/cocoa/accelerators_cocoa.mm index 9d08d37..6038cac 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm +++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm @@ -7,6 +7,8 @@ #import <Cocoa/Cocoa.h> #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/macros.h" #include "base/memory/singleton.h" @@ -127,7 +129,7 @@ ui::Accelerator AcceleratorFromKeyCode(ui::KeyboardCode key_code, scoped_ptr<ui::PlatformAccelerator> platform_accelerator = PlatformAcceleratorFromKeyCode(key_code, cocoa_modifiers); - accelerator.set_platform_accelerator(platform_accelerator.Pass()); + accelerator.set_platform_accelerator(std::move(platform_accelerator)); return accelerator; } diff --git a/chrome/browser/ui/cocoa/autofill/layout_view.mm b/chrome/browser/ui/cocoa/autofill/layout_view.mm index 04881e2..59e7db9 100644 --- a/chrome/browser/ui/cocoa/autofill/layout_view.mm +++ b/chrome/browser/ui/cocoa/autofill/layout_view.mm @@ -4,12 +4,14 @@ #import "chrome/browser/ui/cocoa/autofill/layout_view.h" +#include <utility> + #include "chrome/browser/ui/cocoa/autofill/simple_grid_layout.h" @implementation LayoutView - (void)setLayoutManager:(scoped_ptr<SimpleGridLayout>)layout { - layout_ = layout.Pass(); + layout_ = std::move(layout); } - (SimpleGridLayout*)layoutManager { diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index 58b55a3..0299daa 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm @@ -6,6 +6,7 @@ #include <cmath> #include <numeric> +#include <utility> #include "base/command_line.h" #include "base/mac/bundle_locations.h" @@ -1674,11 +1675,11 @@ void SetUpBrowserWindowCommandHandler(NSWindow* window) { sourceLanguage, targetLanguage)); scoped_ptr<TranslateBubbleModel> model( - new TranslateBubbleModelImpl(step, uiDelegate.Pass())); - translateBubbleController_ = [[TranslateBubbleController alloc] - initWithParentWindow:self - model:model.Pass() - webContents:contents]; + new TranslateBubbleModelImpl(step, std::move(uiDelegate))); + translateBubbleController_ = + [[TranslateBubbleController alloc] initWithParentWindow:self + model:std::move(model) + webContents:contents]; [translateBubbleController_ showWindow:nil]; NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; diff --git a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm index a9fa98c..80a5475 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_cocoa.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" +#include <utility> + #include "base/strings/string16.h" #include "chrome/browser/themes/theme_service.h" #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" @@ -51,7 +53,7 @@ void ShowConfirmBubble(gfx::NativeWindow window, ConfirmBubbleController* controller = [[ConfirmBubbleController alloc] initWithParent:anchor_view origin:origin.ToCGPoint() - model:model.Pass()]; + model:std::move(model)]; [anchor_view addSubview:[controller view] positioned:NSWindowAbove relativeTo:nil]; diff --git a/chrome/browser/ui/cocoa/confirm_bubble_controller.mm b/chrome/browser/ui/cocoa/confirm_bubble_controller.mm index b7143e7..7f7d45d 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" +#include <utility> + #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" @@ -19,7 +21,7 @@ if ((self = [super initWithNibName:nil bundle:nil])) { parent_ = parent; origin_ = origin; - model_ = model.Pass(); + model_ = std::move(model); } return self; } diff --git a/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm index be249f7..4c27458 100644 --- a/chrome/browser/ui/cocoa/confirm_bubble_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/confirm_bubble_controller_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 "chrome/browser/ui/cocoa/confirm_bubble_controller.h" + +#include <utility> + #include "base/compiler_specific.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" #import "chrome/browser/ui/cocoa/confirm_bubble_cocoa.h" -#import "chrome/browser/ui/cocoa/confirm_bubble_controller.h" #include "chrome/browser/ui/confirm_bubble_model.h" #import "testing/gtest_mac.h" #import "ui/gfx/geometry/point.h" @@ -107,7 +110,7 @@ class ConfirmBubbleControllerTest : public CocoaTest { controller_ = [[ConfirmBubbleController alloc] initWithParent:view origin:origin.ToCGPoint() - model:model_.Pass()]; + model:std::move(model_)]; [view addSubview:[controller_ view] positioned:NSWindowAbove relativeTo:nil]; diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm index f043fad..16f755c 100644 --- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm +++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" +#include <utility> + #include "base/logging.h" #include "base/memory/scoped_ptr.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" @@ -29,7 +31,8 @@ ConstrainedWindowMac::ConstrainedWindowMac( auto manager = WebContentsModalDialogManager::FromWebContents(web_contents); scoped_ptr<SingleWebContentsDialogManagerCocoa> native_manager( new SingleWebContentsDialogManagerCocoa(this, sheet, manager)); - manager->ShowDialogWithManager([sheet sheetWindow], native_manager.Pass()); + manager->ShowDialogWithManager([sheet sheetWindow], + std::move(native_manager)); } ConstrainedWindowMac::~ConstrainedWindowMac() { diff --git a/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm b/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm index 48f3579..2fd6aca 100644 --- a/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/download/download_shelf_controller_unittest.mm @@ -2,15 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" + #import <Cocoa/Cocoa.h> +#include <utility> + #import "base/mac/scoped_block.h" #import "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "chrome/browser/download/download_shelf.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #import "chrome/browser/ui/cocoa/download/download_item_controller.h" -#import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" #import "chrome/browser/ui/cocoa/view_resizer_pong.h" #include "content/public/test/mock_download_item.h" #include "testing/gtest/include/gtest/gtest.h" @@ -36,7 +39,7 @@ using ::testing::AnyNumber; @implementation WrappedMockDownloadItem - (id)initWithMockDownload:(scoped_ptr<content::MockDownloadItem>)download { if ((self = [super init])) { - download_ = download.Pass(); + download_ = std::move(download); } return self; } @@ -143,7 +146,8 @@ id DownloadShelfControllerTest::CreateItemController() { .WillByDefault(Return(content::DownloadItem::IN_PROGRESS)); base::scoped_nsobject<WrappedMockDownloadItem> wrappedMockDownload( - [[WrappedMockDownloadItem alloc] initWithMockDownload:download.Pass()]); + [[WrappedMockDownloadItem alloc] + initWithMockDownload:std::move(download)]); id item_controller = [OCMockObject mockForClass:[DownloadItemController class]]; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm index c2429c41..4de33c2 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_container_view.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/extensions/browser_actions_container_view.h" #include <algorithm> +#include <utility> #import "chrome/browser/ui/cocoa/view_id_util.h" #include "grit/theme_resources.h" @@ -167,7 +168,7 @@ const CGFloat kMinimumContainerWidth = 3.0; - (void)setHighlight:(scoped_ptr<ui::NinePartImageIds>)highlight { if (highlight || highlight_) { - highlight_ = highlight.Pass(); + highlight_ = std::move(highlight); // We don't allow resizing when the container is highlighting. resizable_ = highlight.get() == nullptr; [self setNeedsDisplay:YES]; diff --git a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm index 71d31d7..c01b9f8 100644 --- a/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm @@ -7,6 +7,7 @@ #include <stddef.h> #include <string> +#include <utility> #include "base/macros.h" #include "base/strings/sys_string_conversions.h" @@ -289,10 +290,10 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( extensions::ExtensionMessageBubbleController* weak_controller = bubble_controller.get(); scoped_ptr<ExtensionMessageBubbleBridge> bridge( - new ExtensionMessageBubbleBridge(bubble_controller.Pass(), + new ExtensionMessageBubbleBridge(std::move(bubble_controller), anchor_action != nullptr)); ToolbarActionsBarBubbleMac* bubble = - [controller_ createMessageBubble:bridge.Pass() + [controller_ createMessageBubble:std::move(bridge) anchorToSelf:anchor_action != nil]; weak_controller->OnShown(); [bubble showWindow:nil]; @@ -570,7 +571,7 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( highlight.reset( new ui::NinePartImageIds(IMAGE_GRID(IDR_DEVELOPER_MODE_HIGHLIGHT))); } - [containerView_ setHighlight:highlight.Pass()]; + [containerView_ setHighlight:std::move(highlight)]; std::vector<ToolbarActionViewController*> toolbar_actions = toolbarActionsBar_->GetActions(); @@ -812,8 +813,7 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( scoped_ptr<ToolbarActionsBarBubbleDelegate> delegate( new ExtensionToolbarIconSurfacingBubbleDelegate(browser_->profile())); ToolbarActionsBarBubbleMac* bubble = - [self createMessageBubble:delegate.Pass() - anchorToSelf:YES]; + [self createMessageBubble:std::move(delegate) anchorToSelf:YES]; [bubble showWindow:nil]; } [containerView_ setTrackingEnabled:NO]; @@ -1034,7 +1034,7 @@ void ToolbarActionsBarBridge::ShowExtensionMessageBubble( activeBubble_ = [[ToolbarActionsBarBubbleMac alloc] initWithParentWindow:[containerView_ window] anchorPoint:anchor - delegate:delegate.Pass()]; + delegate:std::move(delegate)]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(bubbleWindowClosing:) diff --git a/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm b/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm index 8da3f17..db8a936 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_action_platform_delegate_cocoa.mm @@ -73,7 +73,7 @@ void ExtensionActionPlatformDelegateCocoa::ShowPopup( ExtensionActionViewController::PopupShowAction show_action) { BOOL devMode = show_action == ExtensionActionViewController::SHOW_POPUP_AND_INSPECT; - [ExtensionPopupController host:host.Pass() + [ExtensionPopupController host:std::move(host) inBrowser:controller_->browser() anchoredAt:GetPopupPoint() arrowLocation:info_bubble::kTopRight diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm index 2e069dd..d9068be 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller_browsertest.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h" +#include <utility> + #include "chrome/browser/extensions/extension_install_prompt_show_params.h" #include "chrome/browser/extensions/extension_install_prompt_test_helper.h" #include "chrome/browser/ui/browser.h" @@ -37,9 +39,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogControllerTest, BasicTest) { chrome::BuildExtensionInstallPrompt(extension_.get()); ExtensionInstallDialogController* controller = - new ExtensionInstallDialogController(&show_params, - test_helper.GetCallback(), - prompt.Pass()); + new ExtensionInstallDialogController( + &show_params, test_helper.GetCallback(), std::move(prompt)); base::scoped_nsobject<NSWindow> window( [[[controller->view_controller() view] window] retain]); @@ -65,9 +66,8 @@ IN_PROC_BROWSER_TEST_F(ExtensionInstallDialogControllerTest, chrome::BuildExtensionPostInstallPermissionsPrompt(extension_.get()); ExtensionInstallDialogController* controller = - new ExtensionInstallDialogController(&show_params, - test_helper.GetCallback(), - prompt.Pass()); + new ExtensionInstallDialogController( + &show_params, test_helper.GetCallback(), std::move(prompt)); base::scoped_nsobject<NSWindow> window( [[[controller->view_controller() view] window] retain]); diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm index f04a424..a7160cf 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.mm @@ -70,7 +70,7 @@ scoped_ptr<ExtensionInstallPrompt::Prompt> BuildExtensionInstallPrompt( ExtensionInstallPrompt::INSTALL_PROMPT)); prompt->set_extension(extension); prompt->set_icon(LoadInstallPromptIcon()); - return prompt.Pass(); + return prompt; } scoped_ptr<ExtensionInstallPrompt::Prompt> @@ -80,7 +80,7 @@ BuildExtensionPostInstallPermissionsPrompt(Extension* extension) { ExtensionInstallPrompt::POST_INSTALL_PERMISSIONS_PROMPT)); prompt->set_extension(extension); prompt->set_icon(LoadInstallPromptIcon()); - return prompt.Pass(); + return prompt; } } // namespace chrome diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm index 7960f53..1fe1b5d 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/auto_reset.h" #include "base/i18n/rtl.h" #include "base/mac/bundle_locations.h" @@ -248,7 +250,7 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { profile_ = profile; navigator_ = navigator; delegate_ = delegate; - prompt_ = prompt.Pass(); + prompt_ = std::move(prompt); warnings_.reset([[self buildWarnings:*prompt_] retain]); } return self; diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm index 50697f4..4772c37 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller_unittest.mm @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" + #import <Cocoa/Cocoa.h> +#include <utility> + #import "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" @@ -11,7 +15,6 @@ #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" #import "chrome/browser/ui/cocoa/extensions/extension_install_prompt_test_utils.h" -#import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h" #include "extensions/common/extension.h" #include "extensions/common/permissions/permission_message_provider.h" #include "testing/gtest/include/gtest/gtest.h" @@ -84,10 +87,11 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsNormalCancel) { base::string16 permissionString = prompt->GetPermission(0, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. @@ -140,10 +144,11 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsNormalOK) { prompt->SetPermissions(permissions, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. [controller ok:nil]; @@ -179,7 +184,7 @@ TEST_F(ExtensionInstallViewControllerTest, MultipleWarnings) { initWithProfile:profile() navigator:browser() delegate:&delegate1 - prompt:one_warning_prompt.Pass()]); + prompt:std::move(one_warning_prompt)]); [controller1 view]; // Force nib load. @@ -188,7 +193,7 @@ TEST_F(ExtensionInstallViewControllerTest, MultipleWarnings) { initWithProfile:profile() navigator:browser() delegate:&delegate2 - prompt:two_warnings_prompt.Pass()]); + prompt:std::move(two_warnings_prompt)]); [controller2 view]; // Force nib load. @@ -216,7 +221,7 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsSkinny) { initWithProfile:profile() navigator:browser() delegate:&delegate - prompt:no_warnings_prompt.Pass()]); + prompt:std::move(no_warnings_prompt)]); [controller view]; // Force nib load. @@ -262,7 +267,7 @@ TEST_F(ExtensionInstallViewControllerTest, BasicsInline) { initWithProfile:profile() navigator:browser() delegate:&delegate - prompt:inline_prompt.Pass()]); + prompt:std::move(inline_prompt)]); [controller view]; // Force nib load. @@ -320,10 +325,11 @@ TEST_F(ExtensionInstallViewControllerTest, PostInstallPermissionsPrompt) { prompt->SetPermissions(permissions, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. @@ -355,10 +361,11 @@ TEST_F(ExtensionInstallViewControllerTest, PermissionsDetails) { base::string16 permissionString = prompt->GetPermissionsDetails(0, type); base::scoped_nsobject<ExtensionInstallViewController> controller( - [[ExtensionInstallViewController alloc] initWithProfile:profile() - navigator:browser() - delegate:&delegate - prompt:prompt.Pass()]); + [[ExtensionInstallViewController alloc] + initWithProfile:profile() + navigator:browser() + delegate:&delegate + prompt:std::move(prompt)]); [controller view]; // Force nib load. diff --git a/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm b/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm index 28b77e5e..f7cb1f5 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.mm @@ -4,15 +4,16 @@ #include "chrome/browser/ui/cocoa/extensions/extension_message_bubble_bridge.h" +#include <utility> + #include "chrome/browser/extensions/extension_message_bubble_controller.h" #include "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" ExtensionMessageBubbleBridge::ExtensionMessageBubbleBridge( scoped_ptr<extensions::ExtensionMessageBubbleController> controller, bool anchored_to_extension) - : controller_(controller.Pass()), - anchored_to_extension_(anchored_to_extension) { -} + : controller_(std::move(controller)), + anchored_to_extension_(anchored_to_extension) {} ExtensionMessageBubbleBridge::~ExtensionMessageBubbleBridge() { } diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm index d38805a..b192160 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm @@ -5,6 +5,7 @@ #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" #include <algorithm> +#include <utility> #include "base/callback.h" #include "base/macros.h" @@ -276,7 +277,7 @@ class ExtensionPopupNotificationBridge : public content::NotificationObserver { anchoredAt:anchoredAt arrowLocation:arrowLocation devMode:devMode]; - [gPopup setExtensionViewHost:host.Pass()]; + [gPopup setExtensionViewHost:std::move(host)]; return gPopup; } diff --git a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm index c10ea56..f9c83fd 100644 --- a/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm +++ b/chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h" +#include <utility> + #include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" #import "chrome/browser/ui/cocoa/info_bubble_view.h" @@ -73,7 +75,7 @@ CGFloat kMinWidth = 320.0; parentWindow:parentWindow anchoredAt:anchorPoint])) { acknowledged_ = NO; - delegate_ = delegate.Pass(); + delegate_ = std::move(delegate); ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; diff --git a/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm index ed06c87..2b2178e 100644 --- a/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm +++ b/chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/extensions/windowed_install_dialog_controller.h" +#include <utility> + #import "base/callback_helpers.h" #import "base/mac/sdk_forward_declarations.h" #include "base/message_loop/message_loop.h" @@ -39,7 +41,7 @@ WindowedInstallDialogController::WindowedInstallDialogController( initWithProfile:show_params->profile() navigator:show_params->GetParentWebContents() delegate:this - prompt:prompt.Pass()]); + prompt:std::move(prompt)]); [[install_controller_ window] makeKeyAndOrderFront:nil]; } @@ -98,7 +100,7 @@ void WindowedInstallDialogController::OnStoreLinkClicked() { initWithProfile:profile navigator:navigator delegate:delegate - prompt:prompt.Pass()]); + prompt:std::move(prompt)]); NSWindow* window = [self window]; // Ensure the window does not display behind the app launcher window, and is diff --git a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm index 8e614fe..1259104 100644 --- a/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/alternate_nav_infobar_controller.mm @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" @@ -63,9 +65,9 @@ // static scoped_ptr<infobars::InfoBar> AlternateNavInfoBarDelegate::CreateInfoBar( scoped_ptr<AlternateNavInfoBarDelegate> delegate) { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<AlternateNavInfoBarController> controller( [[AlternateNavInfoBarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); - return infobar.Pass(); + return std::move(infobar); } diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm index aa5478d..bf5642c 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" +#include <utility> + #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "chrome/browser/infobars/infobar_service.h" @@ -147,9 +149,9 @@ scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( scoped_ptr<ConfirmInfoBarDelegate> delegate) { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<ConfirmInfoBarController> controller( [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); - return infobar.Pass(); + return std::move(infobar); } diff --git a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm index a14305a..93de71a 100644 --- a/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/confirm_infobar_controller_unittest.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "base/strings/string_util.h" #include "base/strings/sys_string_conversions.h" @@ -93,7 +95,7 @@ class ConfirmInfoBarControllerTest : public CocoaProfileTest, scoped_ptr<infobars::InfoBarDelegate> delegate( new MockConfirmInfoBarDelegate(this)); - infobar_ = new InfoBarCocoa(delegate.Pass()); + infobar_ = new InfoBarCocoa(std::move(delegate)); infobar_->SetOwner(InfoBarService::FromWebContents(web_contents_.get())); controller_.reset([[TestConfirmInfoBarController alloc] diff --git a/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm b/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm index c3183a1..11753ba 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_cocoa.mm @@ -4,12 +4,12 @@ #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" +#include <utility> + #import "chrome/browser/ui/cocoa/infobars/infobar_controller.h" InfoBarCocoa::InfoBarCocoa(scoped_ptr<infobars::InfoBarDelegate> delegate) - : infobars::InfoBar(delegate.Pass()), - weak_ptr_factory_(this) { -} + : infobars::InfoBar(std::move(delegate)), weak_ptr_factory_(this) {} InfoBarCocoa::~InfoBarCocoa() { if (controller()) diff --git a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm index c91e123..6de886a 100644 --- a/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/infobar_container_controller_unittest.mm @@ -6,6 +6,8 @@ #import <Cocoa/Cocoa.h> +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" @@ -62,7 +64,8 @@ TEST_F(InfoBarContainerControllerTest, AddAndRemoveInfoBars) { scoped_ptr<infobars::InfoBarDelegate> confirm_delegate( new MockConfirmInfoBarDelegate(NULL)); - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(confirm_delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar( + new InfoBarCocoa(std::move(confirm_delegate))); base::scoped_nsobject<ConfirmInfoBarController> controller( [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); diff --git a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm index 005e00a..aa3ecf9 100644 --- a/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm +++ b/chrome/browser/ui/cocoa/infobars/save_password_infobar_controller.mm @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "chrome/browser/password_manager/save_password_infobar_delegate.h" #include "chrome/browser/ui/chrome_style.h" #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h" @@ -31,11 +33,11 @@ scoped_ptr<infobars::InfoBar> CreateSavePasswordInfoBar (scoped_ptr<SavePasswordInfoBarDelegate> delegate) { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<SavePasswordInfobarController> controller( [[SavePasswordInfobarController alloc] initWithInfoBar:infobar.get()]); infobar->set_controller(controller); - return infobar.Pass(); + return std::move(infobar); } @end diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm index 14fce73..2bdc727 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_base.mm @@ -6,6 +6,8 @@ #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/strings/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -32,7 +34,7 @@ using InfoBarUtilities::AddMenuItem; scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( scoped_ptr<translate::TranslateInfoBarDelegate> delegate) const { - scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); + scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate))); base::scoped_nsobject<TranslateInfoBarControllerBase> infobar_controller; switch (infobar->delegate()->AsTranslateInfoBarDelegate()->translate_step()) { case translate::TRANSLATE_STEP_BEFORE_TRANSLATE: @@ -52,7 +54,7 @@ scoped_ptr<infobars::InfoBar> ChromeTranslateClient::CreateInfoBar( NOTREACHED(); } infobar->set_controller(infobar_controller); - return infobar.Pass(); + return std::move(infobar); } @implementation TranslateInfoBarControllerBase (FrameChangeObserver) diff --git a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm index aef043b..475c511 100644 --- a/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm +++ b/chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm @@ -5,6 +5,8 @@ #import <Cocoa/Cocoa.h> #include <stddef.h> +#include <utility> + #import "base/mac/scoped_nsobject.h" #include "base/macros.h" #import "base/strings/string_util.h" @@ -104,7 +106,7 @@ class TranslationInfoBarTest : public CocoaProfileTest { scoped_ptr<translate::TranslateInfoBarDelegate> delegate( new MockTranslateInfoBarDelegate(web_contents_.get(), type, error)); scoped_ptr<infobars::InfoBar> infobar( - chrome_translate_client->CreateInfoBar(delegate.Pass())); + chrome_translate_client->CreateInfoBar(std::move(delegate))); if (infobar_) infobar_->CloseSoon(); infobar_ = static_cast<InfoBarCocoa*>(infobar.release()); diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm index 8708f3a..d8d4a3e 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_cocoa.h" +#include <utility> + #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" DesktopMediaPickerCocoa::DesktopMediaPickerCocoa() { @@ -19,12 +21,12 @@ void DesktopMediaPickerCocoa::Show(content::WebContents* web_contents, const base::string16& target_name, scoped_ptr<DesktopMediaList> media_list, const DoneCallback& done_callback) { - controller_.reset( - [[DesktopMediaPickerController alloc] initWithMediaList:media_list.Pass() - parent:parent - callback:done_callback - appName:app_name - targetName:target_name]); + controller_.reset([[DesktopMediaPickerController alloc] + initWithMediaList:std::move(media_list) + parent:parent + callback:done_callback + appName:app_name + targetName:target_name]); [controller_ showWindow:nil]; } diff --git a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm index 488f547..80cc9cb 100644 --- a/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm +++ b/chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/media_picker/desktop_media_picker_controller.h" +#include <utility> + #include "base/bind.h" #include "base/command_line.h" #import "base/mac/bundle_locations.h" @@ -75,7 +77,7 @@ const int kExcessButtonPadding = 6; [parent addChildWindow:window ordered:NSWindowAbove]; [window setDelegate:self]; [self initializeContentsWithAppName:appName targetName:targetName]; - media_list_ = media_list.Pass(); + media_list_ = std::move(media_list); media_list_->SetViewDialogWindowId(content::DesktopMediaID( content::DesktopMediaID::TYPE_WINDOW, [window windowNumber])); doneCallback_ = callback; diff --git a/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm b/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm index 618b782..b475b24 100644 --- a/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm +++ b/chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/passwords/account_avatar_fetcher_manager.h" +#include <utility> + #include "base/memory/weak_ptr.h" #import "chrome/browser/ui/cocoa/passwords/credential_item_view.h" #include "chrome/browser/ui/passwords/account_avatar_fetcher.h" @@ -69,7 +71,7 @@ void AccountAvatarFetcherBridge::UpdateAvatar(const gfx::ImageSkia& image) { new AccountAvatarFetcherBridge(self, view)); AccountAvatarFetcher* fetcher = new AccountAvatarFetcher(avatarURL, bridge->AsWeakPtr()); - bridges_.push_back(bridge.Pass()); + bridges_.push_back(std::move(bridge)); [self startRequestWithFetcher:fetcher]; } diff --git a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm index e8bbc0a..b9c747d 100644 --- a/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/passwords/account_chooser_view_controller.h" +#include <utility> + #include "base/mac/foundation_util.h" #include "base/memory/scoped_vector.h" #include "base/strings/string16.h" @@ -57,7 +59,7 @@ namespace { scoped_ptr<autofill::PasswordForm> Credential(const char* username) { scoped_ptr<autofill::PasswordForm> credential(new autofill::PasswordForm); credential->username_value = base::ASCIIToUTF16(username); - return credential.Pass(); + return credential; } // Tests for the account chooser view of the password management bubble. @@ -102,7 +104,7 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, ConfiguresViews) { local_forms.push_back(Credential("pizza")); ScopedVector<const autofill::PasswordForm> federated_forms; federated_forms.push_back(Credential("taco")); - SetUpAccountChooser(local_forms.Pass(), federated_forms.Pass()); + SetUpAccountChooser(std::move(local_forms), std::move(federated_forms)); // Trigger creation of controller and check the views. NSTableView* view = controller().credentialsView; ASSERT_NSNE(nil, view); @@ -127,8 +129,8 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, ScopedVector<const autofill::PasswordForm> local_forms; scoped_ptr<autofill::PasswordForm> form = Credential("taco"); form->icon_url = GURL("http://foo"); - local_forms.push_back(form.Pass()); - SetUpAccountChooser(local_forms.Pass(), + local_forms.push_back(std::move(form)); + SetUpAccountChooser(std::move(local_forms), ScopedVector<const autofill::PasswordForm>()); // Trigger creation of the controller and check the fetched URLs. controller(); @@ -145,7 +147,7 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, local_forms.push_back(Credential("pizza")); ScopedVector<const autofill::PasswordForm> federated_forms; federated_forms.push_back(Credential("taco")); - SetUpAccountChooser(local_forms.Pass(), federated_forms.Pass()); + SetUpAccountChooser(std::move(local_forms), std::move(federated_forms)); EXPECT_CALL(*ui_controller(), ChooseCredential( *Credential("taco"), @@ -160,7 +162,7 @@ TEST_F(ManagePasswordsBubbleAccountChooserViewControllerTest, SelectingNopeDismissesDialog) { ScopedVector<const autofill::PasswordForm> local_forms; local_forms.push_back(Credential("pizza")); - SetUpAccountChooser(local_forms.Pass(), + SetUpAccountChooser(std::move(local_forms), ScopedVector<const autofill::PasswordForm>()); [controller().cancelButton performClick:nil]; EXPECT_TRUE(delegate().dismissed); diff --git a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm index 26ceb2f..dafc7c2 100644 --- a/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm +++ b/chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/renderer_context_menu/render_view_context_menu_mac.h" +#include <utility> + #include "base/compiler_specific.h" #import "base/mac/scoped_sending_event.h" #include "base/macros.h" @@ -88,7 +90,7 @@ RenderViewContextMenuMac::RenderViewContextMenuMac( bidi_submenu_model_(this), parent_view_(parent_view) { scoped_ptr<ToolkitDelegate> delegate(new ToolkitDelegateMac(this)); - set_toolkit_delegate(delegate.Pass()); + set_toolkit_delegate(std::move(delegate)); } RenderViewContextMenuMac::~RenderViewContextMenuMac() { diff --git a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm index 5df6b12..8c7d66d 100644 --- a/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm +++ b/chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm @@ -7,6 +7,8 @@ #import <SecurityInterface/SFChooseIdentityPanel.h> #include <stddef.h> +#include <utility> + #include "base/logging.h" #include "base/mac/foundation_util.h" #include "base/strings/string_util.h" @@ -51,7 +53,7 @@ class SSLClientAuthObserverCocoaBridge : public SSLClientAuthObserver, SSLClientCertificateSelectorCocoa* controller) : SSLClientAuthObserver(browser_context, cert_request_info, - delegate.Pass()), + std::move(delegate)), controller_(controller) {} // SSLClientAuthObserver implementation: @@ -97,7 +99,7 @@ void ShowSSLClientCertificateSelector( [[SSLClientCertificateSelectorCocoa alloc] initWithBrowserContext:contents->GetBrowserContext() certRequestInfo:cert_request_info - delegate:delegate.Pass()]; + delegate:std::move(delegate)]; [selector displayForWebContents:contents]; } @@ -113,7 +115,7 @@ void ShowSSLClientCertificateSelector( DCHECK(certRequestInfo); if ((self = [super init])) { observer_.reset(new SSLClientAuthObserverCocoaBridge( - browserContext, certRequestInfo, delegate.Pass(), self)); + browserContext, certRequestInfo, std::move(delegate), self)); } return self; } diff --git a/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm b/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm index 81a6648..983ae52 100644 --- a/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm +++ b/chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/tab_contents/chrome_web_contents_view_delegate_mac.h" +#include <utility> + #include "base/profiler/scoped_tracker.h" #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_delegate.h" #include "chrome/browser/ui/browser.h" @@ -61,7 +63,7 @@ void ChromeWebContentsViewDelegateMac::ShowMenu( FROM_HERE_WITH_EXPLICIT_FUNCTION( "458401 ChromeWebContentsViewDelegateMac::ShowMenu")); - context_menu_ = menu.Pass(); + context_menu_ = std::move(menu); if (!context_menu_.get()) return; @@ -113,7 +115,7 @@ ChromeWebContentsViewDelegateMac::BuildMenu( menu->Init(); } - return menu.Pass(); + return menu; } content::RenderWidgetHostView* diff --git a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm index abddcf9..6935ce1 100644 --- a/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm +++ b/chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.mm @@ -4,6 +4,8 @@ #include "chrome/browser/ui/cocoa/tab_modal_confirm_dialog_mac.h" +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "chrome/browser/ui/browser_dialogs.h" #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_alert.h" @@ -120,7 +122,7 @@ void TabModalConfirmDialogMac::OnConstrainedWindowClosed( // prevent a double-delete by moving delegate_ to a stack variable. if (!delegate_) return; - scoped_ptr<TabModalConfirmDialogDelegate> delegate(delegate_.Pass()); + scoped_ptr<TabModalConfirmDialogDelegate> delegate(std::move(delegate_)); // Provide a disposition in case the dialog was closed without accepting or // cancelling. delegate->Close(); diff --git a/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm b/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm index 8fbcdbe..975b0b3 100644 --- a/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/translate/translate_bubble_controller.mm @@ -4,6 +4,8 @@ #import "chrome/browser/ui/cocoa/translate/translate_bubble_controller.h" +#include <utility> + #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" #include "base/macros.h" @@ -124,7 +126,7 @@ const CGFloat kContentWidth = kWindowWidth - 2 * kFramePadding; parentWindow:parentWindow anchoredAt:NSZeroPoint])) { webContents_ = webContents; - model_ = model.Pass(); + model_ = std::move(model); if (model_->GetViewState() != TranslateBubbleModel::VIEW_STATE_BEFORE_TRANSLATE) { translateExecuted_ = YES; diff --git a/chrome/browser/ui/views/browser_dialogs_views_mac.cc b/chrome/browser/ui/views/browser_dialogs_views_mac.cc index 0cc628a..68ab357 100644 --- a/chrome/browser/ui/views/browser_dialogs_views_mac.cc +++ b/chrome/browser/ui/views/browser_dialogs_views_mac.cc @@ -2,10 +2,11 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/ui/browser_dialogs.h" +#include <utility> #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h" #include "chrome/browser/ui/browser.h" +#include "chrome/browser/ui/browser_dialogs.h" #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" #include "chrome/browser/ui/views/website_settings/website_settings_popup_view.h" @@ -39,7 +40,7 @@ void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point, new BookmarkBubbleSignInDelegate(browser)); BookmarkBubbleView::ShowBubble(nullptr, gfx::Rect(anchor_point, gfx::Size()), - parent, observer, delegate.Pass(), + parent, observer, std::move(delegate), browser->profile(), url, already_bookmarked); } diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm index 274154e..22a153e 100644 --- a/chrome/browser/web_applications/web_app_mac.mm +++ b/chrome/browser/web_applications/web_app_mac.mm @@ -8,6 +8,8 @@ #import <Cocoa/Cocoa.h> #include <stdint.h> +#include <utility> + #include "base/command_line.h" #include "base/files/file_enumerator.h" #include "base/files/file_util.h" @@ -309,7 +311,7 @@ void UpdateAndLaunchShimOnFileThread( shortcut_info->profile_path, shortcut_info->extension_id, GURL()); UpdatePlatformShortcutsInternal(shortcut_data_dir, base::string16(), *shortcut_info, file_handlers_info); - LaunchShimOnFileThread(shortcut_info.Pass(), true); + LaunchShimOnFileThread(std::move(shortcut_info), true); } void UpdateAndLaunchShim( diff --git a/chrome/renderer/spellchecker/spellcheck_unittest.cc b/chrome/renderer/spellchecker/spellcheck_unittest.cc index 2b6e2b9..3beb7bb 100644 --- a/chrome/renderer/spellchecker/spellcheck_unittest.cc +++ b/chrome/renderer/spellchecker/spellcheck_unittest.cc @@ -75,7 +75,7 @@ class SpellCheckTest : public testing::Test { spell_check_->languages_.push_back(new SpellcheckLanguage()); spell_check_->languages_.front()->platform_spelling_engine_.reset( new HunspellEngine); - spell_check_->languages_.front()->Init(file.Pass(), language); + spell_check_->languages_.front()->Init(std::move(file), language); #else spell_check_->AddSpellcheckLanguage(std::move(file), language); #endif diff --git a/chrome/utility/extensions/extensions_handler.cc b/chrome/utility/extensions/extensions_handler.cc index b79a912..fdd6dfd 100644 --- a/chrome/utility/extensions/extensions_handler.cc +++ b/chrome/utility/extensions/extensions_handler.cc @@ -165,7 +165,7 @@ void ExtensionsHandler::OnParseIPhotoLibraryXmlFile( const IPC::PlatformFileForTransit& iphoto_library_file) { iphoto::IPhotoLibraryParser parser; base::File file = IPC::PlatformFileForTransitToFile(iphoto_library_file); - bool result = parser.Parse(iapps::ReadFileAsString(file.Pass())); + bool result = parser.Parse(iapps::ReadFileAsString(std::move(file))); Send(new ChromeUtilityHostMsg_GotIPhotoLibrary(result, parser.library())); ReleaseProcessIfNeeded(); } @@ -176,7 +176,7 @@ void ExtensionsHandler::OnParseITunesLibraryXmlFile( const IPC::PlatformFileForTransit& itunes_library_file) { itunes::ITunesLibraryParser parser; base::File file = IPC::PlatformFileForTransitToFile(itunes_library_file); - bool result = parser.Parse(iapps::ReadFileAsString(file.Pass())); + bool result = parser.Parse(iapps::ReadFileAsString(std::move(file))); Send(new ChromeUtilityHostMsg_GotITunesLibrary(result, parser.library())); ReleaseProcessIfNeeded(); } @@ -199,7 +199,7 @@ void ExtensionsHandler::OnParsePicasaPMPDatabase( files.uid_file = IPC::PlatformFileForTransitToFile(album_table_files.uid_file); - picasa::PicasaAlbumTableReader reader(files.Pass()); + picasa::PicasaAlbumTableReader reader(std::move(files)); bool parse_success = reader.Init(); Send(new ChromeUtilityHostMsg_ParsePicasaPMPDatabase_Finished( parse_success, reader.albums(), reader.folders())); diff --git a/chrome/utility/media_galleries/picasa_album_table_reader.cc b/chrome/utility/media_galleries/picasa_album_table_reader.cc index 3a7e651..a02b03f 100644 --- a/chrome/utility/media_galleries/picasa_album_table_reader.cc +++ b/chrome/utility/media_galleries/picasa_album_table_reader.cc @@ -8,6 +8,7 @@ #include <algorithm> #include <string> +#include <utility> #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" @@ -29,9 +30,7 @@ base::Time TimeFromMicrosoftVariantTime(double variant_time) { } // namespace PicasaAlbumTableReader::PicasaAlbumTableReader(AlbumTableFiles table_files) - : table_files_(table_files.Pass()), - initialized_(false) { -} + : table_files_(std::move(table_files)), initialized_(false) {} PicasaAlbumTableReader::~PicasaAlbumTableReader() { } diff --git a/chrome/utility/media_galleries/picasa_album_table_reader_unittest.cc b/chrome/utility/media_galleries/picasa_album_table_reader_unittest.cc index 80a8afa..5941a2b 100644 --- a/chrome/utility/media_galleries/picasa_album_table_reader_unittest.cc +++ b/chrome/utility/media_galleries/picasa_album_table_reader_unittest.cc @@ -2,12 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "chrome/utility/media_galleries/picasa_album_table_reader.h" + #include <stdint.h> +#include <utility> + #include "base/files/scoped_temp_dir.h" #include "chrome/common/media_galleries/picasa_test_util.h" #include "chrome/common/media_galleries/pmp_constants.h" -#include "chrome/utility/media_galleries/picasa_album_table_reader.h" #include "testing/gtest/include/gtest/gtest.h" namespace picasa { @@ -59,7 +62,7 @@ TEST(PicasaAlbumTableReaderTest, FoldersAndAlbums) { filename_vector, name_vector, token_vector, uid_vector); AlbumTableFiles album_table_files(temp_dir.path()); - PicasaAlbumTableReader reader(album_table_files.Pass()); + PicasaAlbumTableReader reader(std::move(album_table_files)); ASSERT_TRUE(reader.Init()); diff --git a/chrome/utility/safe_browsing/mac/dmg_iterator.cc b/chrome/utility/safe_browsing/mac/dmg_iterator.cc index 270bef7..834e9310 100644 --- a/chrome/utility/safe_browsing/mac/dmg_iterator.cc +++ b/chrome/utility/safe_browsing/mac/dmg_iterator.cc @@ -28,7 +28,7 @@ bool DMGIterator::Open() { for (size_t i = 0; i < udif_.GetNumberOfPartitions(); ++i) { if (udif_.GetPartitionType(i) == "Apple_HFS" || udif_.GetPartitionType(i) == "Apple_HFSX") { - partitions_.push_back(udif_.GetPartitionReadStream(i).Pass()); + partitions_.push_back(udif_.GetPartitionReadStream(i)); } } diff --git a/chrome/utility/safe_browsing/mac/udif.cc b/chrome/utility/safe_browsing/mac/udif.cc index 807a762..8e3ce0f 100644 --- a/chrome/utility/safe_browsing/mac/udif.cc +++ b/chrome/utility/safe_browsing/mac/udif.cc @@ -4,12 +4,13 @@ #include "chrome/utility/safe_browsing/mac/udif.h" -#include <bzlib.h> #include <CoreFoundation/CoreFoundation.h> +#include <bzlib.h> #include <libkern/OSByteOrder.h> #include <uuid/uuid.h> #include <algorithm> +#include <utility> #include "base/logging.h" #include "base/mac/foundation_util.h" @@ -470,7 +471,7 @@ bool UDIFParser::ParseBlkx() { } } - blocks_.push_back(block.Pass()); + blocks_.push_back(std::move(block)); partition_names_.push_back(partition_name); } diff --git a/components/policy/core/common/mac_util.cc b/components/policy/core/common/mac_util.cc index eb39778..f5b4ceb 100644 --- a/components/policy/core/common/mac_util.cc +++ b/components/policy/core/common/mac_util.cc @@ -5,6 +5,7 @@ #include "components/policy/core/common/mac_util.h" #include <string> +#include <utility> #include "base/mac/foundation_util.h" #include "base/strings/sys_string_conversions.h" @@ -77,7 +78,7 @@ scoped_ptr<base::Value> PropertyToValue(CFPropertyListRef property) { if (CFDictionaryRef dict = CFCast<CFDictionaryRef>(property)) { scoped_ptr<base::DictionaryValue> dict_value(new base::DictionaryValue()); CFDictionaryApplyFunction(dict, DictionaryEntryToValue, dict_value.get()); - return dict_value.Pass(); + return std::move(dict_value); } if (CFArrayRef array = CFCast<CFArrayRef>(property)) { @@ -86,7 +87,7 @@ scoped_ptr<base::Value> PropertyToValue(CFPropertyListRef property) { CFRangeMake(0, CFArrayGetCount(array)), ArrayEntryToValue, list_value.get()); - return list_value.Pass(); + return std::move(list_value); } return nullptr; diff --git a/components/policy/core/common/policy_loader_mac.mm b/components/policy/core/common/policy_loader_mac.mm index 8546764..0a2be3e 100644 --- a/components/policy/core/common/policy_loader_mac.mm +++ b/components/policy/core/common/policy_loader_mac.mm @@ -100,7 +100,7 @@ scoped_ptr<PolicyBundle> PolicyLoaderMac::Load() { // Load policy for the registered components. LoadPolicyForDomain(POLICY_DOMAIN_EXTENSIONS, "extensions", bundle.get()); - return bundle.Pass(); + return bundle; } base::Time PolicyLoaderMac::LastModificationTime() { diff --git a/components/policy/core/common/policy_loader_mac_unittest.cc b/components/policy/core/common/policy_loader_mac_unittest.cc index 3ab7394..9f51e05 100644 --- a/components/policy/core/common/policy_loader_mac_unittest.cc +++ b/components/policy/core/common/policy_loader_mac_unittest.cc @@ -2,8 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "components/policy/core/common/policy_loader_mac.h" + #include <CoreFoundation/CoreFoundation.h> +#include <utility> + #include "base/callback.h" #include "base/files/file_path.h" #include "base/mac/scoped_cftyperef.h" @@ -14,7 +18,6 @@ #include "components/policy/core/common/configuration_policy_provider_test.h" #include "components/policy/core/common/external_data_fetcher.h" #include "components/policy/core/common/policy_bundle.h" -#include "components/policy/core/common/policy_loader_mac.h" #include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_test_utils.h" #include "components/policy/core/common/policy_types.h" @@ -73,7 +76,7 @@ ConfigurationPolicyProvider* TestHarness::CreateProvider( prefs_ = new MockPreferences(); scoped_ptr<AsyncPolicyLoader> loader( new PolicyLoaderMac(task_runner, base::FilePath(), prefs_)); - return new AsyncPolicyProvider(registry, loader.Pass()); + return new AsyncPolicyProvider(registry, std::move(loader)); } void TestHarness::InstallEmptyPolicy() {} @@ -144,7 +147,8 @@ class PolicyLoaderMacTest : public PolicyTestBase { PolicyTestBase::SetUp(); scoped_ptr<AsyncPolicyLoader> loader( new PolicyLoaderMac(loop_.task_runner(), base::FilePath(), prefs_)); - provider_.reset(new AsyncPolicyProvider(&schema_registry_, loader.Pass())); + provider_.reset( + new AsyncPolicyProvider(&schema_registry_, std::move(loader))); provider_->Init(&schema_registry_); } diff --git a/components/wifi/network_properties.cc b/components/wifi/network_properties.cc index 4e12aae..91aa575 100644 --- a/components/wifi/network_properties.cc +++ b/components/wifi/network_properties.cc @@ -59,7 +59,7 @@ scoped_ptr<base::DictionaryValue> NetworkProperties::ToValue( } value->Set(onc::network_type::kWiFi, wifi.release()); - return value.Pass(); + return value; } bool NetworkProperties::UpdateFromValue(const base::DictionaryValue& value) { diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc index d99ee86..30014af 100644 --- a/components/wifi/wifi_test.cc +++ b/components/wifi/wifi_test.cc @@ -3,7 +3,9 @@ // found in the LICENSE file. #include <stdio.h> + #include <string> +#include <utility> #include "base/at_exit.h" #include "base/bind.h" @@ -177,8 +179,8 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) { std::string new_network_guid; properties->SetString("WiFi.SSID", network_guid); VLOG(0) << "Creating Network: " << *properties; - wifi_service_->CreateNetwork( - false, properties.Pass(), &new_network_guid, &error); + wifi_service_->CreateNetwork(false, std::move(properties), + &new_network_guid, &error); VLOG(0) << error << ":\n" << new_network_guid; return true; } @@ -189,7 +191,8 @@ bool WiFiTest::ParseCommandLine(int argc, const char* argv[]) { std::string error; if (!properties->empty()) { VLOG(0) << "Using connect properties: " << *properties; - wifi_service_->SetProperties(network_guid, properties.Pass(), &error); + wifi_service_->SetProperties(network_guid, std::move(properties), + &error); } wifi_service_->SetEventObservers( diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm index 88f7978..0721a9e 100644 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm @@ -57,7 +57,7 @@ scoped_ptr<base::DictionaryValue> PopulatePosition( static_cast<int>(node_position.x - root_left)); position->SetInteger(kYCoordDictAttr, static_cast<int>(-node_position.y - node_size.height - root_top)); - return position.Pass(); + return position; } scoped_ptr<base::DictionaryValue> @@ -66,14 +66,14 @@ PopulateSize(const BrowserAccessibilityCocoa* cocoa_node) { NSSize node_size = [[cocoa_node size] sizeValue]; size->SetInteger(kHeightDictAttr, static_cast<int>(node_size.height)); size->SetInteger(kWidthDictAttr, static_cast<int>(node_size.width)); - return size.Pass(); + return size; } scoped_ptr<base::DictionaryValue> PopulateRange(NSRange range) { scoped_ptr<base::DictionaryValue> rangeDict(new base::DictionaryValue); rangeDict->SetInteger(kRangeLocDictAttr, static_cast<int>(range.location)); rangeDict->SetInteger(kRangeLenDictAttr, static_cast<int>(range.length)); - return rangeDict.Pass(); + return rangeDict; } // Returns true if |value| is an NSValue containing a NSRange. @@ -89,7 +89,7 @@ scoped_ptr<base::ListValue> PopulateArray(NSArray* array) { scoped_ptr<base::ListValue> list(new base::ListValue); for (NSUInteger i = 0; i < [array count]; i++) list->Append(PopulateObject([array objectAtIndex:i]).release()); - return list.Pass(); + return list; } scoped_ptr<base::StringValue> StringForBrowserAccessibility( @@ -123,7 +123,7 @@ scoped_ptr<base::StringValue> StringForBrowserAccessibility( NSString* result = [tokens componentsJoinedByString:@" "]; return scoped_ptr<base::StringValue>( - new base::StringValue(SysNSStringToUTF16(result))).Pass(); + new base::StringValue(SysNSStringToUTF16(result))); } scoped_ptr<base::Value> PopulateObject(id value) { @@ -138,9 +138,8 @@ scoped_ptr<base::Value> PopulateObject(id value) { (BrowserAccessibilityCocoa*) value)); } - return scoped_ptr<base::Value>( - new base::StringValue( - SysNSStringToUTF16([NSString stringWithFormat:@"%@", value]))).Pass(); + return scoped_ptr<base::Value>(new base::StringValue( + SysNSStringToUTF16([NSString stringWithFormat:@"%@", value]))); } NSArray* BuildAllAttributesArray() { diff --git a/content/browser/child_process_launcher.cc b/content/browser/child_process_launcher.cc index 40d78e0..57a6368 100644 --- a/content/browser/child_process_launcher.cc +++ b/content/browser/child_process_launcher.cc @@ -248,8 +248,7 @@ void LaunchOnLauncherThread(const NotifyCallback& callback, BootstrapSandboxManager* sandbox_manager = BootstrapSandboxManager::GetInstance(); if (sandbox_manager->EnabledForSandbox(sandbox_type)) { - pre_exec_delegate = - sandbox_manager->sandbox()->NewClient(sandbox_type).Pass(); + pre_exec_delegate = sandbox_manager->sandbox()->NewClient(sandbox_type); } } options.pre_exec_delegate = pre_exec_delegate.get(); diff --git a/content/browser/compositor/browser_compositor_view_mac.mm b/content/browser/compositor/browser_compositor_view_mac.mm index d4104d2..4670ed0 100644 --- a/content/browser/compositor/browser_compositor_view_mac.mm +++ b/content/browser/compositor/browser_compositor_view_mac.mm @@ -6,6 +6,8 @@ #include <stdint.h> +#include <utility> + #include "base/lazy_instance.h" #include "base/trace_event/trace_event.h" #include "content/browser/compositor/image_transport_factory.h" @@ -76,8 +78,8 @@ void BrowserCompositorMac::OnCompositingDidCommit( scoped_ptr<BrowserCompositorMac> BrowserCompositorMac::Create() { DCHECK(ui::WindowResizeHelperMac::Get()->task_runner()); if (g_recyclable_browser_compositor.Get()) - return g_recyclable_browser_compositor.Get().Pass(); - return scoped_ptr<BrowserCompositorMac>(new BrowserCompositorMac).Pass(); + return std::move(g_recyclable_browser_compositor.Get()); + return scoped_ptr<BrowserCompositorMac>(new BrowserCompositorMac); } // static diff --git a/content/browser/device_sensors/ambient_light_mac.cc b/content/browser/device_sensors/ambient_light_mac.cc index 187f6a0..6f8d3d9 100644 --- a/content/browser/device_sensors/ambient_light_mac.cc +++ b/content/browser/device_sensors/ambient_light_mac.cc @@ -6,6 +6,8 @@ #include "content/browser/device_sensors/ambient_light_mac.h" +#include <utility> + #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_ioobject.h" @@ -23,7 +25,7 @@ enum LmuFunctionIndex { // static scoped_ptr<AmbientLightSensor> AmbientLightSensor::Create() { scoped_ptr<AmbientLightSensor> light_sensor(new AmbientLightSensor); - return light_sensor->Init() ? light_sensor.Pass() : nullptr; + return light_sensor->Init() ? std::move(light_sensor) : nullptr; } AmbientLightSensor::~AmbientLightSensor() { diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 3cbbb9a..ef38d30 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -657,7 +657,7 @@ void RenderWidgetHostViewMac::DestroyBrowserCompositorView() { browser_compositor_->accelerated_widget_mac()->ResetNSView(); browser_compositor_->compositor()->SetScaleAndSize(1.0, gfx::Size(0, 0)); browser_compositor_->compositor()->SetRootLayer(nullptr); - BrowserCompositorMac::Recycle(browser_compositor_.Pass()); + BrowserCompositorMac::Recycle(std::move(browser_compositor_)); browser_compositor_state_ = BrowserCompositorDestroyed; } } @@ -1250,7 +1250,7 @@ bool RenderWidgetHostViewMac::CanCopyToVideoFrame() const { void RenderWidgetHostViewMac::BeginFrameSubscription( scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) { DCHECK(delegated_frame_host_); - delegated_frame_host_->BeginFrameSubscription(subscriber.Pass()); + delegated_frame_host_->BeginFrameSubscription(std::move(subscriber)); } void RenderWidgetHostViewMac::EndFrameSubscription() { diff --git a/content/browser/web_contents/web_drag_source_mac.mm b/content/browser/web_contents/web_drag_source_mac.mm index 9e6443be..a94f9d3 100644 --- a/content/browser/web_contents/web_drag_source_mac.mm +++ b/content/browser/web_contents/web_drag_source_mac.mm @@ -6,6 +6,8 @@ #include <sys/param.h> +#include <utility> + #include "base/bind.h" #include "base/files/file.h" #include "base/files/file_path.h" @@ -313,14 +315,11 @@ void PromiseWriterHelper(const DropData& drop_data, return nil; if (downloadURL_.is_valid() && contents_) { - scoped_refptr<DragDownloadFile> dragFileDownloader(new DragDownloadFile( - filePath, - file.Pass(), - downloadURL_, - content::Referrer(contents_->GetLastCommittedURL(), - dropData_->referrer_policy), - contents_->GetEncoding(), - contents_)); + scoped_refptr<DragDownloadFile> dragFileDownloader( + new DragDownloadFile(filePath, std::move(file), downloadURL_, + content::Referrer(contents_->GetLastCommittedURL(), + dropData_->referrer_policy), + contents_->GetEncoding(), contents_)); // The finalizer will take care of closing and deletion. dragFileDownloader->Start(new PromiseFileFinalizer( diff --git a/content/common/font_list_mac.mm b/content/common/font_list_mac.mm index 64a54cd..f4a7cedd 100644 --- a/content/common/font_list_mac.mm +++ b/content/common/font_list_mac.mm @@ -27,7 +27,7 @@ scoped_ptr<base::ListValue> GetFontList_SlowBlocking() { font_item->Append(new base::StringValue(loc_family)); font_list->Append(font_item); } - return font_list.Pass(); + return font_list; } } // namespace content diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index 0686c57..6ab3954 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -5,6 +5,8 @@ #include <stddef.h> #include <stdlib.h> +#include <utility> + #include "base/lazy_instance.h" #include "base/message_loop/message_loop.h" #include "base/metrics/histogram.h" @@ -197,7 +199,7 @@ int GpuMain(const MainFunctionParams& parameters) { // This is necessary for CoreAnimation layers hosted in the GPU process to be // drawn. See http://crbug.com/312462. scoped_ptr<base::MessagePump> pump(new base::MessagePumpCFRunLoop()); - base::MessageLoop main_message_loop(pump.Pass()); + base::MessageLoop main_message_loop(std::move(pump)); #else base::MessageLoop main_message_loop(base::MessageLoop::TYPE_IO); #endif diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index 1847018..94f105c 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc @@ -147,7 +147,7 @@ int RendererMain(const MainFunctionParams& parameters) { // http://crbug.com/306348#c24 for details. scoped_ptr<base::MessagePump> pump(new base::MessagePumpNSRunLoop()); scoped_ptr<base::MessageLoop> main_message_loop( - new base::MessageLoop(pump.Pass())); + new base::MessageLoop(std::move(pump))); #else // The main message loop of the renderer services doesn't have IO or UI tasks. scoped_ptr<base::MessageLoop> main_message_loop(new base::MessageLoop()); @@ -206,8 +206,8 @@ int RendererMain(const MainFunctionParams& parameters) { // TODO(markus): Check if it is OK to unconditionally move this // instruction down. RenderProcessImpl render_process; - RenderThreadImpl::Create(main_message_loop.Pass(), - renderer_scheduler.Pass()); + RenderThreadImpl::Create(std::move(main_message_loop), + std::move(renderer_scheduler)); #endif bool run_loop = true; if (!no_sandbox) diff --git a/device/bluetooth/bluetooth_l2cap_channel_mac.mm b/device/bluetooth/bluetooth_l2cap_channel_mac.mm index 218721c..b136d27 100644 --- a/device/bluetooth/bluetooth_l2cap_channel_mac.mm +++ b/device/bluetooth/bluetooth_l2cap_channel_mac.mm @@ -99,7 +99,7 @@ scoped_ptr<BluetoothL2capChannelMac> BluetoothL2capChannelMac::OpenAsync( else channel.reset(); - return channel.Pass(); + return channel; } void BluetoothL2capChannelMac::SetSocket(BluetoothSocketMac* socket) { diff --git a/device/bluetooth/bluetooth_rfcomm_channel_mac.mm b/device/bluetooth/bluetooth_rfcomm_channel_mac.mm index 2b27a1c..53f2240 100644 --- a/device/bluetooth/bluetooth_rfcomm_channel_mac.mm +++ b/device/bluetooth/bluetooth_rfcomm_channel_mac.mm @@ -94,7 +94,7 @@ scoped_ptr<BluetoothRfcommChannelMac> BluetoothRfcommChannelMac::OpenAsync( channel.reset(); } - return channel.Pass(); + return channel; } void BluetoothRfcommChannelMac::SetSocket(BluetoothSocketMac* socket) { diff --git a/device/bluetooth/bluetooth_socket_mac.mm b/device/bluetooth/bluetooth_socket_mac.mm index 0157d10..c82e5d2 100644 --- a/device/bluetooth/bluetooth_socket_mac.mm +++ b/device/bluetooth/bluetooth_socket_mac.mm @@ -10,6 +10,7 @@ #include <limits> #include <sstream> #include <string> +#include <utility> #include "base/bind.h" #include "base/callback.h" @@ -648,7 +649,7 @@ void BluetoothSocketMac::OnChannelOpenComplete( DVLOG(1) << device_address << " " << uuid_.canonical_value() << ": channel open complete."; - scoped_ptr<ConnectCallbacks> temp = connect_callbacks_.Pass(); + scoped_ptr<ConnectCallbacks> temp = std::move(connect_callbacks_); if (status != kIOReturnSuccess) { ReleaseChannel(); std::stringstream error; @@ -724,7 +725,7 @@ void BluetoothSocketMac::OnChannelDataReceived(void* data, size_t length) { // If there is a pending read callback, call it now. if (receive_callbacks_) { - scoped_ptr<ReceiveCallbacks> temp = receive_callbacks_.Pass(); + scoped_ptr<ReceiveCallbacks> temp = std::move(receive_callbacks_); temp->success_callback.Run(buffer->size(), buffer); return; } @@ -834,7 +835,7 @@ void BluetoothSocketMac::OnChannelClosed() { DCHECK(thread_checker_.CalledOnValidThread()); if (receive_callbacks_) { - scoped_ptr<ReceiveCallbacks> temp = receive_callbacks_.Pass(); + scoped_ptr<ReceiveCallbacks> temp = std::move(receive_callbacks_); temp->error_callback.Run(BluetoothSocket::kDisconnected, kSocketNotConnected); } diff --git a/device/serial/serial_device_enumerator_mac.cc b/device/serial/serial_device_enumerator_mac.cc index 3a81f1d..7854c99 100644 --- a/device/serial/serial_device_enumerator_mac.cc +++ b/device/serial/serial_device_enumerator_mac.cc @@ -9,6 +9,7 @@ #include <stdint.h> #include <algorithm> +#include <utility> #include "base/files/file_enumerator.h" #include "base/files/file_path.h" @@ -106,13 +107,13 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesNew() { CFMutableDictionaryRef matchingDict = IOServiceMatching(kIOSerialBSDServiceValue); if (!matchingDict) - return devices.Pass(); + return devices; io_iterator_t it; kern_return_t kr = IOServiceGetMatchingServices(kIOMasterPortDefault, matchingDict, &it); if (kr != KERN_SUCCESS) - return devices.Pass(); + return devices; base::mac::ScopedIOObject<io_iterator_t> scoped_it(it); base::mac::ScopedIOObject<io_service_t> scoped_device; @@ -148,18 +149,18 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesNew() { &dialinDevice)) { serial::DeviceInfoPtr dialin_info = callout_info.Clone(); dialin_info->path = dialinDevice; - devices.push_back(dialin_info.Pass()); + devices.push_back(std::move(dialin_info)); } mojo::String calloutDevice; if (GetStringProperty(scoped_device.get(), CFSTR(kIOCalloutDeviceKey), &calloutDevice)) { callout_info->path = calloutDevice; - devices.push_back(callout_info.Pass()); + devices.push_back(std::move(callout_info)); } } - return devices.Pass(); + return devices; } // Returns an array of devices as retrieved through the old method of @@ -192,12 +193,12 @@ mojo::Array<serial::DeviceInfoPtr> GetDevicesOld() { if (base::MatchPattern(next_device, *i)) { serial::DeviceInfoPtr info(serial::DeviceInfo::New()); info->path = next_device; - devices.push_back(info.Pass()); + devices.push_back(std::move(info)); break; } } } while (true); - return devices.Pass(); + return devices; } } // namespace @@ -236,7 +237,7 @@ mojo::Array<serial::DeviceInfoPtr> SerialDeviceEnumeratorMac::GetDevices() { mojo::Array<serial::DeviceInfoPtr> devices; deviceMap.DecomposeMapTo(&paths, &devices); - return devices.Pass(); + return devices; } } // namespace device diff --git a/media/capture/video/mac/video_capture_device_decklink_mac.mm b/media/capture/video/mac/video_capture_device_decklink_mac.mm index 5df132d..3841be6 100644 --- a/media/capture/video/mac/video_capture_device_decklink_mac.mm +++ b/media/capture/video/mac/video_capture_device_decklink_mac.mm @@ -4,6 +4,8 @@ #include "media/capture/video/mac/video_capture_device_decklink_mac.h" +#include <utility> + #include "base/logging.h" #include "base/macros.h" #include "base/memory/ref_counted.h" @@ -477,7 +479,7 @@ void VideoCaptureDeviceDeckLinkMac::AllocateAndStart( const VideoCaptureParams& params, scoped_ptr<VideoCaptureDevice::Client> client) { DCHECK(thread_checker_.CalledOnValidThread()); - client_ = client.Pass(); + client_ = std::move(client); if (decklink_capture_delegate_.get()) decklink_capture_delegate_->AllocateAndStart(params); } diff --git a/media/capture/video/mac/video_capture_device_factory_mac.mm b/media/capture/video/mac/video_capture_device_factory_mac.mm index 2098f3e..5d92f7e 100644 --- a/media/capture/video/mac/video_capture_device_factory_mac.mm +++ b/media/capture/video/mac/video_capture_device_factory_mac.mm @@ -7,6 +7,8 @@ #import <IOKit/audio/IOAudioTypes.h> #include <stddef.h> +#include <utility> + #include "base/bind.h" #include "base/location.h" #include "base/macros.h" @@ -68,7 +70,7 @@ EnumerateDevicesUsingQTKit() { name.set_is_blacklisted(true); device_names->push_back(name); } - return device_names.Pass(); + return device_names; } static void RunDevicesEnumeratedCallback( @@ -80,7 +82,7 @@ static void RunDevicesEnumeratedCallback( tracked_objects::ScopedTracker tracking_profile( FROM_HERE_WITH_EXPLICIT_FUNCTION( "458397 media::RunDevicesEnumeratedCallback")); - callback.Run(device_names.Pass()); + callback.Run(std::move(device_names)); } VideoCaptureDeviceFactoryMac::VideoCaptureDeviceFactoryMac( @@ -109,7 +111,7 @@ scoped_ptr<VideoCaptureDevice> VideoCaptureDeviceFactoryMac::Create( capture_device.reset(); } } - return scoped_ptr<VideoCaptureDevice>(capture_device.Pass()); + return scoped_ptr<VideoCaptureDevice>(std::move(capture_device)); } void VideoCaptureDeviceFactoryMac::GetDeviceNames( @@ -158,7 +160,7 @@ void VideoCaptureDeviceFactoryMac::EnumerateDeviceNames(const base::Callback< scoped_ptr<VideoCaptureDevice::Names> device_names( new VideoCaptureDevice::Names()); GetDeviceNames(device_names.get()); - callback.Run(device_names.Pass()); + callback.Run(std::move(device_names)); } else { DVLOG(1) << "Enumerating video capture devices using QTKit"; base::PostTaskAndReplyWithResult( diff --git a/media/capture/video/mac/video_capture_device_mac.mm b/media/capture/video/mac/video_capture_device_mac.mm index 00e1c00..ec6fcaf 100644 --- a/media/capture/video/mac/video_capture_device_mac.mm +++ b/media/capture/video/mac/video_capture_device_mac.mm @@ -11,6 +11,7 @@ #include <stdint.h> #include <limits> +#include <utility> #include "base/bind.h" #include "base/location.h" @@ -377,7 +378,7 @@ void VideoCaptureDeviceMac::AllocateAndStart( if (!AVFoundationGlue::IsAVFoundationSupported()) GetBestMatchSupportedResolution(&resolution); - client_ = client.Pass(); + client_ = std::move(client); if (device_name_.capture_api_type() == Name::AVFOUNDATION) LogMessage("Using AVFoundation for device: " + device_name_.name()); else diff --git a/media/capture/video/video_capture_device_unittest.cc b/media/capture/video/video_capture_device_unittest.cc index 7db16aa..2b6ef43 100644 --- a/media/capture/video/video_capture_device_unittest.cc +++ b/media/capture/video/video_capture_device_unittest.cc @@ -294,7 +294,7 @@ TEST_F(VideoCaptureDeviceTest, MAYBE_OpenInvalidDevice) { capture_params.requested_format.frame_size.SetSize(640, 480); capture_params.requested_format.frame_rate = 30; capture_params.requested_format.pixel_format = PIXEL_FORMAT_I420; - device->AllocateAndStart(capture_params, client_.Pass()); + device->AllocateAndStart(capture_params, std::move(client_)); device->StopAndDeAllocate(); } #endif diff --git a/media/cast/sender/h264_vt_encoder_unittest.cc b/media/cast/sender/h264_vt_encoder_unittest.cc index 49a451d..4798a21 100644 --- a/media/cast/sender/h264_vt_encoder_unittest.cc +++ b/media/cast/sender/h264_vt_encoder_unittest.cc @@ -231,9 +231,8 @@ class H264VideoToolboxEncoderTest : public ::testing::Test { new base::PowerMonitor(scoped_ptr<TestPowerSource>(power_source_))); cast_environment_ = new CastEnvironment( - scoped_ptr<base::TickClock>(clock_).Pass(), - message_loop_.task_runner(), message_loop_.task_runner(), - message_loop_.task_runner()); + scoped_ptr<base::TickClock>(clock_), message_loop_.task_runner(), + message_loop_.task_runner(), message_loop_.task_runner()); encoder_.reset(new H264VideoToolboxEncoder( cast_environment_, video_sender_config_, base::Bind(&SaveOperationalStatus, &operational_status_))); diff --git a/sandbox/mac/bootstrap_sandbox.cc b/sandbox/mac/bootstrap_sandbox.cc index d006f3f..dee7903 100644 --- a/sandbox/mac/bootstrap_sandbox.cc +++ b/sandbox/mac/bootstrap_sandbox.cc @@ -68,7 +68,7 @@ scoped_ptr<BootstrapSandbox> BootstrapSandbox::Create() { if (kr != KERN_SUCCESS) { BOOTSTRAP_LOG(ERROR, kr) << "Failed to bootstrap_check_in the sandbox server."; - return null.Pass(); + return null; } sandbox->check_in_port_.reset(port); @@ -81,9 +81,9 @@ scoped_ptr<BootstrapSandbox> BootstrapSandbox::Create() { // Start the sandbox server. if (!sandbox->launchd_server_->Initialize(MACH_PORT_NULL)) - return null.Pass(); + return null; - return sandbox.Pass(); + return sandbox; } // Warning: This function must be safe to call in diff --git a/ui/message_center/cocoa/popup_collection_unittest.mm b/ui/message_center/cocoa/popup_collection_unittest.mm index 274d375..f802888 100644 --- a/ui/message_center/cocoa/popup_collection_unittest.mm +++ b/ui/message_center/cocoa/popup_collection_unittest.mm @@ -4,6 +4,8 @@ #import "ui/message_center/cocoa/popup_collection.h" +#include <utility> + #include "base/mac/scoped_nsobject.h" #include "base/memory/scoped_ptr.h" #include "base/message_loop/message_loop.h" @@ -54,14 +56,14 @@ class PopupCollectionTest : public ui::CocoaTest { " be displayed"), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); notification.reset(new message_center::Notification( message_center::NOTIFICATION_TYPE_SIMPLE, "2", ASCIIToUTF16("Two"), ASCIIToUTF16("This is the second notification."), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); notification.reset(new message_center::Notification( message_center::NOTIFICATION_TYPE_SIMPLE, "3", ASCIIToUTF16("Three"), @@ -73,7 +75,7 @@ class PopupCollectionTest : public ui::CocoaTest { "if the notification is way too big"), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); WaitForAnimationEnded(); } @@ -123,7 +125,7 @@ TEST_F(PopupCollectionTest, AttemptFourOneOffscreen) { ASCIIToUTF16("This is the fourth notification."), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); WaitForAnimationEnded(); // Remove "1" and "3" should fit on screen. @@ -166,7 +168,7 @@ TEST_F(PopupCollectionTest, LayoutSpacing) { message_center::NOTIFICATION_TYPE_SIMPLE, "4", ASCIIToUTF16("Four"), ASCIIToUTF16("This is the fourth notification."), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), optional, NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); WaitForAnimationEnded(); EXPECT_TRUE(CheckSpacingBetween([popups objectAtIndex:2], [popups objectAtIndex:3])); @@ -199,7 +201,7 @@ TEST_F(PopupCollectionTest, TinyScreen) { " be displayed"), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); WaitForAnimationEnded(); EXPECT_EQ(1u, [[collection_ popups] count]); @@ -216,7 +218,7 @@ TEST_F(PopupCollectionTest, TinyScreen) { "long notification."), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->UpdateNotification("1", notification.Pass()); + center_->UpdateNotification("1", std::move(notification)); WaitForAnimationEnded(); EXPECT_EQ(0u, [[collection_ popups] count]); } @@ -256,7 +258,7 @@ TEST_F(PopupCollectionTest, UpdateIconAndBody) { "longer body"), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); WaitForAnimationEnded(); EXPECT_GT(NSHeight([[controller view] frame]), NSHeight(old_frame)); @@ -280,7 +282,7 @@ TEST_F(PopupCollectionTest, UpdatePriority) { message_center::RichNotificationData(), NULL)); notification->set_priority(-1); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); WaitForAnimationEnded(); NSArray* popups = [collection_ popups]; EXPECT_EQ(0u, [popups count]); @@ -293,7 +295,7 @@ TEST_F(PopupCollectionTest, UpdatePriority) { message_center::RichNotificationData(), NULL)); notification->set_priority(1); - center_->UpdateNotification("1", notification.Pass()); + center_->UpdateNotification("1", std::move(notification)); WaitForAnimationEnded(); EXPECT_EQ(1u, [popups count]); } @@ -307,7 +309,7 @@ TEST_F(PopupCollectionTest, CloseCollectionBeforeNewPopupAnimationEnds) { " be displayed"), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->AddNotification(notification.Pass()); + center_->AddNotification(std::move(notification)); // Release the popup collection before the animation ends. No crash should // be expected. @@ -334,7 +336,7 @@ TEST_F(PopupCollectionTest, CloseCollectionBeforeUpdatePopupAnimationEnds) { message_center::NOTIFICATION_TYPE_SIMPLE, "1", ASCIIToUTF16("One"), ASCIIToUTF16("New message."), gfx::Image(), base::string16(), GURL(), DummyNotifierId(), message_center::RichNotificationData(), NULL)); - center_->UpdateNotification("1", notification.Pass()); + center_->UpdateNotification("1", std::move(notification)); // Release the popup collection before the animation ends. No crash should // be expected. diff --git a/ui/views/widget/native_widget_mac.mm b/ui/views/widget/native_widget_mac.mm index e34f61d..f61ff81 100644 --- a/ui/views/widget/native_widget_mac.mm +++ b/ui/views/widget/native_widget_mac.mm @@ -6,6 +6,8 @@ #import <Cocoa/Cocoa.h> +#include <utility> + #include "base/mac/foundation_util.h" #include "base/mac/scoped_nsobject.h" #include "base/strings/sys_string_conversions.h" @@ -367,7 +369,7 @@ void NativeWidgetMac::CloseNow() { // Notify observers while |bridged_| is still valid. delegate_->OnNativeWidgetDestroying(); // Reset |bridge_| to NULL before destroying it. - scoped_ptr<BridgedNativeWidget> bridge(bridge_.Pass()); + scoped_ptr<BridgedNativeWidget> bridge(std::move(bridge_)); } void NativeWidgetMac::Show() { |