summaryrefslogtreecommitdiffstats
path: root/base/files
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-11-24 21:29:58 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-25 05:30:56 +0000
commit0c8d4aa8ba54f463cc22ce21bf1088edd3d1e207 (patch)
tree02600e7d74e72eaa08f2eb3d47697a8d35f34390 /base/files
parent7296f934bf1ab8c1b62e49c81f2eecb397389144 (diff)
downloadchromium_src-0c8d4aa8ba54f463cc22ce21bf1088edd3d1e207.zip
chromium_src-0c8d4aa8ba54f463cc22ce21bf1088edd3d1e207.tar.gz
chromium_src-0c8d4aa8ba54f463cc22ce21bf1088edd3d1e207.tar.bz2
base: Use std::move() instead of Pass() for real movable types.
Some of our movable types have real move-constructors/assignment operators now. We can use std::move() for these types instead of Pass(). There's still some move-only types that are implemented using an "Rvalue" type emulation, so we have to keep Pass() for those still. R=thestig@chromium.org BUG=557422 Review URL: https://codereview.chromium.org/1479473002 Cr-Commit-Position: refs/heads/master@{#361583}
Diffstat (limited to 'base/files')
-rw-r--r--base/files/file_path_watcher.h5
-rw-r--r--base/files/important_file_writer.cc4
-rw-r--r--base/files/memory_mapped_file_unittest.cc2
3 files changed, 5 insertions, 6 deletions
diff --git a/base/files/file_path_watcher.h b/base/files/file_path_watcher.h
index 4f132af..834acbc 100644
--- a/base/files/file_path_watcher.h
+++ b/base/files/file_path_watcher.h
@@ -62,9 +62,8 @@ class BASE_EXPORT FilePathWatcher {
return task_runner_;
}
- void set_task_runner(
- scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
- task_runner_ = task_runner.Pass();
+ void set_task_runner(scoped_refptr<base::SingleThreadTaskRunner> runner) {
+ task_runner_ = std::move(runner);
}
// Must be called before the PlatformDelegate is deleted.
diff --git a/base/files/important_file_writer.cc b/base/files/important_file_writer.cc
index 1529107..4af7137 100644
--- a/base/files/important_file_writer.cc
+++ b/base/files/important_file_writer.cc
@@ -5,8 +5,8 @@
#include "base/files/important_file_writer.h"
#include <stdio.h>
-
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/critical_closure.h"
@@ -191,7 +191,7 @@ void ImportantFileWriter::DoScheduledWrite() {
DCHECK(serializer_);
scoped_ptr<std::string> data(new std::string);
if (serializer_->SerializeData(data.get())) {
- WriteNow(data.Pass());
+ WriteNow(std::move(data));
} else {
DLOG(WARNING) << "failed to serialize data to be saved in "
<< path_.value();
diff --git a/base/files/memory_mapped_file_unittest.cc b/base/files/memory_mapped_file_unittest.cc
index 05b941c..1812d88 100644
--- a/base/files/memory_mapped_file_unittest.cc
+++ b/base/files/memory_mapped_file_unittest.cc
@@ -18,7 +18,7 @@ scoped_ptr<uint8[]> CreateTestBuffer(size_t size, size_t offset) {
scoped_ptr<uint8[]> buf(new uint8[size]);
for (size_t i = 0; i < size; ++i)
buf.get()[i] = static_cast<uint8>((offset + i) % 253);
- return buf.Pass();
+ return buf;
}
// Check that the watermark sequence is consistent with the |offset| provided.