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

Unified Diff: sync/internal_api/public/model_type_store_impl.h

Issue 1866243002: Convert //sync 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
Index: sync/internal_api/public/model_type_store_impl.h
diff --git a/sync/internal_api/public/model_type_store_impl.h b/sync/internal_api/public/model_type_store_impl.h
index 227afa0d0d9c1934f307d511a2087635cc786def..88bd8fa9703e1d1bf408b06cebc3f5a51820addc 100644
--- a/sync/internal_api/public/model_type_store_impl.h
+++ b/sync/internal_api/public/model_type_store_impl.h
@@ -5,10 +5,10 @@
#ifndef SYNC_INTERNAL_API_PUBLIC_MODEL_TYPE_STORE_IMPL_H_
#define SYNC_INTERNAL_API_PUBLIC_MODEL_TYPE_STORE_IMPL_H_
+#include <memory>
#include <string>
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "sync/api/model_type_store.h"
@@ -39,8 +39,8 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
const ReadDataCallback& callback) override;
void ReadAllData(const ReadAllDataCallback& callback) override;
void ReadAllMetadata(const ReadMetadataCallback& callback) override;
- scoped_ptr<WriteBatch> CreateWriteBatch() override;
- void CommitWriteBatch(scoped_ptr<WriteBatch> write_batch,
+ std::unique_ptr<WriteBatch> CreateWriteBatch() override;
+ void CommitWriteBatch(std::unique_ptr<WriteBatch> write_batch,
const CallbackWithResult& callback) override;
void WriteData(WriteBatch* write_batch,
const std::string& id,
@@ -59,11 +59,11 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
public:
WriteBatchImpl();
~WriteBatchImpl() override;
- scoped_ptr<leveldb::WriteBatch> leveldb_write_batch_;
+ std::unique_ptr<leveldb::WriteBatch> leveldb_write_batch_;
};
static void BackendInitDone(const InitCallback& callback,
- scoped_ptr<ModelTypeStoreImpl> store,
+ std::unique_ptr<ModelTypeStoreImpl> store,
Result result);
// Format key for data/metadata records with given id.
@@ -73,24 +73,24 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
static leveldb::WriteBatch* GetLeveldbWriteBatch(WriteBatch* write_batch);
ModelTypeStoreImpl(
- scoped_ptr<ModelTypeStoreBackend> backend,
+ std::unique_ptr<ModelTypeStoreBackend> backend,
scoped_refptr<base::SequencedTaskRunner> backend_task_runner);
// Callbacks for different calls to ModelTypeStoreBackend.
void ReadDataDone(const ReadDataCallback& callback,
- scoped_ptr<RecordList> record_list,
- scoped_ptr<IdList> missing_id_list,
+ std::unique_ptr<RecordList> record_list,
+ std::unique_ptr<IdList> missing_id_list,
Result result);
void ReadAllDataDone(const ReadAllDataCallback& callback,
- scoped_ptr<RecordList> record_list,
+ std::unique_ptr<RecordList> record_list,
Result result);
void ReadMetadataRecordsDone(const ReadMetadataCallback& callback,
- scoped_ptr<RecordList> metadata_records,
+ std::unique_ptr<RecordList> metadata_records,
Result result);
void ReadAllMetadataDone(const ReadMetadataCallback& callback,
- scoped_ptr<RecordList> metadata_records,
- scoped_ptr<RecordList> global_metadata_records,
- scoped_ptr<IdList> missing_id_list,
+ std::unique_ptr<RecordList> metadata_records,
+ std::unique_ptr<RecordList> global_metadata_records,
+ std::unique_ptr<IdList> missing_id_list,
Result result);
void WriteModificationsDone(const CallbackWithResult& callback,
Result result);
@@ -98,7 +98,7 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
// Backend is owned by store, but should be deleted on backend thread. To
// accomplish this store's dtor posts task to backend thread passing backend
// ownership to task parameter.
- scoped_ptr<ModelTypeStoreBackend> backend_;
+ std::unique_ptr<ModelTypeStoreBackend> backend_;
scoped_refptr<base::SequencedTaskRunner> backend_task_runner_;
base::WeakPtrFactory<ModelTypeStoreImpl> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698