Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1721)

Unified Diff: chrome/browser/printing/pdf_to_emf_converter.cc

Issue 1752233002: Convert Pass()→std::move() on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/policy/chrome_browser_policy_connector.cc ('k') | chrome/browser/printing/print_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/pdf_to_emf_converter.cc
diff --git a/chrome/browser/printing/pdf_to_emf_converter.cc b/chrome/browser/printing/pdf_to_emf_converter.cc
index 8656dd55fbe0b684af7e209a8ebf1355ce22e0a1..17d235632d0749446b673034500d21b4c74811a3 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,
« no previous file with comments | « chrome/browser/policy/chrome_browser_policy_connector.cc ('k') | chrome/browser/printing/print_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698