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

Unified Diff: content/browser/fileapi/blob_reader_unittest.cc

Issue 1545243002: Convert Pass()→std::move() in //content/browser (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
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/browser/fileapi/blob_storage_context_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/fileapi/blob_reader_unittest.cc
diff --git a/content/browser/fileapi/blob_reader_unittest.cc b/content/browser/fileapi/blob_reader_unittest.cc
index 66c5da683e2c9e1c011ef260cf5bb116ee69f39e..d16b552d392dc922e8ff8ff9bd246ca3a609530d 100644
--- a/content/browser/fileapi/blob_reader_unittest.cc
+++ b/content/browser/fileapi/blob_reader_unittest.cc
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "storage/browser/blob/blob_reader.h"
-
#include <stddef.h>
#include <stdint.h>
#include <string.h>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -29,6 +28,7 @@
#include "net/disk_cache/disk_cache.h"
#include "storage/browser/blob/blob_data_builder.h"
#include "storage/browser/blob/blob_data_handle.h"
+#include "storage/browser/blob/blob_reader.h"
#include "storage/browser/blob/blob_storage_context.h"
#include "storage/browser/fileapi/file_stream_reader.h"
#include "storage/browser/fileapi/file_system_context.h"
@@ -60,7 +60,7 @@ class EmptyDataHandle : public storage::BlobDataBuilder::DataHandle {
class DelayedReadEntry : public disk_cache::Entry {
public:
explicit DelayedReadEntry(disk_cache::ScopedEntryPtr entry)
- : entry_(entry.Pass()) {}
+ : entry_(std::move(entry)) {}
~DelayedReadEntry() override { EXPECT_FALSE(HasPendingReadCallbacks()); }
bool HasPendingReadCallbacks() { return !pending_read_callbacks_.empty(); }
@@ -154,7 +154,7 @@ scoped_ptr<disk_cache::Backend> CreateInMemoryDiskCache(
thread, nullptr, &cache, callback.callback());
EXPECT_EQ(net::OK, callback.GetResult(rv));
- return cache.Pass();
+ return cache;
}
disk_cache::ScopedEntryPtr CreateDiskCacheEntry(disk_cache::Backend* cache,
@@ -171,7 +171,7 @@ disk_cache::ScopedEntryPtr CreateDiskCacheEntry(disk_cache::Backend* cache,
rv = entry->WriteData(kTestDiskCacheStreamIndex, 0, iobuffer.get(),
iobuffer->size(), callback.callback(), false);
EXPECT_EQ(static_cast<int>(data.size()), callback.GetResult(rv));
- return entry.Pass();
+ return entry;
}
template <typename T>
@@ -325,10 +325,10 @@ class BlobReaderTest : public ::testing::Test {
protected:
void InitializeReader(BlobDataBuilder* builder) {
- blob_handle_ = builder ? context_.AddFinishedBlob(builder).Pass() : nullptr;
+ blob_handle_ = builder ? context_.AddFinishedBlob(builder) : nullptr;
provider_ = new MockFileStreamReaderProvider();
scoped_ptr<BlobReader::FileStreamReaderProvider> temp_ptr(provider_);
- reader_.reset(new BlobReader(blob_handle_.get(), temp_ptr.Pass(),
+ reader_.reset(new BlobReader(blob_handle_.get(), std::move(temp_ptr),
message_loop_.task_runner().get()));
}
@@ -729,7 +729,7 @@ TEST_F(BlobReaderTest, DiskCacheAsync) {
scoped_refptr<BlobDataBuilder::DataHandle> data_handle =
new EmptyDataHandle();
scoped_ptr<DelayedReadEntry> delayed_read_entry(new DelayedReadEntry(
- CreateDiskCacheEntry(cache.get(), "test entry", kData).Pass()));
+ CreateDiskCacheEntry(cache.get(), "test entry", kData)));
b.AppendDiskCacheEntry(data_handle, delayed_read_entry.get(),
kTestDiskCacheStreamIndex);
this->InitializeReader(&b);
« no previous file with comments | « content/browser/download/save_package.cc ('k') | content/browser/fileapi/blob_storage_context_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698