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

Unified Diff: net/disk_cache/simple/simple_index_unittest.cc

Issue 1894733002: Change scoped_ptr to std::unique_ptr in //net/disk_cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: net/disk_cache/simple/simple_index_unittest.cc
diff --git a/net/disk_cache/simple/simple_index_unittest.cc b/net/disk_cache/simple/simple_index_unittest.cc
index 649d48f538c2f74701109d73237d11e63149ec27..3776c27e688a7192b9f363ca72230882fae7d804 100644
--- a/net/disk_cache/simple/simple_index_unittest.cc
+++ b/net/disk_cache/simple/simple_index_unittest.cc
@@ -6,12 +6,12 @@
#include <algorithm>
#include <functional>
+#include <memory>
#include <utility>
#include "base/files/scoped_temp_dir.h"
#include "base/hash.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/pickle.h"
#include "base/sha1.h"
#include "base/strings/stringprintf.h"
@@ -105,7 +105,7 @@ class SimpleIndexTest : public testing::Test, public SimpleIndexDelegate {
}
void SetUp() override {
- scoped_ptr<MockSimpleIndexFile> index_file(new MockSimpleIndexFile());
+ std::unique_ptr<MockSimpleIndexFile> index_file(new MockSimpleIndexFile());
index_file_ = index_file->AsWeakPtr();
index_.reset(
new SimpleIndex(NULL, this, net::DISK_CACHE, std::move(index_file)));
@@ -161,7 +161,7 @@ class SimpleIndexTest : public testing::Test, public SimpleIndexDelegate {
int doom_entries_calls() const { return doom_entries_calls_; }
const simple_util::ImmutableArray<uint64_t, 16> hashes_;
- scoped_ptr<SimpleIndex> index_;
+ std::unique_ptr<SimpleIndex> index_;
base::WeakPtr<MockSimpleIndexFile> index_file_;
std::vector<uint64_t> last_doom_entry_hashes_;
@@ -207,13 +207,13 @@ TEST_F(SimpleIndexTest, IndexSizeCorrectOnMerge) {
index()->UpdateEntrySize(hashes_.at<4>(), 4);
EXPECT_EQ(9U, index()->cache_size_);
{
- scoped_ptr<SimpleIndexLoadResult> result(new SimpleIndexLoadResult());
+ std::unique_ptr<SimpleIndexLoadResult> result(new SimpleIndexLoadResult());
result->did_load = true;
index()->MergeInitializingSet(std::move(result));
}
EXPECT_EQ(9U, index()->cache_size_);
{
- scoped_ptr<SimpleIndexLoadResult> result(new SimpleIndexLoadResult());
+ std::unique_ptr<SimpleIndexLoadResult> result(new SimpleIndexLoadResult());
result->did_load = true;
const uint64_t new_hash_key = hashes_.at<11>();
result->entries.insert(
« no previous file with comments | « net/disk_cache/simple/simple_index_file_unittest.cc ('k') | net/disk_cache/simple/simple_net_log_parameters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698