summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2016-03-02 15:20:34 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-02 23:21:51 +0000
commit70c494273fa71d922405cba4dc39f5457652a2db (patch)
tree9285f262fe33d8a3d4d9f36f8cd8244caa568ef7 /chrome
parent063be11909af7bd64a575259b5ff01eb0686e287 (diff)
downloadchromium_src-70c494273fa71d922405cba4dc39f5457652a2db.zip
chromium_src-70c494273fa71d922405cba4dc39f5457652a2db.tar.gz
chromium_src-70c494273fa71d922405cba4dc39f5457652a2db.tar.bz2
Convert Pass()→std::move() on Windows
Also cleaned up a few stragglers from grepping the source: it's unclear if these are just building with weird defines, don't build at all, only build on obscure platforms, or something else… either way, Pass() itself will be removed shortly after this. BUG=557422 Review URL: https://codereview.chromium.org/1752233002 Cr-Commit-Position: refs/heads/master@{#378872}
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/component_updater/caps_installer_win.cc3
-rw-r--r--chrome/browser/component_updater/sw_reporter_installer_win.cc3
-rw-r--r--chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc2
-rw-r--r--chrome/browser/extensions/api/messaging/native_process_launcher_win.cc2
-rw-r--r--chrome/browser/install_verification/win/module_list.cc2
-rw-r--r--chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc3
-rw-r--r--chrome/browser/password_manager/password_store_factory.cc2
-rw-r--r--chrome/browser/password_manager/password_store_win.cc7
-rw-r--r--chrome/browser/policy/chrome_browser_policy_connector.cc2
-rw-r--r--chrome/browser/printing/pdf_to_emf_converter.cc20
-rw-r--r--chrome/browser/printing/print_job.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc6
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer_win.cc6
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc4
-rw-r--r--chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc4
-rw-r--r--chrome/browser/ui/pdf/pdf_unsupported_feature.cc4
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_triggered_reset_browsertest_win.cc3
-rw-r--r--chrome/browser/ui/views/elevation_icon_setter.cc4
-rw-r--r--chrome/browser/ui/views/frame/browser_window_property_manager_win.cc4
-rw-r--r--chrome/browser/ui/views/frame/glass_browser_frame_view.cc18
-rw-r--r--chrome/browser/ui/views/frame/taskbar_decorator_win.cc2
-rw-r--r--chrome/browser/ui/views/status_icons/status_icon_win.cc4
-rw-r--r--chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc14
-rw-r--r--chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc9
-rw-r--r--chrome/browser/ui/views/status_icons/status_tray_win.cc4
-rw-r--r--chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc4
-rw-r--r--chrome/chrome_watcher/chrome_watcher_main.cc8
-rw-r--r--chrome/installer/test/alternate_version_generator.cc4
-rw-r--r--chrome/installer/util/browser_distribution.cc8
-rw-r--r--chrome/installer/util/chromium_binaries_distribution.cc7
-rw-r--r--chrome/installer/util/firewall_manager_win.cc8
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc5
-rw-r--r--chrome/installer/util/google_chrome_distribution_dummy.cc5
-rw-r--r--chrome/installer/util/google_update_settings.cc2
-rw-r--r--chrome/service/cloud_print/cdd_conversion_win.cc6
-rw-r--r--chrome/service/service_utility_process_host.cc9
-rw-r--r--chrome/utility/printing_handler.cc4
38 files changed, 117 insertions, 93 deletions
diff --git a/chrome/browser/component_updater/caps_installer_win.cc b/chrome/browser/component_updater/caps_installer_win.cc
index 61d87457..78942ba 100644
--- a/chrome/browser/component_updater/caps_installer_win.cc
+++ b/chrome/browser/component_updater/caps_installer_win.cc
@@ -6,6 +6,7 @@
#include <stdint.h>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/command_line.h"
@@ -115,7 +116,7 @@ void RegisterCAPSComponent(ComponentUpdateService* cus) {
scoped_ptr<ComponentInstallerTraits> traits(
new CAPSInstallerTraits());
DefaultComponentInstaller* installer =
- new DefaultComponentInstaller(traits.Pass());
+ new DefaultComponentInstaller(std::move(traits));
installer->Register(cus, base::Closure());
}
diff --git a/chrome/browser/component_updater/sw_reporter_installer_win.cc b/chrome/browser/component_updater/sw_reporter_installer_win.cc
index d0c694e..025eacf 100644
--- a/chrome/browser/component_updater/sw_reporter_installer_win.cc
+++ b/chrome/browser/component_updater/sw_reporter_installer_win.cc
@@ -8,6 +8,7 @@
#include <map>
#include <string>
+#include <utility>
#include <vector>
#include "base/base_paths.h"
@@ -238,7 +239,7 @@ void RegisterSwReporterComponent(ComponentUpdateService* cus) {
scoped_ptr<ComponentInstallerTraits> traits(new SwReporterInstallerTraits());
// |cus| will take ownership of |installer| during installer->Register(cus).
DefaultComponentInstaller* installer =
- new DefaultComponentInstaller(traits.Pass());
+ new DefaultComponentInstaller(std::move(traits));
installer->Register(cus, base::Closure());
}
diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
index 800fd74..3dd4d8a 100644
--- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
+++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc
@@ -213,7 +213,7 @@ TEST_F(NativeMessagingTest, SingleSendMessageWrite) {
FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL));
ASSERT_TRUE(read_handle.IsValid());
- read_file = read_handle.Pass();
+ read_file = std::move(read_handle);
#else // defined(OS_WIN)
base::PlatformFile pipe_handles[2];
ASSERT_EQ(0, pipe(pipe_handles));
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc
index 2192b27..6ae37b3 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_win.cc
@@ -170,7 +170,7 @@ bool NativeProcessLauncher::LaunchNativeProcess(
return false;
}
- *process = cmd_process.Pass();
+ *process = std::move(cmd_process);
*read_file = base::File::CreateForAsyncHandle(stdout_pipe.Take());
*write_file = base::File::CreateForAsyncHandle(stdin_pipe.Take());
diff --git a/chrome/browser/install_verification/win/module_list.cc b/chrome/browser/install_verification/win/module_list.cc
index 3080806..7a31bf1 100644
--- a/chrome/browser/install_verification/win/module_list.cc
+++ b/chrome/browser/install_verification/win/module_list.cc
@@ -39,7 +39,7 @@ scoped_ptr<ModuleList> ModuleList::FromLoadedModuleSnapshot(
}
}
- return instance.Pass();
+ return instance;
}
void ModuleList::GetModuleInfoSet(std::set<ModuleInfo>* module_info_set) {
diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc
index d6728a4..c200b17 100644
--- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc
+++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win_unittest.cc
@@ -4,6 +4,7 @@
#include <stddef.h>
+#include <utility>
#include <vector>
#include "base/command_line.h"
@@ -90,7 +91,7 @@ void MTPDeviceDelegateImplWinTest::SetUp() {
TestingBrowserProcess* browser_process = TestingBrowserProcess::GetGlobal();
DCHECK(browser_process);
monitor_ = monitor.get();
- StorageMonitor::SetStorageMonitorForTesting(monitor.Pass());
+ StorageMonitor::SetStorageMonitorForTesting(std::move(monitor));
base::RunLoop runloop;
browser_process->media_file_system_registry()->GetPreferences(profile())->
diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc
index 379164c..f298ff9 100644
--- a/chrome/browser/password_manager/password_store_factory.cc
+++ b/chrome/browser/password_manager/password_store_factory.cc
@@ -162,7 +162,7 @@ PasswordStoreFactory::BuildServiceInstanceFor(
scoped_refptr<PasswordStore> ps;
#if defined(OS_WIN)
ps = new PasswordStoreWin(main_thread_runner, db_thread_runner,
- login_db.Pass(),
+ std::move(login_db),
WebDataServiceFactory::GetPasswordWebDataForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS));
#elif defined(OS_MACOSX)
diff --git a/chrome/browser/password_manager/password_store_win.cc b/chrome/browser/password_manager/password_store_win.cc
index 7fa51aa..49993a9 100644
--- a/chrome/browser/password_manager/password_store_win.cc
+++ b/chrome/browser/password_manager/password_store_win.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <map>
+#include <utility>
#include <vector>
#include "base/bind.h"
@@ -138,7 +139,7 @@ ScopedVector<autofill::PasswordForm> PasswordStoreWin::DBHandler::GetIE7Results(
}
}
}
- return matched_forms.Pass();
+ return matched_forms;
}
void PasswordStoreWin::DBHandler::OnWebDataServiceRequestDone(
@@ -177,7 +178,7 @@ PasswordStoreWin::PasswordStoreWin(
const scoped_refptr<PasswordWebDataService>& web_data_service)
: PasswordStoreDefault(main_thread_runner,
db_thread_runner,
- login_db.Pass()) {
+ std::move(login_db)) {
db_handler_.reset(new DBHandler(web_data_service, this));
}
@@ -213,6 +214,6 @@ void PasswordStoreWin::GetLoginsImpl(const PasswordForm& form,
form, base::Bind(&GetLoginsRequest::NotifyConsumerWithResults,
base::Owned(request.release())));
} else {
- request->NotifyConsumerWithResults(matched_forms.Pass());
+ request->NotifyConsumerWithResults(std::move(matched_forms));
}
}
diff --git a/chrome/browser/policy/chrome_browser_policy_connector.cc b/chrome/browser/policy/chrome_browser_policy_connector.cc
index b9d3dfe..cd5f1dc 100644
--- a/chrome/browser/policy/chrome_browser_policy_connector.cc
+++ b/chrome/browser/policy/chrome_browser_policy_connector.cc
@@ -97,7 +97,7 @@ ConfigurationPolicyProvider*
scoped_ptr<AsyncPolicyLoader> loader(PolicyLoaderWin::Create(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
kRegistryChromePolicyKey));
- return new AsyncPolicyProvider(GetSchemaRegistry(), loader.Pass());
+ return new AsyncPolicyProvider(GetSchemaRegistry(), std::move(loader));
#elif defined(OS_MACOSX)
scoped_ptr<AsyncPolicyLoader> loader(new PolicyLoaderMac(
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE),
diff --git a/chrome/browser/printing/pdf_to_emf_converter.cc b/chrome/browser/printing/pdf_to_emf_converter.cc
index 8656dd5..17d2356 100644
--- a/chrome/browser/printing/pdf_to_emf_converter.cc
+++ b/chrome/browser/printing/pdf_to_emf_converter.cc
@@ -64,7 +64,7 @@ typedef scoped_ptr<base::File, BrowserThread::DeleteOnFileThread>
class LazyEmf : public MetafilePlayer {
public:
LazyEmf(const scoped_refptr<RefCountedTempDir>& temp_dir, ScopedTempFile file)
- : temp_dir_(temp_dir), file_(file.Pass()) {
+ : temp_dir_(temp_dir), file_(std::move(file)) {
CHECK(file_);
}
~LazyEmf() override { Close(); }
@@ -139,8 +139,8 @@ class PdfToEmfUtilityProcessHostClient
const PdfToEmfConverter::GetPageCallback& callback() const {
return callback_;
}
- ScopedTempFile TakeEmf() { return emf_.Pass(); }
- void set_emf(ScopedTempFile emf) { emf_ = emf.Pass(); }
+ ScopedTempFile TakeEmf() { return std::move(emf_); }
+ void set_emf(ScopedTempFile emf) { emf_ = std::move(emf); }
private:
int page_number_;
@@ -211,12 +211,12 @@ ScopedTempFile CreateTempFile(scoped_refptr<RefCountedTempDir>* temp_dir) {
*temp_dir = new RefCountedTempDir();
ScopedTempFile file;
if (!(*temp_dir)->IsValid())
- return file.Pass();
+ return file;
base::FilePath path;
if (!base::CreateTemporaryFileInDir((*temp_dir)->GetPath(), &path)) {
PLOG(ERROR) << "Failed to create file in "
<< (*temp_dir)->GetPath().value();
- return file.Pass();
+ return file;
}
file.reset(new base::File(path,
base::File::FLAG_CREATE_ALWAYS |
@@ -228,7 +228,7 @@ ScopedTempFile CreateTempFile(scoped_refptr<RefCountedTempDir>* temp_dir) {
PLOG(ERROR) << "Failed to create " << path.value();
file.reset();
}
- return file.Pass();
+ return file;
}
ScopedTempFile CreateTempPdfFile(
@@ -241,10 +241,10 @@ ScopedTempFile CreateTempPdfFile(
static_cast<int>(data->size()) !=
pdf_file->WriteAtCurrentPos(data->front_as<char>(), data->size())) {
pdf_file.reset();
- return pdf_file.Pass();
+ return pdf_file;
}
pdf_file->Seek(base::File::FROM_BEGIN, 0);
- return pdf_file.Pass();
+ return pdf_file;
}
bool LazyEmf::SafePlayback(HDC hdc) const {
@@ -392,7 +392,7 @@ void PdfToEmfUtilityProcessHostClient::OnTempEmfReady(
base::ProcessHandle process = utility_process_host_->GetData().handle;
IPC::PlatformFileForTransit transit =
IPC::GetFileHandleForProcess(emf->GetPlatformFile(), process, false);
- callback_data->set_emf(emf.Pass());
+ callback_data->set_emf(std::move(emf));
// Should reply with OnPageDone().
Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage(
callback_data->page_number(), transit));
@@ -410,7 +410,7 @@ void PdfToEmfUtilityProcessHostClient::OnPageDone(bool success,
ScopedTempFile temp_emf = data.TakeEmf();
if (!temp_emf) // Unexpected message from utility process.
return OnFailed();
- emf.reset(new LazyEmf(temp_dir_, temp_emf.Pass()));
+ emf.reset(new LazyEmf(temp_dir_, std::move(temp_emf)));
}
BrowserThread::PostTask(BrowserThread::UI,
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index bb05e14..55a3b8e 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -308,9 +308,7 @@ void PrintJob::OnPdfToEmfPageConverted(int page_number,
}
// Update the rendered document. It will send notifications to the listener.
- document_->SetPage(page_number,
- emf.Pass(),
- scale_factor,
+ document_->SetPage(page_number, std::move(emf), scale_factor,
ptd_to_emf_state_->page_size(),
ptd_to_emf_state_->content_area());
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc
index 952981f..71a7b12 100644
--- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.cc
@@ -6,6 +6,8 @@
#include <stddef.h>
+#include <utility>
+
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
@@ -79,7 +81,7 @@ void VerifyBinaryIntegrity(scoped_ptr<IncidentReceiver> incident_receiver) {
// Send the report.
incident_receiver->AddIncidentForProcess(
- make_scoped_ptr(new BinaryIntegrityIncident(incident.Pass())));
+ make_scoped_ptr(new BinaryIntegrityIncident(std::move(incident))));
} else {
// The binary is integral, remove previous report so that next incidents
// for the binary will be reported.
diff --git a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc
index dc7c9a3..883cfc68 100644
--- a/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win_unittest.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/safe_browsing/incident_reporting/binary_integrity_analyzer_win.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/files/file_util.h"
#include "base/files/scoped_temp_dir.h"
@@ -108,7 +110,7 @@ TEST_F(BinaryIntegrityAnalyzerWinTest, VerifyBinaryIntegrity) {
EXPECT_CALL(*mock_receiver, DoClearIncidentForProcess(_))
.WillOnce(TakeIncident(&incident_to_clear));
- VerifyBinaryIntegrity(mock_receiver.Pass());
+ VerifyBinaryIntegrity(std::move(mock_receiver));
ASSERT_TRUE(incident_to_clear);
ASSERT_EQ(IncidentType::BINARY_INTEGRITY, incident_to_clear->GetType());
@@ -121,7 +123,7 @@ TEST_F(BinaryIntegrityAnalyzerWinTest, VerifyBinaryIntegrity) {
EXPECT_CALL(*mock_receiver, DoAddIncidentForProcess(_))
.WillOnce(TakeIncident(&incident));
- VerifyBinaryIntegrity(mock_receiver.Pass());
+ VerifyBinaryIntegrity(std::move(mock_receiver));
// Verify that the cleared and reported incidents have the same key.
ASSERT_EQ(incident->GetKey(), incident_to_clear->GetKey());
diff --git a/chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer_win.cc b/chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer_win.cc
index b42229b..6672de3 100644
--- a/chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer_win.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer_win.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/safe_browsing/incident_reporting/blacklist_load_analyzer.h"
+#include <utility>
+
#include "base/file_version_info.h"
#include "base/files/file_path.h"
#include "base/logging.h"
@@ -101,8 +103,8 @@ void VerifyBlacklistLoadState(scoped_ptr<IncidentReceiver> incident_receiver) {
}
// Send the report.
- incident_receiver->AddIncidentForProcess(
- make_scoped_ptr(new BlacklistLoadIncident(blacklist_load.Pass())));
+ incident_receiver->AddIncidentForProcess(make_scoped_ptr(
+ new BlacklistLoadIncident(std::move(blacklist_load))));
}
}
}
diff --git a/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc b/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc
index d367cd8..59aeda4 100644
--- a/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/platform_state_store.cc
@@ -154,9 +154,9 @@ scoped_ptr<base::DictionaryValue> Load(Profile* profile) {
UMA_HISTOGRAM_ENUMERATION(
"SBIRS.PSSLoadResult", static_cast<uint32_t>(result),
static_cast<uint32_t>(PlatformStateStoreLoadResult::NUM_RESULTS));
- return value_dict.Pass();
+ return value_dict;
#else
- return scoped_ptr<base::DictionaryValue>();
+ return nullptr;
#endif
}
diff --git a/chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc
index 86138ef..5bf6f2e 100644
--- a/chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/platform_state_store_win_unittest.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/safe_browsing/incident_reporting/platform_state_store.h"
+#include <utility>
+
#include "base/macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/test_reg_util_win.h"
@@ -66,7 +68,7 @@ class PlatformStateStoreWinTest : public ::testing::Test {
new user_prefs::PrefRegistrySyncable(), new PrefNotifierImpl()));
chrome::RegisterUserProfilePrefs(prefs->registry());
profile_ = profile_manager_.CreateTestingProfile(
- kProfileName_, prefs.Pass(), base::UTF8ToUTF16(kProfileName_), 0,
+ kProfileName_, std::move(prefs), base::UTF8ToUTF16(kProfileName_), 0,
std::string(), TestingProfile::TestingFactories());
if (new_profile)
ASSERT_TRUE(profile_->IsNewProfile());
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 796a51f..092b7a8 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/pdf/pdf_unsupported_feature.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
@@ -327,7 +329,7 @@ void MaybeShowOpenPDFInReaderPrompt(WebContents* web_contents,
new PDFUnsupportedFeaturePromptClient(web_contents, reader_info));
pdf::PDFWebContentsHelper* pdf_tab_helper =
pdf::PDFWebContentsHelper::FromWebContents(web_contents);
- pdf_tab_helper->ShowOpenInReaderPrompt(prompt.Pass());
+ pdf_tab_helper->ShowOpenInReaderPrompt(std::move(prompt));
}
void GotPluginsCallback(int process_id,
diff --git a/chrome/browser/ui/startup/startup_browser_creator_triggered_reset_browsertest_win.cc b/chrome/browser/ui/startup/startup_browser_creator_triggered_reset_browsertest_win.cc
index 16f4e20..1f8c4d2 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_triggered_reset_browsertest_win.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_triggered_reset_browsertest_win.cc
@@ -78,8 +78,7 @@ class StartupBrowserCreatorTriggeredResetTest : public InProcessBrowserTest {
->RegisterWillCreateBrowserContextServicesCallbackForTesting(
base::Bind(&StartupBrowserCreatorTriggeredResetTest::
OnWillCreateBrowserContextServices,
- base::Unretained(this)))
- .Pass();
+ base::Unretained(this)));
}
private:
diff --git a/chrome/browser/ui/views/elevation_icon_setter.cc b/chrome/browser/ui/views/elevation_icon_setter.cc
index 1548025..877ff9a 100644
--- a/chrome/browser/ui/views/elevation_icon_setter.cc
+++ b/chrome/browser/ui/views/elevation_icon_setter.cc
@@ -29,7 +29,7 @@ scoped_ptr<SkBitmap> GetElevationIcon() {
#if defined(OS_WIN)
if ((base::win::GetVersion() < base::win::VERSION_VISTA) ||
!base::win::UserAccountControlIsEnabled())
- return icon.Pass();
+ return icon;
SHSTOCKICONINFO icon_info = { sizeof(SHSTOCKICONINFO) };
typedef HRESULT (STDAPICALLTYPE *GetStockIconInfo)(SHSTOCKICONID,
@@ -43,7 +43,7 @@ scoped_ptr<SkBitmap> GetElevationIcon() {
// TODO(pkasting): Run on a background thread since this call spins a nested
// message loop.
if (FAILED((*func)(SIID_SHIELD, SHGSI_ICON | SHGSI_SMALLICON, &icon_info)))
- return icon.Pass();
+ return icon;
icon.reset(IconUtil::CreateSkBitmapFromHICON(
icon_info.hIcon,
diff --git a/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc b/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc
index 42f7804..99c5e0a 100644
--- a/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc
+++ b/chrome/browser/ui/views/frame/browser_window_property_manager_win.cc
@@ -104,12 +104,12 @@ scoped_ptr<BrowserWindowPropertyManager>
BrowserView* view, HWND hwnd) {
if (base::win::GetVersion() < base::win::VERSION_WIN7 ||
view->browser()->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH)
- return scoped_ptr<BrowserWindowPropertyManager>();
+ return nullptr;
scoped_ptr<BrowserWindowPropertyManager> browser_window_property_manager(
new BrowserWindowPropertyManager(view, hwnd));
browser_window_property_manager->UpdateWindowProperties();
- return browser_window_property_manager.Pass();
+ return browser_window_property_manager;
}
void BrowserWindowPropertyManager::OnProfileIconVersionChange() {
diff --git a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
index 3c7248d..8cb28d8 100644
--- a/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/glass_browser_frame_view.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/frame/glass_browser_frame_view.h"
+#include <utility>
+
#include "base/strings/utf_string_conversions.h"
#include "base/win/windows_version.h"
#include "chrome/app/chrome_command_ids.h"
@@ -608,18 +610,14 @@ void GlassBrowserFrameView::StopThrobber() {
gfx::ImageSkia icon = browser_view()->GetWindowIcon();
if (!icon.isNull()) {
// Keep previous icons alive as long as they are referenced by the HWND.
- previous_small_icon = small_window_icon_.Pass();
- previous_big_icon = big_window_icon_.Pass();
+ previous_small_icon = std::move(small_window_icon_);
+ previous_big_icon = std::move(big_window_icon_);
// Take responsibility for eventually destroying the created icons.
- small_window_icon_ =
- CreateHICONFromSkBitmapSizedTo(icon, GetSystemMetrics(SM_CXSMICON),
- GetSystemMetrics(SM_CYSMICON))
- .Pass();
- big_window_icon_ =
- CreateHICONFromSkBitmapSizedTo(icon, GetSystemMetrics(SM_CXICON),
- GetSystemMetrics(SM_CYICON))
- .Pass();
+ small_window_icon_ = CreateHICONFromSkBitmapSizedTo(
+ icon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON));
+ big_window_icon_ = CreateHICONFromSkBitmapSizedTo(
+ icon, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON));
small_icon = small_window_icon_.get();
big_icon = big_window_icon_.get();
diff --git a/chrome/browser/ui/views/frame/taskbar_decorator_win.cc b/chrome/browser/ui/views/frame/taskbar_decorator_win.cc
index 713cee0..00a3c2e 100644
--- a/chrome/browser/ui/views/frame/taskbar_decorator_win.cc
+++ b/chrome/browser/ui/views/frame/taskbar_decorator_win.cc
@@ -58,7 +58,7 @@ void SetOverlayIcon(HWND hwnd, scoped_ptr<SkBitmap> bitmap) {
SkCanvas offscreen_canvas(offscreen_bitmap);
offscreen_canvas.clear(SK_ColorTRANSPARENT);
offscreen_canvas.drawBitmap(sk_icon, 0, kOverlayIconSize - resized_height);
- icon = IconUtil::CreateHICONFromSkBitmap(offscreen_bitmap).Pass();
+ icon = IconUtil::CreateHICONFromSkBitmap(offscreen_bitmap);
if (!icon.is_valid())
return;
}
diff --git a/chrome/browser/ui/views/status_icons/status_icon_win.cc b/chrome/browser/ui/views/status_icons/status_icon_win.cc
index 2ebe5f9..e153be21 100644
--- a/chrome/browser/ui/views/status_icons/status_icon_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_icon_win.cc
@@ -100,7 +100,7 @@ void StatusIconWin::SetImage(const gfx::ImageSkia& image) {
NOTIFYICONDATA icon_data;
InitIconData(&icon_data);
icon_data.uFlags = NIF_ICON;
- icon_ = IconUtil::CreateHICONFromSkBitmap(*image.bitmap()).Pass();
+ icon_ = IconUtil::CreateHICONFromSkBitmap(*image.bitmap());
icon_data.hIcon = icon_.get();
BOOL result = Shell_NotifyIcon(NIM_MODIFY, &icon_data);
if (!result)
@@ -133,7 +133,7 @@ void StatusIconWin::DisplayBalloon(
base::win::Version win_version = base::win::GetVersion();
if (!icon.isNull() && win_version != base::win::VERSION_PRE_XP) {
- balloon_icon_ = IconUtil::CreateHICONFromSkBitmap(*icon.bitmap()).Pass();
+ balloon_icon_ = IconUtil::CreateHICONFromSkBitmap(*icon.bitmap());
if (win_version >= base::win::VERSION_VISTA) {
icon_data.hBalloonIcon = balloon_icon_.get();
icon_data.dwInfoFlags = NIIF_USER | NIIF_LARGE_ICON;
diff --git a/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc b/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
index e22a52c..8ca91be 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_state_changer_interactive_uitest_win.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h"
+#include <utility>
+
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/win/scoped_com_initializer.h"
@@ -57,7 +59,7 @@ class StatusTrayStateChangerWinTest : public testing::Test {
DCHECK_EQ(notify_item->hwnd, icon_window());
DCHECK_EQ(notify_item->id, icon_id());
- return notify_item.Pass();
+ return notify_item;
}
bool CallCreateTrayNotify() { return tray_watcher_->CreateTrayNotify(); }
@@ -68,7 +70,7 @@ class StatusTrayStateChangerWinTest : public testing::Test {
}
void SendNotifyItemUpdate(scoped_ptr<NOTIFYITEM> notify_item) {
- tray_watcher_->SendNotifyItemUpdate(notify_item.Pass());
+ tray_watcher_->SendNotifyItemUpdate(std::move(notify_item));
}
scoped_ptr<NOTIFYITEM> GetNotifyItem() {
@@ -108,18 +110,18 @@ TEST_F(StatusTrayStateChangerWinTest, DISABLED_ComApiTest) {
if (notify_item->preference != PREFERENCE_SHOW_WHEN_ACTIVE) {
scoped_ptr<NOTIFYITEM> notify_item_copy(new NOTIFYITEM(*notify_item));
notify_item_copy->preference = PREFERENCE_SHOW_WHEN_ACTIVE;
- SendNotifyItemUpdate(notify_item_copy.Pass());
+ SendNotifyItemUpdate(std::move(notify_item_copy));
}
// Run the interesting code.
tray_watcher_->EnsureTrayIconVisible();
EXPECT_EQ(PREFERENCE_SHOW_ALWAYS, GetNotifyItem()->preference);
- SendNotifyItemUpdate(notify_item.Pass());
+ SendNotifyItemUpdate(std::move(notify_item));
notify_item = GetNotifyItem();
EXPECT_EQ(notify_item->preference, current_preference);
-};
+}
// Test is disabled due to multiple COM initialization errors. See
// http//crbug.com/367199 for details.
@@ -161,7 +163,7 @@ TEST_F(StatusTrayStateChangerWinTest, DISABLED_TraySizeApiTest) {
EXPECT_GT(new_width, width);
- SendNotifyItemUpdate(notify_item.Pass());
+ SendNotifyItemUpdate(std::move(notify_item));
::GetWindowRect(tray_notify_hwnd, &new_tray_notify_rect);
new_width = new_tray_notify_rect.right - new_tray_notify_rect.left;
EXPECT_EQ(width, new_width);
diff --git a/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc b/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc
index 053ac9a..7021d40 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_state_changer_win.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/status_icons/status_tray_state_changer_win.h"
+#include <utility>
+
namespace {
////////////////////////////////////////////////////////////////////////////////
@@ -78,7 +80,7 @@ void StatusTrayStateChangerWin::EnsureTrayIconVisible() {
notify_item->preference = PREFERENCE_SHOW_ALWAYS;
- SendNotifyItemUpdate(notify_item.Pass());
+ SendNotifyItemUpdate(std::move(notify_item));
}
STDMETHODIMP_(ULONG) StatusTrayStateChangerWin::AddRef() {
@@ -168,10 +170,7 @@ scoped_ptr<NOTIFYITEM> StatusTrayStateChangerWin::RegisterCallback() {
NOTREACHED();
}
- // Adding an intermediate scoped pointer here so that |notify_item_| is reset
- // to NULL.
- scoped_ptr<NOTIFYITEM> rv(notify_item_.release());
- return rv.Pass();
+ return std::move(notify_item_);
}
bool StatusTrayStateChangerWin::RegisterCallbackWin8() {
diff --git a/chrome/browser/ui/views/status_icons/status_tray_win.cc b/chrome/browser/ui/views/status_icons/status_tray_win.cc
index 301001d..913d11a 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_win.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_win.cc
@@ -6,6 +6,8 @@
#include <commctrl.h>
+#include <utility>
+
#include "base/bind.h"
#include "base/location.h"
#include "base/macros.h"
@@ -230,7 +232,7 @@ UINT StatusTrayWin::NextIconId() {
void StatusTrayWin::SetStatusTrayStateChangerProxyForTest(
scoped_ptr<StatusTrayStateChangerProxy> proxy) {
- state_changer_proxy_ = proxy.Pass();
+ state_changer_proxy_ = std::move(proxy);
}
StatusTray* StatusTray::Create() {
diff --git a/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc b/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc
index b7c9898..58f78e1 100644
--- a/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc
+++ b/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc
@@ -7,6 +7,8 @@
#include <commctrl.h>
#include <stddef.h>
+#include <utility>
+
#include "base/macros.h"
#include "chrome/browser/status_icons/status_icon_menu_model.h"
#include "chrome/browser/status_icons/status_icon_observer.h"
@@ -76,7 +78,7 @@ TEST(StatusTrayWinTest, CreateIconAndMenu) {
StatusIcon* icon = CreateStatusIcon(&tray);
scoped_ptr<StatusIconMenuModel> menu(new StatusIconMenuModel(NULL));
menu->AddItem(0, L"foo");
- icon->SetContextMenu(menu.Pass());
+ icon->SetContextMenu(std::move(menu));
}
#if !defined(USE_AURA) // http://crbug.com/156370
diff --git a/chrome/chrome_watcher/chrome_watcher_main.cc b/chrome/chrome_watcher/chrome_watcher_main.cc
index 2bf2151..18f4b5a 100644
--- a/chrome/chrome_watcher/chrome_watcher_main.cc
+++ b/chrome/chrome_watcher/chrome_watcher_main.cc
@@ -5,6 +5,8 @@
#include <windows.h>
#include <sddl.h>
+#include <utility>
+
#include "base/at_exit.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -117,7 +119,7 @@ bool BrowserMonitor::StartWatching(
const base::char16* registry_path,
base::Process process,
base::win::ScopedHandle on_initialized_event) {
- if (!exit_code_watcher_.Initialize(process.Pass()))
+ if (!exit_code_watcher_.Initialize(std::move(process)))
return false;
if (!background_thread_.StartWithOptions(
@@ -127,7 +129,7 @@ bool BrowserMonitor::StartWatching(
if (!background_thread_.task_runner()->PostTask(
FROM_HERE, base::Bind(&BrowserMonitor::Watch, base::Unretained(this),
- base::Passed(on_initialized_event.Pass())))) {
+ base::Passed(&on_initialized_event)))) {
background_thread_.Stop();
return false;
}
@@ -414,7 +416,7 @@ extern "C" int WatcherMain(const base::char16* registry_path,
base::RunLoop run_loop;
BrowserMonitor monitor(&run_loop, registry_path);
if (!monitor.StartWatching(registry_path, process.Duplicate(),
- on_initialized_event.Pass())) {
+ std::move(on_initialized_event))) {
return 1;
}
diff --git a/chrome/installer/test/alternate_version_generator.cc b/chrome/installer/test/alternate_version_generator.cc
index 1a367c2..b50e026 100644
--- a/chrome/installer/test/alternate_version_generator.cc
+++ b/chrome/installer/test/alternate_version_generator.cc
@@ -211,7 +211,7 @@ bool MappedFile::Initialize(base::File file) {
} else {
PLOG(DFATAL) << "file.GetInfo failed";
}
- file_ = file.Pass();
+ file_ = std::move(file);
return result;
}
@@ -391,7 +391,7 @@ bool UpdateVersionIfMatch(const base::FilePath& image_file,
if (file.IsValid()) {
MappedFile image_mapping;
- if (image_mapping.Initialize(file.Pass())) {
+ if (image_mapping.Initialize(std::move(file))) {
base::win::PEImageAsData image(
reinterpret_cast<HMODULE>(image_mapping.data()));
// PEImage class does not support other-architecture images.
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 317086e..c9be46d 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -9,6 +9,8 @@
#include "chrome/installer/util/browser_distribution.h"
+#include <utility>
+
#include "base/atomicops.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -57,9 +59,9 @@ BrowserDistribution::BrowserDistribution()
}
BrowserDistribution::BrowserDistribution(
- Type type, scoped_ptr<AppRegistrationData> app_reg_data)
- : type_(type), app_reg_data_(app_reg_data.Pass()) {
-}
+ Type type,
+ scoped_ptr<AppRegistrationData> app_reg_data)
+ : type_(type), app_reg_data_(std::move(app_reg_data)) {}
BrowserDistribution::~BrowserDistribution() {}
diff --git a/chrome/installer/util/chromium_binaries_distribution.cc b/chrome/installer/util/chromium_binaries_distribution.cc
index 6586432..c1a278c 100644
--- a/chrome/installer/util/chromium_binaries_distribution.cc
+++ b/chrome/installer/util/chromium_binaries_distribution.cc
@@ -6,6 +6,8 @@
#include "chrome/installer/util/google_chrome_binaries_distribution.h"
+#include <utility>
+
#include "base/logging.h"
#include "chrome/installer/util/app_registration_data.h"
#include "chrome/installer/util/non_updating_app_registration_data.h"
@@ -27,10 +29,9 @@ ChromiumBinariesDistribution::ChromiumBinariesDistribution()
ChromiumBinariesDistribution::ChromiumBinariesDistribution(
scoped_ptr<AppRegistrationData> app_reg_data)
- : BrowserDistribution(CHROME_BINARIES, app_reg_data.Pass()),
+ : BrowserDistribution(CHROME_BINARIES, std::move(app_reg_data)),
browser_distribution_(
- BrowserDistribution::GetSpecificDistribution(CHROME_BROWSER)) {
-}
+ BrowserDistribution::GetSpecificDistribution(CHROME_BROWSER)) {}
base::string16 ChromiumBinariesDistribution::GetBaseAppName() {
NOTREACHED();
diff --git a/chrome/installer/util/firewall_manager_win.cc b/chrome/installer/util/firewall_manager_win.cc
index 8c517bd..bec05ca 100644
--- a/chrome/installer/util/firewall_manager_win.cc
+++ b/chrome/installer/util/firewall_manager_win.cc
@@ -6,6 +6,8 @@
#include <stdint.h>
+#include <utility>
+
#include "base/files/file_path.h"
#include "base/macros.h"
#include "base/strings/string16.h"
@@ -108,15 +110,15 @@ scoped_ptr<FirewallManager> FirewallManager::Create(
scoped_ptr<FirewallManagerAdvancedImpl> manager(
new FirewallManagerAdvancedImpl());
if (manager->Init(dist->GetDisplayName(), chrome_path))
- return manager.Pass();
+ return std::move(manager);
// Next try to connect to "Windows Firewall for Windows XP with SP2".
scoped_ptr<FirewallManagerLegacyImpl> legacy_manager(
new FirewallManagerLegacyImpl());
if (legacy_manager->Init(dist->GetDisplayName(), chrome_path))
- return legacy_manager.Pass();
+ return std::move(legacy_manager);
- return scoped_ptr<FirewallManager>();
+ return nullptr;
}
FirewallManager::FirewallManager() {
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index f597a98..d114a8b 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -11,6 +11,8 @@
#include <msi.h>
#include <shellapi.h>
+#include <utility>
+
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
@@ -101,8 +103,7 @@ GoogleChromeDistribution::GoogleChromeDistribution()
GoogleChromeDistribution::GoogleChromeDistribution(
scoped_ptr<AppRegistrationData> app_reg_data)
- : BrowserDistribution(CHROME_BROWSER, app_reg_data.Pass()) {
-}
+ : BrowserDistribution(CHROME_BROWSER, std::move(app_reg_data)) {}
void GoogleChromeDistribution::DoPostUninstallOperations(
const Version& version,
diff --git a/chrome/installer/util/google_chrome_distribution_dummy.cc b/chrome/installer/util/google_chrome_distribution_dummy.cc
index 3a444a8..cb62e51 100644
--- a/chrome/installer/util/google_chrome_distribution_dummy.cc
+++ b/chrome/installer/util/google_chrome_distribution_dummy.cc
@@ -12,6 +12,8 @@
#include <windows.h>
+#include <utility>
+
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/values.h"
@@ -27,8 +29,7 @@ GoogleChromeDistribution::GoogleChromeDistribution()
GoogleChromeDistribution::GoogleChromeDistribution(
scoped_ptr<AppRegistrationData> app_reg_data)
- : BrowserDistribution(CHROME_BROWSER, app_reg_data.Pass()) {
-}
+ : BrowserDistribution(CHROME_BROWSER, std::move(app_reg_data)) {}
void GoogleChromeDistribution::DoPostUninstallOperations(
const Version& version,
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index 6ed2852..3e17677 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -334,7 +334,7 @@ scoped_ptr<metrics::ClientInfo> GoogleUpdateSettings::LoadMetricsClientInfo() {
&client_info->reporting_enabled_date);
}
- return client_info.Pass();
+ return client_info;
}
void GoogleUpdateSettings::StoreMetricsClientInfo(
diff --git a/chrome/service/cloud_print/cdd_conversion_win.cc b/chrome/service/cloud_print/cdd_conversion_win.cc
index 24ed3cb..480b74b 100644
--- a/chrome/service/cloud_print/cdd_conversion_win.cc
+++ b/chrome/service/cloud_print/cdd_conversion_win.cc
@@ -24,12 +24,12 @@ scoped_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode(
cloud_devices::CloudDeviceDescription description;
if (!description.InitFromString(print_ticket))
- return dev_mode.Pass();
+ return dev_mode;
using namespace cloud_devices::printer;
printing::ScopedPrinterHandle printer;
if (!printer.OpenPrinter(printer_name.c_str()))
- return dev_mode.Pass();
+ return dev_mode;
{
ColorTicketItem color;
@@ -43,7 +43,7 @@ scoped_ptr<DEVMODE, base::FreeDeleter> CjtToDevMode(
}
if (!dev_mode)
- return dev_mode.Pass();
+ return dev_mode;
ColorTicketItem color;
DuplexTicketItem duplex;
diff --git a/chrome/service/service_utility_process_host.cc b/chrome/service/service_utility_process_host.cc
index 15748c4..ee38b9b 100644
--- a/chrome/service/service_utility_process_host.cc
+++ b/chrome/service/service_utility_process_host.cc
@@ -7,6 +7,7 @@
#include <stdint.h>
#include <queue>
+#include <utility>
#include "base/bind.h"
#include "base/command_line.h"
@@ -94,7 +95,7 @@ class ServiceUtilityProcessHost::PdfToEmfState {
if (!temp_dir_.CreateUniqueTempDir())
return false;
return host_->Send(new ChromeUtilityMsg_RenderPDFPagesToMetafiles(
- IPC::TakeFileHandleForProcess(pdf_file.Pass(), host_->handle()),
+ IPC::TakeFileHandleForProcess(std::move(pdf_file), host_->handle()),
conversion_settings));
}
@@ -126,9 +127,9 @@ class ServiceUtilityProcessHost::PdfToEmfState {
DCHECK(!emf_files_.empty());
base::File file;
if (!emf_files_.empty())
- file = emf_files_.front().Pass();
+ file = std::move(emf_files_.front());
emf_files_.pop();
- return file.Pass();
+ return file;
}
void set_page_count(int page_count) { page_count_ = page_count; }
@@ -187,7 +188,7 @@ bool ServiceUtilityProcessHost::StartRenderPDFPagesToMetafile(
waiting_for_reply_ = true;
pdf_to_emf_state_.reset(new PdfToEmfState(this));
- return pdf_to_emf_state_->Start(pdf_file.Pass(), render_settings);
+ return pdf_to_emf_state_->Start(std::move(pdf_file), render_settings);
}
bool ServiceUtilityProcessHost::StartGetPrinterCapsAndDefaults(
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc
index dc50b5b..e396492 100644
--- a/chrome/utility/printing_handler.cc
+++ b/chrome/utility/printing_handler.cc
@@ -76,7 +76,7 @@ void PrintingHandler::OnRenderPDFPagesToMetafile(
const PdfRenderSettings& settings) {
pdf_rendering_settings_ = settings;
base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit);
- int page_count = LoadPDF(pdf_file.Pass());
+ int page_count = LoadPDF(std::move(pdf_file));
Send(
new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount(page_count));
}
@@ -87,7 +87,7 @@ void PrintingHandler::OnRenderPDFPagesToMetafileGetPage(
base::File emf_file = IPC::PlatformFileForTransitToFile(output_file);
float scale_factor = 1.0f;
bool success =
- RenderPdfPageToMetafile(page_number, emf_file.Pass(), &scale_factor);
+ RenderPdfPageToMetafile(page_number, std::move(emf_file), &scale_factor);
Send(new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone(
success, scale_factor));
}