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

Unified Diff: chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc

Issue 1551503002: Convert Pass()→std::move() in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
diff --git a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
index 5578361232f77c5e962487515043095b16535a76..8803aaab57f45a468feb7550b68a03987b1b23cb 100644
--- a/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
+++ b/chrome/browser/media_galleries/fileapi/supported_image_type_validator.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/media_galleries/fileapi/supported_image_type_validator.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file.h"
@@ -30,12 +32,12 @@ scoped_ptr<std::string> ReadOnFileThread(const base::FilePath& path) {
base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ);
if (!file.IsValid())
- return result.Pass();
+ return result;
base::File::Info file_info;
if (!file.GetInfo(&file_info) ||
file_info.size > kMaxImageFileSize) {
- return result.Pass();
+ return result;
}
result.reset(new std::string);
@@ -45,7 +47,7 @@ scoped_ptr<std::string> ReadOnFileThread(const base::FilePath& path) {
result.reset();
}
- return result.Pass();
+ return result;
}
class ImageDecoderDelegateAdapter : public ImageDecoder::ImageRequest {
@@ -53,8 +55,7 @@ class ImageDecoderDelegateAdapter : public ImageDecoder::ImageRequest {
ImageDecoderDelegateAdapter(
scoped_ptr<std::string> data,
const storage::CopyOrMoveFileValidator::ResultCallback& callback)
- : data_(data.Pass()),
- callback_(callback) {
+ : data_(std::move(data)), callback_(callback) {
DCHECK(data_);
}
@@ -127,6 +128,6 @@ void SupportedImageTypeValidator::OnFileOpen(scoped_ptr<std::string> data) {
// |adapter| will delete itself after a completion message is received.
ImageDecoderDelegateAdapter* adapter =
- new ImageDecoderDelegateAdapter(data.Pass(), callback_);
+ new ImageDecoderDelegateAdapter(std::move(data), callback_);
ImageDecoder::Start(adapter, adapter->data());
}

Powered by Google App Engine
This is Rietveld 408576698