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

Unified Diff: components/leveldb_proto/testing/fake_db.h

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (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
« no previous file with comments | « components/leveldb_proto/proto_database_impl_unittest.cc ('k') | components/login/screens/screen_context.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/leveldb_proto/testing/fake_db.h
diff --git a/components/leveldb_proto/testing/fake_db.h b/components/leveldb_proto/testing/fake_db.h
index 3552377fc8e6f0870ee70de3c17272fdaa3ea75b..4ff6b43ca1bbce349f7da07d1a8266207eb1cbbd 100644
--- a/components/leveldb_proto/testing/fake_db.h
+++ b/components/leveldb_proto/testing/fake_db.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_LEVELDB_PROTO_TESTING_FAKE_DB_H_
#define COMPONENTS_LEVELDB_PROTO_TESTING_FAKE_DB_H_
+#include <memory>
#include <string>
#include <utility>
#include <vector>
@@ -12,7 +13,6 @@
#include "base/bind.h"
#include "base/callback.h"
#include "base/files/file_path.h"
-#include "base/memory/scoped_ptr.h"
#include "components/leveldb_proto/proto_database.h"
namespace leveldb_proto {
@@ -33,8 +33,9 @@ class FakeDB : public ProtoDatabase<T> {
const base::FilePath& database_dir,
const typename ProtoDatabase<T>::InitCallback& callback) override;
void UpdateEntries(
- scoped_ptr<typename ProtoDatabase<T>::KeyEntryVector> entries_to_save,
- scoped_ptr<std::vector<std::string>> keys_to_remove,
+ std::unique_ptr<typename ProtoDatabase<T>::KeyEntryVector>
+ entries_to_save,
+ std::unique_ptr<std::vector<std::string>> keys_to_remove,
const typename ProtoDatabase<T>::UpdateCallback& callback) override;
void LoadEntries(
const typename ProtoDatabase<T>::LoadCallback& callback) override;
@@ -54,7 +55,7 @@ class FakeDB : public ProtoDatabase<T> {
private:
static void RunLoadCallback(
const typename ProtoDatabase<T>::LoadCallback& callback,
- scoped_ptr<typename std::vector<T>> entries,
+ std::unique_ptr<typename std::vector<T>> entries,
bool success);
base::FilePath dir_;
@@ -82,8 +83,8 @@ void FakeDB<T>::Init(const char* client_name,
template <typename T>
void FakeDB<T>::UpdateEntries(
- scoped_ptr<typename ProtoDatabase<T>::KeyEntryVector> entries_to_save,
- scoped_ptr<std::vector<std::string>> keys_to_remove,
+ std::unique_ptr<typename ProtoDatabase<T>::KeyEntryVector> entries_to_save,
+ std::unique_ptr<std::vector<std::string>> keys_to_remove,
const typename ProtoDatabase<T>::UpdateCallback& callback) {
for (const auto& pair : *entries_to_save)
(*db_)[pair.first] = pair.second;
@@ -97,7 +98,7 @@ void FakeDB<T>::UpdateEntries(
template <typename T>
void FakeDB<T>::LoadEntries(
const typename ProtoDatabase<T>::LoadCallback& callback) {
- scoped_ptr<std::vector<T>> entries(new std::vector<T>());
+ std::unique_ptr<std::vector<T>> entries(new std::vector<T>());
for (const auto& pair : *db_)
entries->push_back(pair.second);
@@ -137,7 +138,7 @@ void FakeDB<T>::UpdateCallback(bool success) {
template <typename T>
void FakeDB<T>::RunLoadCallback(
const typename ProtoDatabase<T>::LoadCallback& callback,
- scoped_ptr<typename std::vector<T>> entries,
+ std::unique_ptr<typename std::vector<T>> entries,
bool success) {
callback.Run(success, std::move(entries));
}
« no previous file with comments | « components/leveldb_proto/proto_database_impl_unittest.cc ('k') | components/login/screens/screen_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698